4.2.1. Election of Fusion Cluster Head (APDC)
In order to solve the problems in the election of cluster head of LEACH algorithm, we presented an adaptive double-election hierarchical topology control algorithm APDC based on AP clustering. Since the election strategy based on AP clustering has the defect of too much computation, an election strategy based on the reference point was added to make up for this defect. The two-policy alternation was used to complete the election of cluster head. Firstly, the election strategy based on AP clustering was used to complete the first round of cluster head election, and the election results were recorded as reference nodes. Each round was completed by alternately using these two election strategies according to the validity of the reference nodes. The two election strategies of APDC make up for each other’s shortcomings in the process of rotation, so that the algorithm can adapt to the dynamic changes of sensor networks, such as the changes of energy consumption and the changes of node distribution due to node death, and obtain more reasonable election results of cluster heads.
1. Cluster head election based on AP clustering.
The specific workflow for this strategy is as follows. The meaning of the parameters in the following formulas of the workflow steps is shown in
Table 2.
Step 1. The similarity between nodes was calculated, and the initial value of the attraction degree and attribution degree between nodes was set to 0.
In calculating the similarity between nodes, according to the special requirements of WSN to cluster head nodes, taking the energy consumption model of WSN as a reference, the energy consumption of data transmission between nodes was taken as a measurement of the similarity between nodes. The specific formula is shown in (6), where, d
i,j is the distance from node i to node j, and d
i,bs is the distance from node i to base station node.
Step 2. Calculate the attraction between nodes.
When calculating the degree of attraction between nodes, the residual energy E
rem(i) of the current node was introduced as the influence factor, as shown in the formula (7), where, E
init represents the initial energy of the node. The smaller the remaining energy of the nodes, the lower the attraction of the nodes to other nodes and the lower the possibility of becoming the cluster head nodes, so as to avoid the nodes with lower energy becoming cluster heads.
Step 3. Formula (3) was used to calculate the value of attribution degree between nodes.
Step 4. The cluster center of each node was determined.
The clustering center (cluster head) of the node was determined by summation of the attraction degree and the attribution degree of the node, as shown in formula (8). On the premise of maximum sum, if i equals to j, i (or j) is the cluster head of itself, otherwise j is the cluster head of i. By judging the clustering center of each node, the cluster head to which each node belongs was obtained.
Step 5. The current number of iterations plus 1. If the cluster centers (that is, cluster heads) remained unchanged after multiple iterations, or the total number of iterations reached the set maximum, (these two values should be determined in terms of the specific experiment scene of WSN, in this paper, they were set to be 20 and 200, respectively), the ID information of cluster head was broadcasted by the base station, and the iterative process of the election algorithm based on AP clustering was ended. Otherwise, jump back to Step 2 to continue the iteration.
2. Cluster head election based on the reference node.
In the reference-node-based election strategy, the set of reference nodes a(i) was the final collection of cluster head nodes obtained by the last round election strategies based on AP clustering, the workflow is as follows:
Step 1. The cluster head was elected based on the reference node.
The election strategy based on reference node calculated the differences between other nodes and the reference node to conduct cluster head election. The formula of similarity was as (9), the reference node i calculates the difference G(i,j) between each non-reference node j and it respectively, and elects the node j whose G(i,j) is the smallest as the cluster head of this round.
This election strategy takes into account the following influencing factors: Residual energy Erem of the non-reference nodes, the distance di,j from the non-reference node j to the reference node i and the distance from the non-reference node j to the base station dj,bs, which makes the elected cluster head nodes evenly distributed, the cluster heads have higher residual energy and they are relatively close to the base station.
Step 2. If the election result was valid, the election work was completed; otherwise, it alternated to the election strategy based on AP clustering and re-elected the cluster head.
After node j was elected as the cluster head of this round, the validity of the cluster head was determined by the judgment function, which is shown in formula (10), where E
rem represents the current residual energy of node j, E
aver is the average residual energy of all living nodes in the network, d
i,j is the distance between the node j and the reference node i and d
aver is the average distance between the child nodes and the reference node i when i is the cluster head of last round. The elected cluster head j is valid only if the value of p(j) equals to 1. If all elected cluster heads are valid, the clustering is successful; otherwise, alternate to the election strategy based on AP clustering to re-cluster and update the reference nodes.
After the fusion cluster head election was completed, the cluster heads broadcasted to the other codes. According to the received signal intensity, a non-cluster head node selects the cluster head node with the strongest signal as its cluster head.