Research Article

An Effective Wireless Sensor Network Routing Protocol Based on Particle Swarm Optimization Algorithm

Pseudocode 1

Pseudocode- (PSO-) based routing algorithm.
phase one :[ Initialization Phase]
for (x =0 to number of solutions or populations). for (n =0 to number of sensor nodes).
Arbitrarily solutions are selected. Calculate new route using solution. End for .
Calculate fitness value of initialized solution. Calculate global best and Local best.
End for .
phase two :[Update Phase] while criteria does not match
for (x =1 to number of solutions)
for (n =1 to number of sensor nodes). update solution using PSO update equation. Generate new path based on update solution. End for.
Calculate fit-ness value for updated route. Calculate global best and local best.
End for.
Note the global best End while.