# A Weighted Cluster Head Selection Algorithm for Energy Efficient Wireless Sensor Networks

Authors: Syed Asif Ali; Mubashar Sarfraz; Sajjad A. Ghauri; Asad Mahmood; Shahid Basir; Teweldebrhan Mezgebo Kebedew; Sheraz Alam
Journal: Journal of Sensors
 (2022)

---

## Abstract

The wireless sensor network’s (WSNs) lifetime is mainly dependent on the RE of the sensor nodes (SeN). In recent years, energy minimization in a WSN has been a prominent research topic, and numerous solutions have been proposed. This research focuses on the energy minimization of the SeNs where firstly, K-medoid clustering algorithm is applied to create clusters. Second, a weighted cluster head selection technique is used to choose a cluster head (CH) by integrating three independent weights associated with an SeN: energy, distance from the centroid, and distance from the sink node (SN). According to the energy level and distance from the SN and cluster’s centre, each node is assigned a constant weight. The simulation results are compared to existing methodologies, and the results show that the suggested network’s lifetime enhances.


---

## Body

## 1. Introduction

### 1.1. Background and Related Work

With recent advancements in sensor devices, microelectronics, and wireless communication systems, WSNs are gaining more and more interest. A WSN is a network of dispersed sensors with low power, low storage capacity, and limited processing capabilities that sense and relay data to a SN [1–5]. In the concept of a 5G communication system, WSNs can be used to monitor the health system, agriculture, oil and gas exploration, smart homes and security, military applications, environmental monitoring, and industrial machine status [6–8]. In contrast, sensors constitute of finite battery life that bottleneck the efficiency of the network [9–12]. Figure 1 depicts a high-level overview of WSN applications in which sensor nodes are mostly placed in harsh environments where it is challenging to replace the battery resources at short intervals. Thus, the constraint of finite battery life or network lifespan can be alleviated by making efficient use of available energy resources and devising an optimal method of delivering packets [13].Figure 1
System model.Similarly, numerous strategies for extending network lifetime by improving CH selection for load balancing have been described in the literature; however, updating the CH selection to prolong the network’s lifetime is a significant challenge. A clustered network (based on LEACH) is chosen, the monitoring area is divided into smaller clusters, and each cluster has a CH responsible for collecting and forwarding sensed data from cluster members to the sink. Clustering the network not only helps to optimize energy consumption and load balancing, but it also increases network scalability [13]. In [14], the authors proposed LEACH, the first hierarchical clustering approach for balancing the network’s load across all nodes. There are no defined criteria for adequately sharing the workload among everyone, and the CH is picked probabilistically. It is possible that a node will be picked numerous times, depleting its energy rapidly, because the CH selection procedure is decentralized. Later in [15], LEACH-C is a suggested solution to the existing problem by permitting the sink node to choose the CH and properly share the load over all nodes. When compared to the traditional LEACH, LEACH-C has been demonstrated to optimize the system energy consumption.The threshold-sensitive energy-efficient sensor network (TEEN) protocol [16], threshold-sensitive stable election protocol (TSEP) [17], a highly efficient adaptive periodic threshold-sensitive energy network (APTEEN) [18], power-efficient gathering in sensor information system (PEGASIS) [19] whereas hybrid energy-efficient distributing (HEED) clustering techniques are all used to improve the network’s efficiency [20]. Additionally, a substantial amount of work has been done to modify the clustering algorithms in order to increase their efficiency while decreasing their energy consumption. S-SEECH (secured-scalable energy-efficient clustering hierarchy) is a revolutionary protocol that considers the network’s better scalability [21].Researchers recently proposed a new solution to extend the network’s life cycle. The authors in [22] consider an energy-efficient cluster-based routing protocol rotates the CH based on the node’s current energy, distance from the SN, and density. The proposed protocol outperforms LEACH by 56% in terms of energy consumption. Similarly, according to the authors of [23], the proposed event detection tree reduces the amount of data to be transmitted by 20% compared to TED, MSFT, and centralized approaches. According to the authors in [24], by establishing an appropriate fixed packet size, analyzing the standard weight of the nodes, and selecting the next CH, the energy consumed is further minimized. Additionally, authors in [25] evaluated a trust-aware routing protocol to improve the energy efficiency in the presence of malicious SeNs. In [26], a load balancing technique is proposed based on the energy collection, energy transfer, and energy conservation. A modified LEACH (LEACH-M) is proposed in [27] to improve the threshold for CH selection by considering the residual energy (RE) and SeN location.In [28], a sampling-based spider monkey optimization (SMO) approach is proposed for selecting an optimal set of CH. The CH is chosen using krill head optimization [29], in which the proposed scheme’s effectiveness is demonstrated by comparison to LEACH and genetic algorithm- (GA-) based optimization. In the same way, three attribute indices for network nodes are formed in [30]: Data traffic, RE of nearby nodes, and closeness of the node’s path to the shortest path. The weights of these indexes are then computed using the entropy weight approach. Finally, using the dempster shafer (DS) probability theory fusion rule, the back propagation algorithm (BPA) function of each index value is fused to determine the next hop. The RE of nodes is determined more accurately than with the multi-criterion-based centrality protocol (MCRP) or the fuzzy logic-based energy-optimized routing protocol (FLEOR). In [31], clustering using zone-based clustering and a hybrid PSO method, duty cycle scheduling with the deep reinforcement learning and routing with ant colony optimization, and the firefly algorithm are all done with the energy efficient scheduling-deep reinforcement learning (EES-DRL).After making changes to the LA and GWO, the CH selection process is called updated lion-GWO [32]. SEP, IHCR, and the evolutionary routing protocol were found to be inferior in terms of network lifetime and RE. In [33], a hybrid approach based on fuzzy C-means and moth flame optimization (MFO) is proposed for cluster formation and CH selection optimization. It is used to form clusters by using fuzzy-based unequal clustering, while the CH optimization is done using PSO-WZ to determine the best CH [34]. The Gini coefficient is employed to keep the energy gap between nodes equal and the network’s load balanced. For network coverage and convergence rate, lion optimization performs better than the nature-inspired algorithm reviewed in [35]. The WSN is modelled using an overall point factor in [36]. After that, the authors extracted near-optimal solutions and their efficiency factors to demonstrate that it is possible to quickly route uniformly load-balanced networks by randomly searching a narrow margin of the solution space.A distributed GA is presented in [37] for the purpose of optimizing the lifetime of WSNs. This is accomplished by dividing the network into subnetworks and distributing CH selection and sensor activity scheduling-based GA optimization to each CH. The proposed work is divided into rounds, with each round consisting of three phases, namely, discovery, CH selection using GA-based decision making, and sensing. The proposed algorithm contributes to the network’s longevity. In order to improve the LEACH protocol’s initial setup phase, a genetic algorithm (GA) was used to consider compactness, separation, and several CHs as the perimeters of the objective function [1]. Later, the objective is iteratively optimized through GA to achieve the objectives.However, a simple CH selection method that converts energy and distance into unit-less quantities and selects the CH based on their weight-age has yet to be investigated.


