## 3 The Clustering Protocol
### The AGNES Algorithm with Balanced Energy Consumption Optimization  
To further improve the various indicators of WSN, we make balanced energy consumption optimization for the AGNES algorithm:  
1. To reduce the difference in the distance set between the nodes in the two clusters: On the basis of the original indicator that can be combined in two clusters (note: the average distance \(D_{avg}\) is used in this paper), the distance set variance \(\delta^{2}\) is added, so the two merged clusters cannot only have a shorter average distance, but also the distance difference between the nodes in the two clusters tends to be smaller. Thus, the energy consumption of the cluster nodes is more uniform, which can help effectively avoid the phenomenon that some cluster member nodes die prematurely due to the jaggedness of the transmission distances during the communication process.
2. The D-CHs division of the energy balance strategy in large clusters is implemented before the death of the first node: The AGNES algorithm can obtain the \(k\) cluster needed, but it does not limit the size of the cluster, so the resulting clusters may have different sizes. As a result, CHs in large clusters tend to receive and process large amounts of cluster information, then the energy is prematurely exhausted, which will have a very negative impact on network lifetime extension, energy consumption reduction, and throughput increase. Based on this, we implement the D-CHs division of energy balance strategy in the large cluster area before the death of the first node. The strategy mainly includes the following: the secondary cluster head (S-CH) is responsible for receiving the information sent by the cluster member nodes and the positive cluster head (P-CH) is responsible for merging the former information with the self-sensing information and finally transmitting it to the BS.
3. The node dormancy mechanism in large clusters is implemented after the death of the first node as follows: The data obtained by WSN needs to meet two requirements (large amount of data and high data integrity). Before the first node dies, the network is in a stable period, and the energy of the node group is enough, and many rounds of iterations can be performed. At this time, the data in the network can well satisfy the above two requirements. The node dormancy mechanism will cause data loss in some areas while causing energy consumption reduction. Therefore, the node dormancy mechanism is not implemented at this time. But after the death of the first node, it means that the energy of the node is greatly reduced, and the mortality rate is greatly improved. Even if the node dormancy mechanism is not performed, the network coverage of the monitoring area becomes smaller as the nodes die continuously. It will inevitably lead to a reduction in data integrity. At this time, it is not practical to maintain data integrity as well as the stable period. Therefore, our focus is on the improvement of data volume. By extending the network life cycle, WSN will have a longer monitoring time for the region, and can obtain a larger amount of information. The node dormancy mechanism can make the nodes which have relatively low energy in the cluster and relatively long distance from the CHs be in dormancy, avoiding its premature death, and reducing the energy load of the cluster head, thereby prolonging the network life cycle, which just satisfies the actual needs of the period.  
It's worth emphasizing that the protocol in this paper must re-select the CHs at the end of each round, which can help balance the energy consumption of the nodes and maintain the network coverage in the area.