| Algorithm 3 SDVN-Based Routing Process for CAVs |
|
Input: Vehicle task request , Nodes Output: Optimal routing path 1: procedure Vehicle_Association () 2: CandidateRSUs ← ScanCommunicationRange (Vehicle) 3: for each RSU in CandidateRSUs do 4: LinkQuality (RSU) ← EvaluateLink (RSU) 5: TrafficLoad (RSU) ← GetTrafficLoad (RSU) 6: end for 7: BestRSU ← argmin_{RSU}(TrafficLoad (RSU), LinkQuality (RSU)) 8: QueueVehicleRequest (BestRSU, ) 9: Transmit (, SDVN_Controller) 10: end procedure 11: procedure Routing (, TopologyData) 12: Source ← 13: Destination ← 14: for each link () in TopologyData do 15: Weight () ← ComputeWeight () 16: end for 17: Paths ← ShortestPathAlgorithms (Source, Destination, Weight) 18: Send (Paths, SDVN_Controller) 19: end procedure |