### 1.2. Motivation and Contribution

The optimal CH selection helps to optimize the energy consumption, and there are various approaches available in the literature for CH selection. The RE of the network, distance from sink node, number of CHs, and optimal path selection are the various methods used in the literature to increase the lifetime of the network. For the optimal CH selection, the selected node must have higher RE and minimum distance from the SN, and it must be closer to the centre point within a cluster. The proposed work is compared with [1] by considering three different parameters and introducing a new objective function.The major contributions of the proposed weighted CH selection algorithm (WCHSA) are summarized as follows:(1)
To the best of author’s knowledge, this is the first work that proposes a new WCHSA based on the RE of the node, distance from the sink node, and distance from the center of the cluster(2)
The three different factors are mapped to a unit less quantity in such a way that higher energy node acquires maximum weight and a node with the higher distance assigns the minimum weight. Finally, the weighted combination of these three approaches is combined to select the optimal CH for minimum energy consumption(3)
The WCHSA selects a CH that have maximum energy in a cluster, nearest to its centroid, as well as nearest to the SN. The CH selects the shortest path in a multihop scenario to transfer the sensed information to the SN(4)
SeNs are divided into clusters using K-medoid clustering algorithm(5)
The proposed WCHSA is compared with the existing techniques for 10% and 20% ANsThe rest of the paper consists of four sections. Section1 discusses the literature review and existing methods of CH selection. The detailed system model is presented and discussed in Section 2. The simulation results are presented and discussed in Section 3. Finally, in Section 4, the proposed work is summarized, and the future directions are presented.


## 1.1. Background and Related Work

With recent advancements in sensor devices, microelectronics, and wireless communication systems, WSNs are gaining more and more interest. A WSN is a network of dispersed sensors with low power, low storage capacity, and limited processing capabilities that sense and relay data to a SN [1–5]. In the concept of a 5G communication system, WSNs can be used to monitor the health system, agriculture, oil and gas exploration, smart homes and security, military applications, environmental monitoring, and industrial machine status [6–8]. In contrast, sensors constitute of finite battery life that bottleneck the efficiency of the network [9–12]. Figure 1 depicts a high-level overview of WSN applications in which sensor nodes are mostly placed in harsh environments where it is challenging to replace the battery resources at short intervals. Thus, the constraint of finite battery life or network lifespan can be alleviated by making efficient use of available energy resources and devising an optimal method of delivering packets [13].Figure 1
System model.Similarly, numerous strategies for extending network lifetime by improving CH selection for load balancing have been described in the literature; however, updating the CH selection to prolong the network’s lifetime is a significant challenge. A clustered network (based on LEACH) is chosen, the monitoring area is divided into smaller clusters, and each cluster has a CH responsible for collecting and forwarding sensed data from cluster members to the sink. Clustering the network not only helps to optimize energy consumption and load balancing, but it also increases network scalability [13]. In [14], the authors proposed LEACH, the first hierarchical clustering approach for balancing the network’s load across all nodes. There are no defined criteria for adequately sharing the workload among everyone, and the CH is picked probabilistically. It is possible that a node will be picked numerous times, depleting its energy rapidly, because the CH selection procedure is decentralized. Later in [15], LEACH-C is a suggested solution to the existing problem by permitting the sink node to choose the CH and properly share the load over all nodes. When compared to the traditional LEACH, LEACH-C has been demonstrated to optimize the system energy consumption.The threshold-sensitive energy-efficient sensor network (TEEN) protocol [16], threshold-sensitive stable election protocol (TSEP) [17], a highly efficient adaptive periodic threshold-sensitive energy network (APTEEN) [18], power-efficient gathering in sensor information system (PEGASIS) [19] whereas hybrid energy-efficient distributing (HEED) clustering techniques are all used to improve the network’s efficiency [20]. Additionally, a substantial amount of work has been done to modify the clustering algorithms in order to increase their efficiency while decreasing their energy consumption. S-SEECH (secured-scalable energy-efficient clustering hierarchy) is a revolutionary protocol that considers the network’s better scalability [21].Researchers recently proposed a new solution to extend the network’s life cycle. The authors in [22] consider an energy-efficient cluster-based routing protocol rotates the CH based on the node’s current energy, distance from the SN, and density. The proposed protocol outperforms LEACH by 56% in terms of energy consumption. Similarly, according to the authors of [23], the proposed event detection tree reduces the amount of data to be transmitted by 20% compared to TED, MSFT, and centralized approaches. According to the authors in [24], by establishing an appropriate fixed packet size, analyzing the standard weight of the nodes, and selecting the next CH, the energy consumed is further minimized. Additionally, authors in [25] evaluated a trust-aware routing protocol to improve the energy efficiency in the presence of malicious SeNs. In [26], a load balancing technique is proposed based on the energy collection, energy transfer, and energy conservation. A modified LEACH (LEACH-M) is proposed in [27] to improve the threshold for CH selection by considering the residual energy (RE) and SeN location.In [28], a sampling-based spider monkey optimization (SMO) approach is proposed for selecting an optimal set of CH. The CH is chosen using krill head optimization [29], in which the proposed scheme’s effectiveness is demonstrated by comparison to LEACH and genetic algorithm- (GA-) based optimization. In the same way, three attribute indices for network nodes are formed in [30]: Data traffic, RE of nearby nodes, and closeness of the node’s path to the shortest path. The weights of these indexes are then computed using the entropy weight approach. Finally, using the dempster shafer (DS) probability theory fusion rule, the back propagation algorithm (BPA) function of each index value is fused to determine the next hop. The RE of nodes is determined more accurately than with the multi-criterion-based centrality protocol (MCRP) or the fuzzy logic-based energy-optimized routing protocol (FLEOR). In [31], clustering using zone-based clustering and a hybrid PSO method, duty cycle scheduling with the deep reinforcement learning and routing with ant colony optimization, and the firefly algorithm are all done with the energy efficient scheduling-deep reinforcement learning (EES-DRL).After making changes to the LA and GWO, the CH selection process is called updated lion-GWO [32]. SEP, IHCR, and the evolutionary routing protocol were found to be inferior in terms of network lifetime and RE. In [33], a hybrid approach based on fuzzy C-means and moth flame optimization (MFO) is proposed for cluster formation and CH selection optimization. It is used to form clusters by using fuzzy-based unequal clustering, while the CH optimization is done using PSO-WZ to determine the best CH [34]. The Gini coefficient is employed to keep the energy gap between nodes equal and the network’s load balanced. For network coverage and convergence rate, lion optimization performs better than the nature-inspired algorithm reviewed in [35]. The WSN is modelled using an overall point factor in [36]. After that, the authors extracted near-optimal solutions and their efficiency factors to demonstrate that it is possible to quickly route uniformly load-balanced networks by randomly searching a narrow margin of the solution space.A distributed GA is presented in [37] for the purpose of optimizing the lifetime of WSNs. This is accomplished by dividing the network into subnetworks and distributing CH selection and sensor activity scheduling-based GA optimization to each CH. The proposed work is divided into rounds, with each round consisting of three phases, namely, discovery, CH selection using GA-based decision making, and sensing. The proposed algorithm contributes to the network’s longevity. In order to improve the LEACH protocol’s initial setup phase, a genetic algorithm (GA) was used to consider compactness, separation, and several CHs as the perimeters of the objective function [1]. Later, the objective is iteratively optimized through GA to achieve the objectives.However, a simple CH selection method that converts energy and distance into unit-less quantities and selects the CH based on their weight-age has yet to be investigated.


