###### Abstract  
Wireless sensor networks (WSN) are widely used in various applications, such as environmental monitoring, healthcare, event detection, agriculture, disaster management, and so on. Due to their small size, sensors are limited power sources and are often deployed in special environments where frequent battery replacement is not feasible. Therefore, it is important to reduce the energy consumption of sensors and extend the network lifetime. An effective way to achieve this is clustering. This paper proposes a dual cluster-head energy-efficient algorithm (DCK-LEACH), which is based on K-means and Canopy optimization. Considering that the K-means algorithm is sensitive to the location of the initial clustering centers, this paper uses both the dynamic Canopy algorithm and K-means algorithm for clustering. For cluster-head election, this algorithm uses a hierarchy to minimize the cluster-head burden and balance the network load. The primary cluster-head is selected by two objectives: the node's residual energy and the distance from the node to the clustering center. The vice cluster-head is selected by the residual energy of the node, and the distance from the nodes to the base station. Simulator results show that DCK-LEACH significantly prolongs the energy-critical node lifetime and the network lifetime compared with existing protocols. wireless sensor networks; network lifetime; canopy algorithm; K-means algorithm; energy-efficient 2022  
22229731150  
earlier than normal nodes, which accelerates the \"death\" of the entire network. Some researchers have tried to tackle this problem. In [7], the authors proposed a protocol based on LEACH. In the cluster-head selection, it considers the maximum residual energy of nodes, so cluster-heads can work for a long time compared with that of LEACH. In [8], the authors proposed the BRE-LEACH protocol that aims to extend the network lifetime by optimizing energy consumption. The selection of cluster-heads is based on three main factors: the residual energy of nodes, the distance to the base station (BS) from the nodes, and the number of hops. Then, the optimal path is formed to forward the data to the BS in the network. However, the above methods only aim to select the appropriate cluster-heads, and then to cluster nodes according to their distances from the cluster-head. They did not consider that the maximum or the minimum cluster will be generated in the network, which may lead to uneven energy consumption between clusters because the energy consumption of larger clusters is greater than that of smaller clusters. Therefore, in this paper, we firstly consider the cluster size in clustering, and make the clusters relatively equal in size using our algorithm, to balance the energy consumption of the network. Then we consider a dual cluster-head approach to share the workload of the original single cluster-head. The dual cluster-head approach further extends the lifetime of the cluster-head and reduces the energy waste caused by frequent repetitive clustering. Nowadays, one of the popular clustering strategies is the K-means algorithm. The K-means (KOCED) protocol for optimal clustering of wireless sensor networks was proposed in [9]. It uses the K-means algorithm to cluster nodes, and the clusters formed are more uniform compared with the clusters of the LEACH protocol. This may greatly reduce the energy consumption of cluster-heads. However, when constructing clusters using the K-means algorithm, the value of K needs to be predefined and may not always be reasonable for the network. In addition, since the K-means algorithm is very sensitive to the location of the initial cluster centers, its initial K-cluster centroids are randomly elected at the time, which may cause it to fall into local optimization [10; 11] and subsequently form maximum or minimum clusters. This leads to load imbalance between clusters. The Canopy algorithm is a \"coarse\" clustering algorithm, and its clustering speed is fast.