Skip to main content
. 2026 Feb 19;26(4):1326. doi: 10.3390/s26041326
Algorithm 3 SDVN-Based Routing Process for CAVs
Input: Vehicle task request Req, Nodes u, v
Output: Optimal routing path
1: procedure Vehicle_Association (Req)
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, Req)
9:   Transmit (Req, SDVN_Controller)
10: end procedure
11: procedure Routing (Req, TopologyData)
12:   Source ← Reqsource
13:   Destination ← Reqdestination
14:   for each link (u, v) in TopologyData do
15:     Weight (u, v) ← ComputeWeight (u, v)
16:   end for
17:   Paths ← ShortestPathAlgorithms (Source, Destination, Weight)
18:   Send (Paths, SDVN_Controller)
19: end procedure