## 1.2. Motivation and Contribution

The optimal CH selection helps to optimize the energy consumption, and there are various approaches available in the literature for CH selection. The RE of the network, distance from sink node, number of CHs, and optimal path selection are the various methods used in the literature to increase the lifetime of the network. For the optimal CH selection, the selected node must have higher RE and minimum distance from the SN, and it must be closer to the centre point within a cluster. The proposed work is compared with [1] by considering three different parameters and introducing a new objective function.The major contributions of the proposed weighted CH selection algorithm (WCHSA) are summarized as follows:(1)
To the best of author’s knowledge, this is the first work that proposes a new WCHSA based on the RE of the node, distance from the sink node, and distance from the center of the cluster(2)
The three different factors are mapped to a unit less quantity in such a way that higher energy node acquires maximum weight and a node with the higher distance assigns the minimum weight. Finally, the weighted combination of these three approaches is combined to select the optimal CH for minimum energy consumption(3)
The WCHSA selects a CH that have maximum energy in a cluster, nearest to its centroid, as well as nearest to the SN. The CH selects the shortest path in a multihop scenario to transfer the sensed information to the SN(4)
SeNs are divided into clusters using K-medoid clustering algorithm(5)
The proposed WCHSA is compared with the existing techniques for 10% and 20% ANsThe rest of the paper consists of four sections. Section1 discusses the literature review and existing methods of CH selection. The detailed system model is presented and discussed in Section 2. The simulation results are presented and discussed in Section 3. Finally, in Section 4, the proposed work is summarized, and the future directions are presented.


## 2. System Model

This section represents mathematical model of proposed algorithm named: weighted CH selection algorithm (WCHSA) used to determine the optimal path for packet transmission while minimizing energy consumption and maximizing the network’s lifecycle through iteratively updating the CH within each cluster. The network architecture of the WSN is presented in Figure1, where a CH collects information from sensors placed in the sensing field. Afterwards, CH relays the sensed information to the SN, and finally, SN forwards all the information to control centre.


### 2.1. Selection of CH

For increased energy efficiency, the whole WSN has been divided into clusters. Each cluster has a CH, who is in charge of ensuring that information flows smoothly from one cluster to the next. The K-medoid clustering approach has been successfully utilised to produce clusters and CH’s. In the K-medoid algorithm, it is necessary to locate a medoid in a cluster that is located in the middle of the cluster. The K-medoid performs better and is more robust than the K-mean. It is denoted ask representative object because it minimizes the summation of differences of information, whereas K-medoid minimizes the sum of squared Euclidean distances and is denoted as k representative object because it minimizes the sum of differences of information.


### 2.2. Optimal Weights Selection

The rotation of CH’s weighted fitness function is dependent on three parameters: number of CHs, compactness, and spacing [1]. The node’s current energy, its distance from the SN, and its distance from the cluster’s midpoint are all adjusted, resulting a new weighted equation. The modified function for CH rotation is given in (1). The function in (1) is transformed into a cost function (2), and it is solved iteratively to find the optimal set of weights under certain constraints.
(1)Ϝ=ω1ηk+ω2ϒk+ω3νk(2)P1=maxW,η,Y,ν∑k=1KϜkC1:ηk≥εthC2:ℵk∈ΛC3:ϒk≤ℏth,whereW is the vector with (w1, w2, w3) the set of optimal weights that are obtained iteratively. R1,4, η is the constant value that is evaluated from the contribution of current energy of each node, Y is the constant obtained by mapping the contribution of distance of each node, and ν is the constant calculated after mapping the contribution of its distance to the center point. εth is the threshold RE of a node, ℵk is the kth node, Λ are the clusters created by the clustering algorithm, and ℏth is the threshold distance. Finally, the node’s maximum weigh is evaluated through P1 and designated that node as the CH. To select the next CH, the proposed scheme takes into account the RE, the distance to the SN, and the distance of the node to the cluster’s center point. Due to the fact that energy and distance have distinct units that cannot be added directly, their contributions are mapped onto some units of lower extent.As a result, the total energy is divided intoη points that are distributed evenly between the minimum and maximum energies. Additionally, these points are assigned a constant value (higher for more energy, lower for less energy) to convert the energy contribution to a unit-less quantity. Similarly, the distance between nodes and SN is divided into Y points equal to the difference between their minimum and maximum distances. Following that, these points are assigned a constant value (high for short distances, low for long distances) in order to convert the effect of distance to a unit-less quantity. Finally, the distance between each cluster node and the cluster’s center point is divided into ν equal points. Later, a constant value is assigned to this distance in order to convert it to a unit-less quantity (high value for low distance and lower value for higher distance).


