## 2 Related Works
A study [23] used the KNN algorithm to implement a hybrid approach that combines KNN with quantum-behaved particle swarm optimisation to optimise the placement of base stations in WSNs. The proposed method extends the network's lifetime by minimising energy consumption through optimal base station positioning. KNN is also implemented on mobile WSNs [24]; the study investigates secure KNN query processing in two-tiered mobile WSNs. It proposes a secure KNN query algorithm that protects user privacy and ensures query results' integrity, addressing communication overhead challenges in WSNs. One study focused on improving the HEED algorithm for cluster head selection in Wireless Sensor Networks (WSNs). It integrated mathematical modelling, statistical analysis, and a deep artificial neural network (ANN) to address energy consumption and network lifetime inefficiencies, particularly in non-uniformly distributed WSNs. HEED's probabilistic approach to CH selection can result in suboptimal cluster head placement, especially in heterogeneous networks with varying node energy levels. The iterative nature of HEED's CH selection process increases communication overhead, which can lead to faster energy depletion in resource-constrained nodes [25]. HMRP-IWSN was proposed, which combines a Hybrid Optimised Deep Neural Network (HODNN) for intrusion detection and a Modified Energy-Efficient Centralised Clustering Routing Protocol (MEECRP) for secure and energy-efficient routing in IoT-enabled WSNs, but it does not take in the consideration the location of CHs in the network. HMRP-IWSN is more appropriate for IoT-enabled WSNs that require energy efficiency and robust security [26]. An Enhanced Intrusion Detection Model Based on Improved KNN in WSNs was presented, focusing on improving Wireless Sensor Networks using the K-Nearest Neighbours algorithm. This method aims to detect intrusion in WSNs, proposing a KNN-based model enhanced with the Arithmetic Optimisation Algorithm (AOA) to detect DoS attacks effectively. It combines KNN with AOA and Levy flight strategies to optimise intrusion detection accuracy and reduce false positives. This work focused only on security and intrusion detection, ignoring energy efficiency, dead sensor nodes, and network longevity [27]. [PERSON] [28] highlighted the importance of multi-objective optimisation in WSNs, emphasising the need to balance trade-offs between energy efficiency, latency, and reliability. Their work explores the use of Pareto optimisation and evolutionary algorithms to achieve these trade-offs. The work by [PERSON] [29] demonstrates the effectiveness of constraint-based optimisation in solving distance-constrained problems, which is highly relevant to WSN clustering and routing. Similarly, meta-heuristic algorithms can optimise cluster head selection, routing paths, and energy management in WSNs by exploring large search spaces and adapting to real-time changes. Some machine learning approaches have been proposed to modify WSN protocols, such as Support Vector Machines (SVMs), which effectively handle non-linear data through kernel functions. They have strong generalisation capabilities, making them suitable for complex WSN topologies. SVMs can be used for cluster head (CH) selection by classifying nodes based on energy levels, distance to the base station, and other features. SVMs may outperform KNN in scenarios with non-linear relationships between features, but could have higher computational overhead [30]. Decision trees are other algorithms that are simple to implement and interpret. Their low computational requirements make them suitable for resource-constrained Wireless Sensor Network nodes. This method can be used for hierarchical clustering by splitting nodes based on energy levels and proximity to CHs. Decision trees may provide faster execution than KNN, but could be less accurate in dynamic environments [31]. Biologically inspired algorithms have also been implemented in WSNs.