# Improving Performance of Cluster Heads Selection in DEC Protocol Using K-Means Algorithm for WSN
## 2 Related Work  
The deterministic energy-efficient clustering (DEC) protocol is dynamic, distributive, self-organising and a very energy-efficient cluster protocol [1]. It outperforms LEACH and SEP protocols because the CH election is not random but determined by each node's residual energy [16]. Popular solutions are sensing applications, which evaluate nodes' energy based on the strength of their response, increase the sensor lifetime and network security, and decrease power consumption and cost [3]. In recent years, improving the DEC protocol has been the goal of many research efforts. Energy efficient multitier random DEC protocol [17] is a new standard DEC protocol to enhance the network's work lifetime and energy efficiency. The protocol incorporates a novel normal random initialisation and a multitier structure. Additionally, it aims to reduce the uncertainties associated with the cluster head elections process. The research reveals that the modifications effectively ensure a uniform selection of cluster heads. This enhancement results in improved energy efficiency for the protocol, owing to its superior distribution capacity. An efficient and ideal modified multitier deterministic energy-efficient clustering protocol, based on a novel election multitier random probability approach in a modified non-residual format called NR-MDEC, has been introduced in [18]. This protocol can maximise utilising the network's critical resources regarding residual energy level after 60% of CHs is dead. In general, and in the other conditions, DEC outperforms NR-MDEC. The weaknesses of DEC include its failure to consider the intra-cluster distance and the degree of the node. Particle Swarm Optimisation (PSO) based deterministic energy-efficient clustering protocol, PSO-DEC, was introduced to overcome these challenges [19]. MATLAB-based recreation output showed that PSO-DEC outwits conventional DEC and improves the network's lifetime. The weakness of Particle Swarm Optimisation is the long calculation time, which could be unacceptable for real-time online applications. Distance-based deterministic energy efficient clustering protocol (DDEC) [20] outperforms probabilistic protocols by selecting a uniform and well-distributed number of CHs throughout the sensor field. Simulations showed that DDEC has a more stable region period than ESEP, DEC, and LEACH protocols [21]. The network's stability period in DDEC is 12.7% longer than for the original DEC protocol. A distributed energy-efficient clustering protocol called DCE for heterogeneous wireless sensor networks introduces an extra phase for cluster head election [9]. DCE outperforms DEEC, SEP and LEACH algorithms in terms of stability period. The proper clustering algorithm is key to reducing energy consumption and increasing the network lifetime. Therefore, the design of new clustering algorithms is still a scientific challenge. In this work, we propose a new modification of the DEC protocol based on the K-means algorithm. The K-means algorithm has already been implemented by other researchers for WSN clustering. However, to the authors' knowledge, no attempt has been made to combine DEC and K-means. Most researchers implemented the K-means clustering combined with the LEACH protocol [22; 23; 24] or its modifications. In [22], optimal K-means clustering combined with LEACH protocol is used and compared with LEACH, O-LEACH and the BeeCluster, which is a static clustering routing algorithm based on an artificial Bee colony. The proposed algorithm achieved a uniform spatial distribution of CHs and 28% lesser energy consumption as compared to its contender. A new KCED protocol [23; 24] combining K-means and LEACH has been proposed to address the issue of residual energy within a node, cluster centre, and distance to a base station. A two-dimensional wireless sensor network (WSN) model was utilised to generate different WSN designs to optimise them using genetic algorithms to attain the best-performing WSN models [25].