### 2.3. Optimal Path Selection

Sensors require a reliable path to relay sensed data to the SN for further analysis or decision-making. The choice of a reliable path is critical, as the information may be lost or the path may result in increased energy consumption if the path is unreliable. For multihop links, the optimal path is chosen from the set of CHs, as a CH may consume more energy if the longer path is chosen.As a result, in order to determine the most optimal path for packet transmission, the proposed scheme evaluates the Euclidean distance between a CH and all of the other CHs and SNs and then selects the shortest path possible. The Euclidean distance between two points in a coordinate system can be calculated as follows:(3)D=p1−q1i2+p2−q2i2,whereD is the shortest distance between a CH and the next hop in the direction of SN, p1 and p2 are the coordinates of a CH, and q1 and q2 are the coordinates of the next hop.


### 2.4. Energy Model (LEACH)

SeNs are deployed in a specific environment to sense the amount of data and relay it to the next hop. In contrast, these devices constitute of finite battery life, whereas the magnitude of energy consumption is environment-dependent, depending on whether data is transmitted from the common node to the CH or from the CH to the SN. Each level consumes a different amount of energy, which varies according to the distance traveled and the amount of data transferred. The predefined energy model of [14] is used in this study for energy transmission and reception, as shown as follows:
(4)ETλ,d=λ×ξt+υfs×ℏ2,ifℏ≤ℏoλ×ξt+υamp×ℏ4,ifℏ>ℏo,(5)ER=λξr,where λ is the size of data, ℏ is distance between the nodes, ξt and ξr signifies transmit and receive energy, υfs is free space energy, υamp is the transmit amplifier energy, and ℏth is the threshold distance. Additionally, the threshold distance ℏth is calculated using the formula given as follows:
(6)ℏth=υfsυamp.Setup and communication phase are the two phases of the WSN. Each node communicates its position to the SN and receives input from the SN during the initial setup phase. Equations (4) and (5) show how much energy nodes require for message transmit and receive. The communication phase begins after the setup phase, when nodes begin sensing and transmitting their observed data to the sink. The data is detected by the common nodes and transmitted to the CH, then broadcasts it to the SN. The quantity of energy needed to send and receive data to (or from) the CH is stated as follows:
(7)ETx=ϖ×λ×ξt+υfs×ℏ2,(8)ERx=ϖ×λ×ξr,where ϖ is the number of nodes in a cluster apart from CH. The CH collects data from the cluster’s members and aggregates it with its own sensed data before forwarding it to the next hop. The energy required for this process is deduced from (9) and (10), respectively, for transmission and reception.
(9)ECHTx=ζ×λ×ξt+υfs×ℏ2,(10)ECHRx=ζ×λ×ξr+Eagg,where ζ is the total number of nodes in the cluster. Data packets supplied by other CHs are received, aggregated, and relayed to the SN by the primary CH nearest to the SN. The amount of energy required for the process is expressed as follows:
(11)ECHTx=κ×λ×ξt+υfs×ℏ2,(12)ECHRx=κ×λ×ξr+Eagg,where κ is the total number of CHs. The main CH is responsible for transmitting data from all of the CHs and their cluster members to the sink node, and the energy required is as follows:
(13)ESNTx=K×λ×ξt+υfs×ℏ2.Algorithm 1: Weighted CH selection scheme (WCHSS).
1 input:SN⟵ Number of devices, BS⟵ Base Station,SA⟵ Simulation Area SA∈Ub,Lb, Ub⟵ UpperBound ofSA, Lb⟵ Lower Bound of SA, CH⟵ ClusterHeadCH∈maxSN, CHG⟵ Cluster Head GroupCHG∈CHSN, le⟵ Nodes ResidualEnergylen∈le2 output: Dead Nodes, Node’s latency, Energy consumption, Time complexity,Packets delivery3 Initialization:∀ parameters, ∀ variables4 Execution:;5 whiletermination criterion metdo6 for i=1:SN do7  ∀ nodes8  get (xcord, ycord)9  Deploy (i-th node) in SA (Ub, Lb)10  ifnodes deployment = = truethen11   break;12  else13   continue;14  end15 end16 Distance-WSN (Nodes, Rounds)⟵get distance(n)17 K-medoids-Clustering (xcordi, ycordi), Deploy clusters, get CH18 IDs (xcordi, ycordi, CHG)⟵calculate IDsnopt-routeDistancei,xcordi,ycordi,CHG19 get next hop ∀ CHs//Communication phase20 whilerounds max round∀nodes≠deaddo21  rounds++22  Energy Consumption Model ⟵get residual energy23  for∀nodesdo24   get next hop25   ifnext hop (CH) == BSthen26    receive M × data length27    //CH receives data from M SeNs28    transmit N × data length;29    // CH transmits data of N SeNs30   else31    ifnext hop (CH) == CH(k)then32     receive M×data length33     transmit N× data length34    end35    Node(n) transmit⟵ CH(k)36   end37   ifenergyi-th node<thresholdthen38    declare ith node as a dead node39   end40  end41 end42 end


## 2.1. Selection of CH

For increased energy efficiency, the whole WSN has been divided into clusters. Each cluster has a CH, who is in charge of ensuring that information flows smoothly from one cluster to the next. The K-medoid clustering approach has been successfully utilised to produce clusters and CH’s. In the K-medoid algorithm, it is necessary to locate a medoid in a cluster that is located in the middle of the cluster. The K-medoid performs better and is more robust than the K-mean. It is denoted ask representative object because it minimizes the summation of differences of information, whereas K-medoid minimizes the sum of squared Euclidean distances and is denoted as k representative object because it minimizes the sum of differences of information.


