Skip to main content
. 2022 Dec 12;22(24):9731. doi: 10.3390/s22249731
Algorithm 1: The primary cluster-heads election
Input: all member nodes in K clusters
Output: the primary cluster-heads in the set C1
-----------------------------------------------------------------------------------------------------------------
(1) For each cluster
(2)     For member nodes within the same cluster
(3)          Calculate the residual energy objective function f1(i), and the distance function f2(i) for each node i
(4)               If the sum of energy of all nodes is greater than half of the initial energy of the network (0.5 * nE0)
(5)                  Calculate the value of the node adaptation function according to P(i) = 1/2*f1(i) + ½ * f2(i)
(6)               Else
(7)                  Calculate the value of the node adaptation function according to P(i) = Eres(i)E0*f1(i) + (1 − Eres(i)E0) * f2(i)
(8)       Find the node with the largest fitness function value and save this node information in the set C1
(9) End