## 2 Materials and Methods
### Determination of the Cardinal Direction
### Determination of the Topological Sequence of Connected Cars

This section describes an algorithm for determining the topological sequence of each vehicle within a subgroup of connected cars, using the representative direction of vehicles determined in Section 2.3. After the representative direction of the connected cars has been determined, the topological sequence needs to be determined based on the values of latitude and longitude and the representative heading directions. For example, if the representative direction is \"NORTH,\" a vehicle with high latitude is located at the front. The algorithm used can be described as follows. ```
/* Input: v \(\leftarrow\) A list of connected cars, and headingDecision */ BEGIN  orderingMessage \(\leftarrow\) Array of device id, latitude, and longitude of v  IF headingDecision = \"EAST\" THEN sort in descending order by longitude  ELSE IF headingDecision = \"WEST\" THEN sort in ascending order by longitude  ELSE IF headingDecision = \"SOUTH\" THEN sort in ascending order by latitude  ENDIF  RETURN orderingMessage  END
```

**Algorithm 3** Determining the topological sequence of connected cars

### Analysis of the Algorithms

The time complexity of all the proposed algorithms is analyzed as follows. As Algorithm 1 performs only simple arithmetic operations, the time complexity is O(1). Algorithm 2 repeats as many as the number of input connected cars so that the time complexity is O(n). Finally, Algorithm 3 is O(n log n) because it is sorted using the Quick sort algorithm. Therefore, the overall time complexity of the proposed mechanism is O(n log n). ## 3 Results

To verify the three aforementioned algorithms proposed in Section 2, we performed actual road driving experiments and repeated them several times. In these experiments, four Samsung Galaxy smartphones installed with the CMVF client were equipped on each vehicle, and the vehicles were driven by reciprocating on the red line path, which was a one-way two-lane road (14 km), as shown in the map of Figure 2. The device-IDs of each smartphone were as follows: fce77f9031108d9e(abbr. A), b0 af188f450 aec18(abbr. B), 55163c6c125b123b(abbr. C), and bcbd7 edce58f640c(abbr. D). First, all the four vehicles were made to move without connecting them to one another, and the initial screen of each of the four independent CMVF clients are shown in Figure 3. In each of these screens, the shaded area on the upper left shows the topological sequence of all connected vehicles when connected, and at the bottom of the map, driving information of each vehicle such as device-ID and the current time, latitude, longitude, speed, radius as awareness range, and the heading direction is provided. In addition to these basic attributes, various other attributes such as CAM/DENM and BSM specification can also be provided, which are beyond the scope of the present work [27; 28]. Furthermore, it can also be observed from Figure 4 that the topological sequence of these vehicles appear to be in the following logical sequence: B\(\rightarrow\)A\(\rightarrow\)D\(\rightarrow\)C; however, these vehicles are not aware of each other's relative position, as they are not connected. In addition, each dashed circle surrounding the vehicles represents the speed-reactive awareness range by the CMVF client. Outside this area, a time mismatch of roughly 1-2 s appears on the smartphone screens. This mismatch between the smartphones can be attributed to the internal time latency of the smartphones, transmission delay of the wireless mobile network, server processing latency, and so on. However, this paper considers that the absolute time of each smartphone is the same as real time. After a certain period, the two screens depicted on the top in Figure 5 show that vehicle B (device-Id: b0 af188f450 aec18) is increasing to form a connected group with vehicle A (device-Id: fce77f9031108d9e).