## 2.2. Optimal Weights Selection

The rotation of CH’s weighted fitness function is dependent on three parameters: number of CHs, compactness, and spacing [1]. The node’s current energy, its distance from the SN, and its distance from the cluster’s midpoint are all adjusted, resulting a new weighted equation. The modified function for CH rotation is given in (1). The function in (1) is transformed into a cost function (2), and it is solved iteratively to find the optimal set of weights under certain constraints.
(1)Ϝ=ω1ηk+ω2ϒk+ω3νk(2)P1=maxW,η,Y,ν∑k=1KϜkC1:ηk≥εthC2:ℵk∈ΛC3:ϒk≤ℏth,whereW is the vector with (w1, w2, w3) the set of optimal weights that are obtained iteratively. R1,4, η is the constant value that is evaluated from the contribution of current energy of each node, Y is the constant obtained by mapping the contribution of distance of each node, and ν is the constant calculated after mapping the contribution of its distance to the center point. εth is the threshold RE of a node, ℵk is the kth node, Λ are the clusters created by the clustering algorithm, and ℏth is the threshold distance. Finally, the node’s maximum weigh is evaluated through P1 and designated that node as the CH. To select the next CH, the proposed scheme takes into account the RE, the distance to the SN, and the distance of the node to the cluster’s center point. Due to the fact that energy and distance have distinct units that cannot be added directly, their contributions are mapped onto some units of lower extent.As a result, the total energy is divided intoη points that are distributed evenly between the minimum and maximum energies. Additionally, these points are assigned a constant value (higher for more energy, lower for less energy) to convert the energy contribution to a unit-less quantity. Similarly, the distance between nodes and SN is divided into Y points equal to the difference between their minimum and maximum distances. Following that, these points are assigned a constant value (high for short distances, low for long distances) in order to convert the effect of distance to a unit-less quantity. Finally, the distance between each cluster node and the cluster’s center point is divided into ν equal points. Later, a constant value is assigned to this distance in order to convert it to a unit-less quantity (high value for low distance and lower value for higher distance).


## 2.3. Optimal Path Selection

Sensors require a reliable path to relay sensed data to the SN for further analysis or decision-making. The choice of a reliable path is critical, as the information may be lost or the path may result in increased energy consumption if the path is unreliable. For multihop links, the optimal path is chosen from the set of CHs, as a CH may consume more energy if the longer path is chosen.As a result, in order to determine the most optimal path for packet transmission, the proposed scheme evaluates the Euclidean distance between a CH and all of the other CHs and SNs and then selects the shortest path possible. The Euclidean distance between two points in a coordinate system can be calculated as follows:(3)D=p1−q1i2+p2−q2i2,whereD is the shortest distance between a CH and the next hop in the direction of SN, p1 and p2 are the coordinates of a CH, and q1 and q2 are the coordinates of the next hop.


## 2.4. Energy Model (LEACH)

SeNs are deployed in a specific environment to sense the amount of data and relay it to the next hop. In contrast, these devices constitute of finite battery life, whereas the magnitude of energy consumption is environment-dependent, depending on whether data is transmitted from the common node to the CH or from the CH to the SN. Each level consumes a different amount of energy, which varies according to the distance traveled and the amount of data transferred. The predefined energy model of [14] is used in this study for energy transmission and reception, as shown as follows:
(4)ETλ,d=λ×ξt+υfs×ℏ2,ifℏ≤ℏoλ×ξt+υamp×ℏ4,ifℏ>ℏo,(5)ER=λξr,where λ is the size of data, ℏ is distance between the nodes, ξt and ξr signifies transmit and receive energy, υfs is free space energy, υamp is the transmit amplifier energy, and ℏth is the threshold distance. Additionally, the threshold distance ℏth is calculated using the formula given as follows:
(6)ℏth=υfsυamp.Setup and communication phase are the two phases of the WSN. Each node communicates its position to the SN and receives input from the SN during the initial setup phase. Equations (4) and (5) show how much energy nodes require for message transmit and receive. The communication phase begins after the setup phase, when nodes begin sensing and transmitting their observed data to the sink. The data is detected by the common nodes and transmitted to the CH, then broadcasts it to the SN. The quantity of energy needed to send and receive data to (or from) the CH is stated as follows:
(7)ETx=ϖ×λ×ξt+υfs×ℏ2,(8)ERx=ϖ×λ×ξr,where ϖ is the number of nodes in a cluster apart from CH. The CH collects data from the cluster’s members and aggregates it with its own sensed data before forwarding it to the next hop. The energy required for this process is deduced from (9) and (10), respectively, for transmission and reception.
(9)ECHTx=ζ×λ×ξt+υfs×ℏ2,(10)ECHRx=ζ×λ×ξr+Eagg,where ζ is the total number of nodes in the cluster. Data packets supplied by other CHs are received, aggregated, and relayed to the SN by the primary CH nearest to the SN. The amount of energy required for the process is expressed as follows:
(11)ECHTx=κ×λ×ξt+υfs×ℏ2,(12)ECHRx=κ×λ×ξr+Eagg,where κ is the total number of CHs. The main CH is responsible for transmitting data from all of the CHs and their cluster members to the sink node, and the energy required is as follows:
(13)ESNTx=K×λ×ξt+υfs×ℏ2.Algorithm 1: Weighted CH selection scheme (WCHSS).
1 input:SN⟵ Number of devices, BS⟵ Base Station,SA⟵ Simulation Area SA∈Ub,Lb, Ub⟵ UpperBound ofSA, Lb⟵ Lower Bound of SA, CH⟵ ClusterHeadCH∈maxSN, CHG⟵ Cluster Head GroupCHG∈CHSN, le⟵ Nodes ResidualEnergylen∈le2 output: Dead Nodes, Node’s latency, Energy consumption, Time complexity,Packets delivery3 Initialization:∀ parameters, ∀ variables4 Execution:;5 whiletermination criterion metdo6 for i=1:SN do7  ∀ nodes8  get (xcord, ycord)9  Deploy (i-th node) in SA (Ub, Lb)10  ifnodes deployment = = truethen11   break;12  else13   continue;14  end15 end16 Distance-WSN (Nodes, Rounds)⟵get distance(n)17 K-medoids-Clustering (xcordi, ycordi), Deploy clusters, get CH18 IDs (xcordi, ycordi, CHG)⟵calculate IDsnopt-routeDistancei,xcordi,ycordi,CHG19 get next hop ∀ CHs//Communication phase20 whilerounds max round∀nodes≠deaddo21  rounds++22  Energy Consumption Model ⟵get residual energy23  for∀nodesdo24   get next hop25   ifnext hop (CH) == BSthen26    receive M × data length27    //CH receives data from M SeNs28    transmit N × data length;29    // CH transmits data of N SeNs30   else31    ifnext hop (CH) == CH(k)then32     receive M×data length33     transmit N× data length34    end35    Node(n) transmit⟵ CH(k)36   end37   ifenergyi-th node<thresholdthen38    declare ith node as a dead node39   end40  end41 end42 end


