Research Article

Mobility Aware Energy Efficient Clustering for MANET: A Bio-Inspired Approach with Particle Swarm Optimization

Algorithm 2

PSO based cluster formation algorithm.
Input:  (1) A set of nodes  . (2) a set of elected
CHs . (3) swarm size  .
Output:  An assignment A: with maximized objective function.
Begin:
Step  1: Initialize swarm particles
Step  2: for  do
(2.1) Find   using Equation (17)
(2.2) set  
end
Step  3: if
set Gbest = Pbestj
end if
Step  4:while  (Not Terminate) do
for    to    do
(4.1) Each particle    update its velocity and position using
Equations (5) and (6) respectively.
(4.2) Find new    using Equation (17)
(4.3) if    then
(4.4) set  
end
(4.5) if    then
(4.6) set  
end
end
end
Step  5: Assign node    to the CH    in its
transmission range with maximum fitness value i.e Gbest.
Stop.