|
Algorithm 4: Cluster head selection optimization algorithm based on IAPSO |
|
Input: Sensor nodes group:
|
| Predefined swarm size:
|
| Number of dimensions of particles:
|
| Largest number of iterations: maxnumber
|
|
Output: Cluster head group:
|
| 1: Initialize particle ,
|
| 2: for
do
|
| 3: (1) Calculate , Using Equation (15) |
| 4: (2)
|
| 5: end for
|
| 6:
|
| 7: for
do
|
| 8: for
do
|
| 9: (1) Update velocity and position of using Equations (18) and (19) |
| 10: (2) Calculate , update and
|
| 11: (3) Output the optimal cluster heads group
|
| 12: end for
|
| 13: end for
|