## 3. Simulation Results

This section summarizes the numerical results of our proposed scheme. Following that, a weighted algorithm is used to select the CH that provides the optimal path for packet transmission. Additionally, the proposed scheme’s performance is validated through extensive simulations carried out in MATLAB using Algorithm 2.4 named: weighted CH selection scheme (WCHSS) and numerical results compared to baseline schemes. Additionally, Table1 represents the simulation parameters.Table 1
Simulation parameters.
ParametersValuesK (SeNs)100Area100∗100 m2Normal nodesEint0.5 JANsEint1 Jκ10Percentage of AN’s10%, 20%υfs0.1 pJυmp13∗10−16 Jλ4 kbξr, ξs50 nJEda5 nJ


### 3.1. K-Medoid Clustering

The network is deployed with random distributed nodes over an area of100×100 square meters. From Figure 2, the SN is in the center of the network. From K-medoid clustering technique, κ=10 clusters are selected, and using WHCSS algorithm, the CH is obtained as shown in Figure 2. K-Medoid is a robust segregating method that forms κ clusters for the K nodes deployed in the network using data points as centers as shown with different color scheme in Figure 2.Figure 2
Network deployment.


### 3.2. Selection of Path

After clustering theK users into κ clusters, the next step is to determine the optimal path for packet transmission while minimizing energy consumption by iterative updating the location of CHs within each cluster. Figure 3 illustrates the transfer of data from SeNs in a cluster to the network’s SN, which is located in the network’s center, via respective CHs in a multihop mode of communication. Each CH calculates its distance from the SN and from all other CHs in the network. The data is then transmitted from a CH to its neighboring CH in the shortest possible route to the SN. The CH is updated with the optimal energy consumption, taking the following constraints into consideration: (1) the shortest possible distance between the SeN and SN and (2) the SeN’s maximum energy is closer to the cluster’s centroid.Figure 3
Distance-based routing.After clustering and determining the optimal path by iteratively updating the location of the CH within each cluster, the proposed scheme’s performance is validated for 10% and 20% AN scenarios. Similarly, numerical results are compared with the benchmark schemes to further validate the proposed scheme.


### 3.3. WCHSS for10% ANs

#### 3.3.1. Number of Alive Nodes

This section represents the comparative analysis of the proposed scheme, and the results are compared with some benchmark scheme names: ERP (evolutionary routing protocol) and EEWC (energy-efficient weighted clustering), by considering network lifetime as a performance matrix as shown in Figure4. Initially, the algorithm tries to balance the network, and therefore, the SeN consumes slightly higher energy. Afterwards, the proposed algorithm performs better and improves the overall lifetime of the network. The results show that the proposed scheme outperforms all other schemes and improves by 28.13% over the EEWC technique and 58.93% over the ERP.Figure 4
Network lifetime for 10% ANs.


#### 3.3.2. Total Residue Energy

The total RE with 10% ANs is shown in Figure5 and is also compared to the RE produced by existing techniques. As illustrated in Figure 5, the proposed algorithm consumes less energy in the WSN than other techniques. The proposed algorithm has an RE of 0.63 J, whereas other techniques have an RE of 4×10−5 J for EEWC and 7×10−5 J for ERP.Figure 5
Total energy consumption for 10% ANs.The RE of the proposed protocol is compared quantitatively to that of existing protocols in Table2. As shown in Table 2, the proposed WSN has a significantly lower RE than the EEWC and ERP. The proposed algorithm has an RE of 8.6 J, compared to 0.12 J for EEWC and zero for other protocols.Table 2
Energy consumption for 10% ANs.
RoundsRE (joules)ERPEEWCWCHSS36028.56434.34743.15437206.91813.52536.054810803.0923.74628.974411400.9961.85227.800718000.2320.64715.2424216000.128.6


#### 3.3.3. Number of Dead Nodes

Similarly, the total number of dead nodes in the WSN is compared to the total number of dead nodes in other protocols and is shown quantitatively in Table3. Results demonstrate that proposed algorithm outperforms existing protocols. For the 50% of dead nodes, there are 1529, 1574, and 2470 rounds for ERP, EEWC, and WCHSS, respectively.Table 3
Dead nodes vs. rounds for 10% ANs.
Dead nodesRoundsERPEEWCWCHSS101326134811302013821411216930142514762236401500152523365015291574247060157516682785701689178435008018511892377190175432504017100200835124872


### 3.4. WCHSS for20% ANs

#### 3.4.1. Number of Alive Nodes

The simulations for 20% ANs for the number of alive nodes are presented in Figure6. The proposed WCHSS gives better performance and increases the network lifetime by 28.6% and 59.6% as compared to EEWC and ERP, respectively. The network life of the proposed algorithm is 4881 cycles, and 99% of all nodes are taken into account during this period. The previous WSN protocols died at 2008 and 3500 rounds for the ERP and EEWC, respectively.Figure 6
Network lifetime using 20% ANs.


#### 3.4.2. Total Residue Energy

The total RE for the proposed 20% ANs is evaluated in Figure7. The simulation results demonstrate that the proposed algorithm outperforms established protocols such as ERP and EEWC.Figure 7
Total RE for 20% ANs.Table4 shows the quantitative analysis where the proposed WCHSS has an RE of approximately 19.74 joules after 1800 cycles, whereas the EEWC has only 1.507 joules and ERP has consumed all the energy. Similarly, results demonstrating that the proposed algorithm outperforms existing protocols in terms of RE.Table 4
Energy consumption for 20% ANs.
RoundsRE (joules)ERPEEWCWCHSS36033.82539.40147.713172012.33418.51540.495210803.8597.48333.440311401.6713.65832.298718000.1601.50719.7403216000.46113.098


