Wireless Sensor Networks (WSNs) consist of low-power, battery-powered sensor nodes that collaborate to monitor the environment and transmit data to a base station. However, their efficiency is mainly constrained by energy usage and limited network lifespan. Among cluster‑based routing protocols, the Deterministic Energy‑Efficient Clustering (DEC) protocol is a recognised hierarchical scheme for heterogeneous WSNs; however, DEC still faces several challenges, particularly with energy consumption. This paper presents a unified comparative study of two machine learning-enhanced modifications to the DEC protocol for WSNs. Unlike our previous protocol proposals, this work integrates DEC-KNN (K-Nearest Neighbours) and DEC-KM (K-Means) within a single simulation framework, systematically compares their energy, distance, and stability performance, and provides practical deployment guidelines based on application-specific trade-offs. The simulations are conducted through MATLAB R2024b simulations on a 50-node heterogeneous WSN covering a 100 m × 100 m area. Both protocols show a substantial benefit over the original protocol baseline. DEC-KM leads to a small reduction in both total and average energy consumption and provides a good balance between clustering performance and energy consumption, making it an attractive option for energy-limited WSN applications in Internet of Things (IoT) and smart environments.
Juwaied et al. (2026) studied this question.