Research Article

Cluster-Based Routing Schema Using Harris Hawks Optimization in the Vehicular Ad Hoc Networks

Algorithm 1

Reliable routing scheme using the HHO algorithm.
Inputs: Size n of the population and MI is the total number of repetitions
Outputs: The position of prey and its fitness function
Step 1:
   Initialize parameters of each vehicle node such as position, direction, and the velocity;
   make a mesh topology across nodes/vertices;
   Initialize Population v1, v2, . . . , vn
   Setting Vp (t) as the best path for the prey
Step 2:
 for t=1 to MI, repeat the following steps: // the size of the maximum iterations
   Compute ff(vi)// Calculate the fitness function
   Update (t) if there is a better solution
   for // vi is hawks
   Compute Ei=2×rand (), δ=2× (1-rand ()) and Ep based on Eq. (12)
   if then compute //Exploration phase
   if then // Exploitation phase
      if (ɩ ≥0.5 && |Ep| ≥0.5)
         compute based on Eq. (13)
      elseif (ɩ ≥0.5 && |Ep| <0.5)
         compute based on Eq. (14)
      elseif (ɩ <0.5 && |Ep| ≥0.5)
         compute based on Eq. (17)
      elseif (ɩ <0.5 && |Ep| <0.5)
         compute based on Eq. (18)
  Current iteration = current iteration+1
 end for
 update
end