#### 3.4.3. Number of Dead Nodes

The dead nodes of the proposed algorithm with 20% ANs are shown in Table5 and Figure 8. The total number of nodes considered is 100, and simulations are performed till all nodes of the WSN have died. From the table, it is clear that the network lifetime of the proposed network is 4885 rounds, whereas other protocols such as ERP have 2024 rounds and EEWC has 3527 number rounds.Table 5
Dead nodes vs. rounds for 20% ANs.
Dead nodesRoundsERPEEWCWCHSS101309132410402013841439185630144314992304401500157523795015491643252560162817302811701707186135388018891917381190180132624100100202435274885Figure 8
Network life for 10% and 20% ANs.


### 3.5. Comparison of Results with 10% and 20% ANs

The proposed WCHSS is also compared to 10% and 20% ANs, and the comparative analysis is shown in Figure9. The proposed WCHSS increases the overall lifetime of the proposed network whereas 20% ANs give better performance compared to the 10% ANs. Figure 10 shows that the proposed WCHSS outperforms as compared to the existing ERP and EEWC algorithms in terms of energy consumption.Figure 9
Network life with existing protocols.Figure 10
RE comparison (after 720 rounds).


## 3.1. K-Medoid Clustering

The network is deployed with random distributed nodes over an area of100×100 square meters. From Figure 2, the SN is in the center of the network. From K-medoid clustering technique, κ=10 clusters are selected, and using WHCSS algorithm, the CH is obtained as shown in Figure 2. K-Medoid is a robust segregating method that forms κ clusters for the K nodes deployed in the network using data points as centers as shown with different color scheme in Figure 2.Figure 2
Network deployment.


## 3.2. Selection of Path

After clustering theK users into κ clusters, the next step is to determine the optimal path for packet transmission while minimizing energy consumption by iterative updating the location of CHs within each cluster. Figure 3 illustrates the transfer of data from SeNs in a cluster to the network’s SN, which is located in the network’s center, via respective CHs in a multihop mode of communication. Each CH calculates its distance from the SN and from all other CHs in the network. The data is then transmitted from a CH to its neighboring CH in the shortest possible route to the SN. The CH is updated with the optimal energy consumption, taking the following constraints into consideration: (1) the shortest possible distance between the SeN and SN and (2) the SeN’s maximum energy is closer to the cluster’s centroid.Figure 3
Distance-based routing.After clustering and determining the optimal path by iteratively updating the location of the CH within each cluster, the proposed scheme’s performance is validated for 10% and 20% AN scenarios. Similarly, numerical results are compared with the benchmark schemes to further validate the proposed scheme.


## 3.3. WCHSS for10% ANs

### 3.3.1. Number of Alive Nodes

This section represents the comparative analysis of the proposed scheme, and the results are compared with some benchmark scheme names: ERP (evolutionary routing protocol) and EEWC (energy-efficient weighted clustering), by considering network lifetime as a performance matrix as shown in Figure4. Initially, the algorithm tries to balance the network, and therefore, the SeN consumes slightly higher energy. Afterwards, the proposed algorithm performs better and improves the overall lifetime of the network. The results show that the proposed scheme outperforms all other schemes and improves by 28.13% over the EEWC technique and 58.93% over the ERP.Figure 4
Network lifetime for 10% ANs.


### 3.3.2. Total Residue Energy

The total RE with 10% ANs is shown in Figure5 and is also compared to the RE produced by existing techniques. As illustrated in Figure 5, the proposed algorithm consumes less energy in the WSN than other techniques. The proposed algorithm has an RE of 0.63 J, whereas other techniques have an RE of 4×10−5 J for EEWC and 7×10−5 J for ERP.Figure 5
Total energy consumption for 10% ANs.The RE of the proposed protocol is compared quantitatively to that of existing protocols in Table2. As shown in Table 2, the proposed WSN has a significantly lower RE than the EEWC and ERP. The proposed algorithm has an RE of 8.6 J, compared to 0.12 J for EEWC and zero for other protocols.Table 2
Energy consumption for 10% ANs.
RoundsRE (joules)ERPEEWCWCHSS36028.56434.34743.15437206.91813.52536.054810803.0923.74628.974411400.9961.85227.800718000.2320.64715.2424216000.128.6


### 3.3.3. Number of Dead Nodes

Similarly, the total number of dead nodes in the WSN is compared to the total number of dead nodes in other protocols and is shown quantitatively in Table3. Results demonstrate that proposed algorithm outperforms existing protocols. For the 50% of dead nodes, there are 1529, 1574, and 2470 rounds for ERP, EEWC, and WCHSS, respectively.Table 3
Dead nodes vs. rounds for 10% ANs.
Dead nodesRoundsERPEEWCWCHSS101326134811302013821411216930142514762236401500152523365015291574247060157516682785701689178435008018511892377190175432504017100200835124872


## 3.3.1. Number of Alive Nodes

This section represents the comparative analysis of the proposed scheme, and the results are compared with some benchmark scheme names: ERP (evolutionary routing protocol) and EEWC (energy-efficient weighted clustering), by considering network lifetime as a performance matrix as shown in Figure4. Initially, the algorithm tries to balance the network, and therefore, the SeN consumes slightly higher energy. Afterwards, the proposed algorithm performs better and improves the overall lifetime of the network. The results show that the proposed scheme outperforms all other schemes and improves by 28.13% over the EEWC technique and 58.93% over the ERP.Figure 4
Network lifetime for 10% ANs.


## 3.3.2. Total Residue Energy

