Research Article

A Cluster-Head Rotating Election Routing Protocol for Energy Consumption Optimization in Wireless Sensor Networks

Algorithm 1

Network communication procedure.
Input: Number of sector districts z, central angle of each CH election area α, weight adjustment coefficient χ, radius of the first layer r0, number of layers i, radius coefficient ε, rotation angle β, location of each node, and number of data acquisition rounds per rotation, node morality threshold.
Output: Number of active nodes, residual energy.
Initialization: BS broadcasts the hierarchical clustering instruction. According to location, all the nodes are divided into a total of iz clusters numbered counterclockwise in ascending order.
(1)While Node death rate is below the set threshold do
(2)   CH election, intra-cluster communication, inter-cluster communication.
(3)  for β 0 < θ ≤ 2π/z do
(4)   repeat
(5)    for j Nodes in each CH election area do
(6)     Calculate the score of nodes through equation (7);
(7)    end for
(8)   until Choose the node with the maximum score as the CH for each cluster; Execute pre-determined rounds of data acquisition; Rotate districts and CH election areas β degrees counterclockwise;
(9)   repeat
(10)    for Nodes within each cluster do
(11)     Nodes transmit the data packets to the corresponding CH by single hop;
(12)    end for
(13)   until Each CH receives data packets from every active node in the cluster;
(14)   repeat
(15)    for CHs in the same district do
(16)     CHs transfer data packets from outside to inside;
(17)    end for
(18)   until BS obtains data packets from the CHs in the first layer;
(19)  end for
(20)end