## 8 Discussion
higher energy for CH roles, balancing energy consumption and extending network lifetime, and efficiently handles networks of varying sizes by dynamically adjusting clusters and CHs. Load balancing in KNN minimises communication distances, and traffic across CHs is evenly distributed to prevent overloading. the threshold-based data transmission in TEEN-KNN uses hard and soft thresholds to reduce unnecessary transmissions, optimising energy use during high or low traffic periods. Efficient data aggregation hierarchical clustering reduces data redundancy and transmission overhead. Proximity-based routing nodes are assigned to the nearest CH, minimising energy consumption and improving response to traffic variations. The KNN-based approach dynamically adapts to changing topologies and traffic loads by optimising CH selection, reducing energy consumption, and improving network stability. It ensures efficient clustering, resulting in fewer dead nodes and extended network lifetime, making it a robust solution for dynamic WSN environments. For computational overhead, the KNN algorithm requires calculating distances between nodes to identify the nearest neighbours. In larger networks, distance computations increase significantly, as each node must compare itself to multiple neighbours. For a network with \(n\) nodes, the computational complexity of KNN is O (\(n\times k\)) per node, where \(k\) is the number of nearest neighbours. This scaling results in higher energy consumption for the processing units of sensor nodes, especially in dense networks with large neighbours. In addition to computation, the algorithm introduces communication overhead, as nodes must exchange information such as location, energy levels, and distances to determine the nearest neighbours. In larger networks, this results in increased data transmission and reception, which are the primary sources of energy consumption in WSNs. However, the initial data exchange for KNN computations can still be energy-intensive, particularly in networks with high node density or large geographical areas. In dense networks, each node has more neighbours, leading to more distance calculations and larger data packets for communication. This increases both computational and communication energy consumption. Conversely, in sparse networks, the distances between nodes are larger, which increases the energy required for long-range communication. The feasibility of the proposed approach in real-world applications depends on whether the energy savings from clustering outweigh the computational cost of KNN. This approach optimises clustering, reduces energy consumption, and extends network lifetime by leveraging real-time adjustments based on network density and energy levels. Below is a consolidated explanation of how adaptive parameter tuning works and its benefits. Dynamic adjustment of k (number of nearest neighbours): A higher K value results in larger clusters, reducing the number of cluster heads (CHs) but increasing intra-cluster communication overhead. A lower K value creates smaller clusters, reducing intra-cluster communication but increasing the number of CHs, which can lead to higher energy consumption for inter-cluster communication. Dynamic adjustment of distance thresholds: Distance thresholds determine which nodes are eligible to join particular CH. Smaller thresholds ensure that only nearby nodes join a CH, reducing intra-cluster communication energy and potentially increasing CHs. Benefits of adaptive parameter tuning: The proposed approach reduces energy consumption by dynamically optimising clustering parameters. For example, the modified protocols (LEACH-KNN, SEP-KNN, TEEN-KNN, and DEC-KNN) demonstrated energy reductions of up to 22.7% in simulations. MODELACH [13] improves energy efficiency by introducing adaptive thresholds for CH selection. The approach does not void dead CHs and overlapping clusters and focuses on reducing energy dissipation without clear information about improvements in network lifetime.