Research Article
A Two-Level Communication Routing Algorithm Based on Vehicle Attribute Information for Vehicular Ad Hoc Network
Algorithm 1
How to cluster the vehicles on the road.
| Operation Flow | | 1: Input: the current time, the stop time, and the attribute information | | 2: While the current time is smaller than the stop time | | 3: if the current time is 0 | | 4: regard the current coordinate as the initial coordinate | | 5: increase the current time by | | 6: get the current coordinate of each node | | 7: calculate the distance between a node and other nodes in the scene | | 8: cluster the vehicles on the road | | 9: calculate the number of neighboring vehicle nodes | | 10: calculate the total distance among each node | | 11: calculate the speed of a vehicle node in each cluster | | 12: select the CHs in each cluster at time | | 13: increase the current time by | | 14: End |
|