The total RE with 10% ANs is shown in Figure5 and is also compared to the RE produced by existing techniques. As illustrated in Figure 5, the proposed algorithm consumes less energy in the WSN than other techniques. The proposed algorithm has an RE of 0.63 J, whereas other techniques have an RE of 4×10−5 J for EEWC and 7×10−5 J for ERP.Figure 5
Total energy consumption for 10% ANs.The RE of the proposed protocol is compared quantitatively to that of existing protocols in Table2. As shown in Table 2, the proposed WSN has a significantly lower RE than the EEWC and ERP. The proposed algorithm has an RE of 8.6 J, compared to 0.12 J for EEWC and zero for other protocols.Table 2
Energy consumption for 10% ANs.
RoundsRE (joules)ERPEEWCWCHSS36028.56434.34743.15437206.91813.52536.054810803.0923.74628.974411400.9961.85227.800718000.2320.64715.2424216000.128.6


## 3.3.3. Number of Dead Nodes

Similarly, the total number of dead nodes in the WSN is compared to the total number of dead nodes in other protocols and is shown quantitatively in Table3. Results demonstrate that proposed algorithm outperforms existing protocols. For the 50% of dead nodes, there are 1529, 1574, and 2470 rounds for ERP, EEWC, and WCHSS, respectively.Table 3
Dead nodes vs. rounds for 10% ANs.
Dead nodesRoundsERPEEWCWCHSS101326134811302013821411216930142514762236401500152523365015291574247060157516682785701689178435008018511892377190175432504017100200835124872


## 3.4. WCHSS for20% ANs

### 3.4.1. Number of Alive Nodes

The simulations for 20% ANs for the number of alive nodes are presented in Figure6. The proposed WCHSS gives better performance and increases the network lifetime by 28.6% and 59.6% as compared to EEWC and ERP, respectively. The network life of the proposed algorithm is 4881 cycles, and 99% of all nodes are taken into account during this period. The previous WSN protocols died at 2008 and 3500 rounds for the ERP and EEWC, respectively.Figure 6
Network lifetime using 20% ANs.


### 3.4.2. Total Residue Energy

The total RE for the proposed 20% ANs is evaluated in Figure7. The simulation results demonstrate that the proposed algorithm outperforms established protocols such as ERP and EEWC.Figure 7
Total RE for 20% ANs.Table4 shows the quantitative analysis where the proposed WCHSS has an RE of approximately 19.74 joules after 1800 cycles, whereas the EEWC has only 1.507 joules and ERP has consumed all the energy. Similarly, results demonstrating that the proposed algorithm outperforms existing protocols in terms of RE.Table 4
Energy consumption for 20% ANs.
RoundsRE (joules)ERPEEWCWCHSS36033.82539.40147.713172012.33418.51540.495210803.8597.48333.440311401.6713.65832.298718000.1601.50719.7403216000.46113.098


### 3.4.3. Number of Dead Nodes

The dead nodes of the proposed algorithm with 20% ANs are shown in Table5 and Figure 8. The total number of nodes considered is 100, and simulations are performed till all nodes of the WSN have died. From the table, it is clear that the network lifetime of the proposed network is 4885 rounds, whereas other protocols such as ERP have 2024 rounds and EEWC has 3527 number rounds.Table 5
Dead nodes vs. rounds for 20% ANs.
Dead nodesRoundsERPEEWCWCHSS101309132410402013841439185630144314992304401500157523795015491643252560162817302811701707186135388018891917381190180132624100100202435274885Figure 8
Network life for 10% and 20% ANs.


## 3.4.1. Number of Alive Nodes

The simulations for 20% ANs for the number of alive nodes are presented in Figure6. The proposed WCHSS gives better performance and increases the network lifetime by 28.6% and 59.6% as compared to EEWC and ERP, respectively. The network life of the proposed algorithm is 4881 cycles, and 99% of all nodes are taken into account during this period. The previous WSN protocols died at 2008 and 3500 rounds for the ERP and EEWC, respectively.Figure 6
Network lifetime using 20% ANs.


## 3.4.2. Total Residue Energy

The total RE for the proposed 20% ANs is evaluated in Figure7. The simulation results demonstrate that the proposed algorithm outperforms established protocols such as ERP and EEWC.Figure 7
Total RE for 20% ANs.Table4 shows the quantitative analysis where the proposed WCHSS has an RE of approximately 19.74 joules after 1800 cycles, whereas the EEWC has only 1.507 joules and ERP has consumed all the energy. Similarly, results demonstrating that the proposed algorithm outperforms existing protocols in terms of RE.Table 4
Energy consumption for 20% ANs.
RoundsRE (joules)ERPEEWCWCHSS36033.82539.40147.713172012.33418.51540.495210803.8597.48333.440311401.6713.65832.298718000.1601.50719.7403216000.46113.098


## 3.4.3. Number of Dead Nodes

The dead nodes of the proposed algorithm with 20% ANs are shown in Table5 and Figure 8. The total number of nodes considered is 100, and simulations are performed till all nodes of the WSN have died. From the table, it is clear that the network lifetime of the proposed network is 4885 rounds, whereas other protocols such as ERP have 2024 rounds and EEWC has 3527 number rounds.Table 5
Dead nodes vs. rounds for 20% ANs.
Dead nodesRoundsERPEEWCWCHSS101309132410402013841439185630144314992304401500157523795015491643252560162817302811701707186135388018891917381190180132624100100202435274885Figure 8
Network life for 10% and 20% ANs.


## 3.5. Comparison of Results with 10% and 20% ANs

The proposed WCHSS is also compared to 10% and 20% ANs, and the comparative analysis is shown in Figure9. The proposed WCHSS increases the overall lifetime of the proposed network whereas 20% ANs give better performance compared to the 10% ANs. Figure 10 shows that the proposed WCHSS outperforms as compared to the existing ERP and EEWC algorithms in terms of energy consumption.Figure 9
Network life with existing protocols.Figure 10
RE comparison (after 720 rounds).


## 4. Conclusion

This research work examined the difficult problem of energy minimization and optimistic path selection in WSNs. This research focuses on refining the process for selecting CHs in WSNs based on three separate weights: the CH’s distance from the cluster center, the CH’s distance from the SN, and the CH’s RE. The proposed WCHSS algorithm outperforms existing algorithms such as ERP and EEWC in terms of energy consumption. The network lifetime is increased by 28.5% and 59.62%, respectively, for the existing technologies, namely, ERP and EEWC. In future, the higher energy consumption at the start of the network will be improved by further stabilizing the network.



---

*Source: 3055178-2022-05-06.xml*