An Optimized Hierarchal Cluster Formation Approach for Management of Smart Cities

: A smart city is a metropolis technology that employs information technology with several internet of things (IoT) devices to enhance the quality of services for citizens, such as the trafﬁc system, energy consumption, and waste collection. In fact, the quality of service (QoS) of these daily routine services are based on an assistive observation system. Wireless sensor networks (WSNs), as the key component of IoT, are used here to gather data into surveillance subsystems for supporting the decision making. To enhance the collected data management of the surveillance subsystems, many clustering techniques are introduced. The low-energy adaptive clustering hierarchy protocol (LEACH) is a key clustering technique of WSN. However, this protocol has deterring limitations, especially in the cluster formation step, which negatively impacts the residual power of many nodes. In fact, a limited number of efforts that try to optimize the clustering formation step represent the main motivation of this work. Considering this problem, the current research proposes an optimized approach to enhance the cluster formation phase of LEACH. The proposed approach depends on the suitability of the residual energy in the nodes to cover the communication energy, with CHs (cluster heads) as a key factor when allocating the node clusters in the ﬁrst competition. The remaining power and the density of CHs are employed to weigh the accepted CHs and adjust the optimized size of the clusters in the secondary competition. The third competition helps each cluster to select the optimal members from the candidate members according to the impact of each. The advantages and efﬁciency of the ICSI (intelligent cluster selection approach for IoT) are observed via the ratio of surviving nodes increasing by 21%, residual energy increasing in 32% of the nodes, and a 34% higher network lifetime.


Introduction
Wireless sensor networks (WSNs) are one of the most promising technologies for accessing information.WSNs are widely applied in many modern management environments, such as health care, agriculture, the military, greenhouses, the weather, the IoT, and smart cities [1].Typically, a WSN is composed of a vast number of small nodes with both limited energy and sensing, wireless communication, and computational capabilities [2].Limited power resources influence the longevity and availability of WSNs.Therefore, energy conservation is an important requirement of such networks.
To enhance the availability of WSNs and conserve energy, clustering techniques are introduced to play a vital role in reducing the number of transmitted data packets and in preserving the limited power resources [3,4].Using clustering, a WSN is divided into a number of clusters with a lower number of related sensing nodes (SNs), whose function is just to collect and forward data to their equivalent cluster header nodes [5].Each cluster contains at least one cluster head (CH), which acts as a sink node (responsible for receiving and aggregating the sensed data from SNs and forwarding them to the base station (BS)).In this way, the volume of transmitted data is reduced, and the energy consumption of the network is lowered.In addition, collisions between transmitted packets are also reduced, resulting in better throughput under high loads and conservation of communication bandwidth [6].
Much experimental effort has been exerted to fulfil this requirement and to achieve good power preservation in cluster-based WSNs.Consequently, low-energy adaptive clustering hierarchy (LEACH) [7] was initially introduced as the most essential clustering protocol for WSNs; it is identified as a circulated, single-hop clustering protocol for reducing power consumption and extending network lifetime.The adaptive process of LEACH that occurs in each round has two stages.The first stage, the 'setup phase', is subdivided into two steps: the CH election step, where the CHs are randomly elected; and the CH selection step, where the formation of each cluster starts by allocating each node to the closest CH.In the second stage, the 'steady-state phase', the collected data are transferred to the sink node via CHs.During the setup phase, each node employs a probabilistic technique at each round to determine whether it will be a CH in each round.As the node succeeds in being a CH, it broadcasts an invitation message to join its clusters.At the end of each round, non-CH nodes select the closest CH and send an acknowledgement message to join it.Then, the CH generates a schedule for each node to send its data.The optimal election and selection of CHs directly affect the network lifetime, so they are considered key steps in conserving the availability of WSNs [8].
In fact, LEACH paved the way for the introduction of many works that attempted to implement LEACH, resulting in the discovery of many drawbacks of LEACH at each phase.Concerning the clustering formation (CH selection) step, LEACH has the following limitations:

•
Although each node should be able to be linked with its CH with minimal energy, LEACH does not consider any factors other than distance; it disregards all other influential factors that have a direct effect on the communication cost, such as the location, bandwidth, and traffic load.

•
The adequacy of the remaining energy is not considered when selecting the CHs for nodes.It is defined as the ability of the remaining power of the node to cover the required transmission cost to the CH.

•
The cluster size is another important factor that influences the energy consumption and consequently the lifetime of the whole network [9].The cluster size is disregarded by LEACH.
The selection of the optimal CH for each node and the optimal size of each cluster are hard problems that hinder the use of deterministic algorithms.Therefore, using optimization techniques can be more suitable here to optimize the system performance and achieve the lowest energy cost among different numbers of choices [10,11].
On the other hand, optimization techniques are used to drive the best possible solutions of the decision under a certain group of constraints according to a selected optimization function.Several optimization techniques that are inspired from the biological world have been introduced to solve complex problems in many domains, especially WSNs [12].Genetic algorithms (GAs), evolutionary algorithms (EAs), particle swarm optimization (PSO), and ant colony optimization (ACO) are examples of these techniques.Notably, the GA has an extremely wide range of choices to optimize the clustered WSN for minimizing the consumed energy by estimating the optimal solutions [13].In fact, the GA is a known heuristic technique that selects the optimal solution through producing several possible solutions [14].The process of the GA includes three essential tasks.The first task is the initialization, where it begins by generating the basic population randomly.The second task is the fitness task, where scoring each solution base is qualified.This task uses a repetitive activity involving crossover and selection operators.The third task is the selection task that occurs during every succeeding generation, a new generation is obtained through accepting members on the basis of their fitness.The solutions with higher fitness have a greater chance of being selected, this operation leads to better adoption of the best solution.
The communication cost is the major energy consumer in nodes [15].While the sensing and computational costs are fixed for each node, the communication cost is affected by many factors.These factors have many forms such as the number of transmitted data packets (network traffic load), the distance of transmission, and the bandwidth of the transmission link [16,17].Therefore, an effective energy optimization technique is always needed to minimize the energy consumption in the communication process in WSNs.
To overcome the previous problems of LEACH, the present research proposes two improvements in the cluster formation phase, where SNs select their CHs.The first improvement is aimed at selecting the optimal CH of each SN based on many factors.The adequacy of the remaining energy compared to the transmission energy cost is the decisive factor in selecting relevant CHs.The present work also addresses the problem of selecting CHs based on only distance, which may cause dissipation of energy among SNs.The target of the second improvement is to optimize the cluster size to conserve the power of the CHs.The optimal cluster size is defined as the size by which the data are routed from the SN to the CH and subsequently to the BS using the minimal transmission energy that can keep the CH alive [18,19].In fact, identifying these factors for CH selection to minimize the consumed energy is one novelty of ICSI.Also, employing these factors in an optimized approach is another novelty of the proposed approach.
Therefore, the significant contribution of this work is to introduce an intelligent cluster selection approach for IoT (ICSI) as an optimized version of the cluster formation step of LEACH.ICSI acts to diminish the power consumption and extend the WSN durability.The chief objectives of the new optimal model are listed as follows: 1.
To select the optimal CHs for each node and allocate the node to the cluster only if it meets the power requirements.2.
To optimize the cluster size by allocating the node to the cluster with the condition that it has an optimal node power factor (NPF) that can keep the CH alive.
The following list summarizes the abbreviations that are used in this work.

Related Works
Clustering techniques have an important role in extending WSN durability.The lowenergy adaptive clustering hierarchy (LEACH) protocol [7] is a basic clustering protocol for WSNs.The proposed research addresses some limitations in the CH selection step of the setup phase.Depending on the assumption that the consumed energy rises by increasing the distance, much effort is dedicated to enhancing the setup phase of LEACH by selecting the shortest distance to minimize the energy consumption [20][21][22][23][24].As stated in [16], the main problem of most works recommending LEACH is the assumption that distance is the only factor that affects energy consumption.This hypothesis does not necessarily propose an efficient method of selecting the proper CHs for SNs that can extend the network durability.Notably, the energy consumption of any network is strongly influenced by further factors such as traffic load, network bandwidth, and type of provided service, in addition to some demographic factors represented by the physical distance between communicated sites and the density of the communicated area.Similar to distance, the network traffic load directly influences the power consumption of the network [25].Therefore, some works try to use a combination of some of these factors to select the most suitable CH for each node.This approach encourages the exertion of much effort to enhance the LEACH protocol using different strategies and technologies [5,26,27].Some research works utilize both residual energy and distance to enhance LEACH and achieve more accurate results [28][29][30].Other efforts have selected CHs based on the node degree [31] or communication cost [32].
The multiplicity of factors that influence the process of LEACH necessitates the emergence of new methods to produce an optimal decision under these factors.Thus, the optimization of energy consumption is a significant WSN research topic that is highly concerned with minimizing energy dissipation.Some works introduced to optimize LEACH use custom fitness functions.The work by [12] also uses a custom fitness function to optimize the CH election step of LEACH based on a quadratic competition.The candidate CHs are also elected after the determination of the CHs.The final CH node is identified by the second competition.There are two major differences between ICSI and this work.First, this work acts to enhance a different step (CH-election step) while ICSI tries to enhance the cluster formation step which involves a much larger number of nodes.Another difference is in the factors that are used in the optimized selection process.
The recommendation made by the authors of [29] uses a custom fitness function to optimize the enhancement of LEACH by determining the scope of the CH selection according to the energy level and by controlling the cluster size.In fact, ICSI benefits from their idea to control the cluster size during the optimization process.While they depend on the energy level and a fixed cluster size, ICSI is based on the adequacy of the energy level compared to the required energy.In addition, ICSI controls the optimal size of each cluster according to the capability of the CH to join new members.
The authors of [33] introduced a fuzzy-based enhanced cluster head election algorithm (FBECS) that anticipated the remaining energy, distance, and density of the node in its neighborhood.The authors calculated the eligibility index for each node during the CH selection.This work differs from ICSI again as it acts to improve the CH-election step versus the CH-selection step by ICSI.Specifically, it does not consider the sufficiency of the residual energy when allocating SNs to their optimal cluster.The current work is affected by this work but with consideration of the effect of the CH-density not in the density cluster of members in addition to different factors.
On the other hand, many biologically inspired artificial intelligent methods have been implemented to select the best combination of parameters from several possibilities [34].The GA is broadly applied as it is considered one of the best optimization techniques that can reach the ideal combination of dependent parameters that help minimize the dissipation of power.Using the GA, many efforts have been made to optimize the WSN clustering protocol, especially LEACH [15,31,35].
Other works are considered as related to ICSI although they aim to enhance another step with different conditions, but the process of ICSI benefits from their ideas.In addition, the current work is based on GA, but it is different from all mentioned GA-related works in the number of competitions levels in addition to the used factors.
In [36], they use the GA to select the best CHs based on their location relative to the BS to lower the data transmission energy cost.They add a new preparation phase that starts before the setup phase in the first round.All nodes initially select a CH and send a decision regarding whether it can be a CH candidate, along with other information.The optimal probability of nodes being CHs is obtained by the BS using the GA based on the minimum energy needed to complete one round.The preparation phase is essential only in the first round.The installation and steady-state phases in each round are the same as those of LEACH.Similar to this work [37], use the GA to enhance LEACH.They also add an additional preparation phase.The optimal probability of nodes being CHs is achieved by using the GA for reducing the total energy consumption.The preparation phase is performed only once before the set-up phase of the first round.Their simulations confirm the effectiveness of LEACH-GA to produce optimal energy consumption, and an extension of the network lifetime.In fact, these works ignore important factors such as the traffic load to the BS, and the adequacy of residual energy to the needed transmission energy.It differs from ICSI again as it acts to improve the CH-election step versus the CH-selection step using ICSI.
Additionally, the work in [34] further uses the GA to improve the quality of service (QoS) parameters of LEACH to discover the optimal routing path using its fitness function.The GA helps to find the optimal route by using its fitness function according to the equality of the residual energy of the CH to the average of the residual energy of all nodes.Their optimized method is effective, as can be seen from their results, but it ignores the important effect of the traffic load, and the adequacy of the residual energy for the needed transmission cost.Finally, the work by [38] introduces a GA-based optimized approach to enhance the CH-election step based on the distance and residual energy, which are considered as limitations by the current work.Their objective function depends on three fitness functions to evaluate the residual energy of the elected CH proportional to the residual energy of the surrounding nodes, and the distance between the CH and the BS.
Table 1 is presented to summarize the related optimized methods used to enhance LEACH.In fact, the main motivation of this work is the limited number of efforts that have tried to optimize the clustering formation (CH selection) step.This research seeks to implement a custom fitness function to choose the optimal values of the parameters that affect the selection of the CH that achieves the lowest consumed energy.Although a few works have addressed the cluster formation phase, the present work is the first to focus on the competition in selecting one CH from several CHs that invite the same node and even on the competition in deciding which nodes should be invited by each elected CH.

Proposed Approach
The setup phase of LEACH is very important for controlling power consumption.This phase consists of two steps: the CH election step, where the CHs are randomly elected; and the cluster formation step, where every node selects the closest CH.Most equivalent studies that recommend LEACH to prolong the network lifetime have exclusively focused on the CH election step of the setup phase, disregarding the other steps.

Research Problems
Although the cluster formation step of LEACH includes the largest number of nodes that strongly influence energy conservation, very few efforts have been exerted to improve it.Additionally, the LEACH protocol constructs the clusters based on the shortest distance factor.Some works have tried to enhance this step by adding a residual energy factor.However, the impact of only these two factors is still not sufficient, especially when the network traffic is loaded.Even if the residual energy of the node is high, the node may die during the round if the required energy for communication with the CH increases due to factors other than distance.These factors are listed by the authors of [17,39], as explained previously.Consequently, the present research is aimed at enhancing the clustering formation step by addressing the following problems of the step that are held to be responsible for energy exhaustion: 1.
The lack of attention to the factors that influence power depletion in each round, as SNs select the closest CH with the shortest distance regardless of the traffic load or the density of the monitoring area.

2.
The lack of attention to the eligibility of the remaining energy of nodes to join a certain cluster during CH selection by nodes.

3.
The lack of constraints on the cluster size to avoid the fast expiration of CHs and SNs, since LEACH allows the production of clusters with a large size, which rapidly exhausts the energy.

Research Contributions
According to the introduced protocol, the structure of each cluster may change after each round according to the properties of the nodes.Such properties will contribute to determining the optimized CH for each node and the optimized size of each cluster.
However, as previously mentioned, allocating SNs to a suitable cluster based only on the distance factor to guarantee power savings is not precise.For more reliable results, this research proposes using all factors that may affect energy consumption during communication between two nodes.In this research, the communication energy cost (CEC) refers to the total effect of such factors.
A high level of stored energy is not a sufficient factor for selecting the CH of a node.The eligibility of this stored energy (regardless of how high or low) for communication between two nodes is a critical factor during the cluster formation step.The first contribution is to construct clusters depending on all factors that affect energy consumption instead of considering distance as the only factor.To propose an efficient method to evaluate the adequacy of the remaining energy required to cover CEC during cluster formation is a second contribution of the present research.The third contribution is to adjust the optimal size of the cluster according to the energy requirements.Therefore, to extend the durability of CHs, this research does not allocate the node to the full-sized cluster.The allocation of nodes to the CH is allowed only if the cluster size permits, i.e., the addition of a node to the cluster will not affect the ability of the CH to complete the round.If the number of nodes is equal to or greater than this size, a node is allocated to the next suitable CH.

Assumptions
The present work outfits the LEACH protocol under the following assumptions: a.
CHs are already elected for each cluster.Thus, the energy model of the proposed work is simpler, especially since the cluster formation step of LEACH starts independently and after the CH is elected.b.
The locations of all nodes are known; thus, the distance between any two nodes and the distance between any node and the BS can be easily calculated using the Euclidean distance equation.c.
The transmitted packets from all nodes are equal in size.Thus, the impact of the proposed model can be studied without an effect of the data size.d.
The BS performs all the calculations in each round and is adequately equipped with the power required for this task.Thus, the power of each node is affected only by the operations of the proposed approach.e.
Each node uses the same energy level and can estimate the residual energy at the BS depending on the power transfer and transmission cost.
f.As in LEACH, the CH can originate a time-division multiple access (TDMA) schedule, which decides when the SNs can transmit each time slot.So, no unexpected traffic load can interrupt the transmission of the proposed work.

Energy Model
Like many works that are aimed at extending the durability of WSNs, this research uses the first-order radio model [7] as an energy model.The energy for transmission (E T ) of a unit of data and the energy for receiving (E R ) a unit of data are expressed by the first-order radio model in Equations ( 1)-( 3).
where E ele represents the power of the transmitter electron of a unit of data, E amp signifies the power of the transmitted amplification energy of a unit of data, and (efs) and (efl) are the short-distance amplification energy and long-distance amplification energy, respectively.In the ICSI model, the energy of CH i is consumed mainly by three definite energyconsuming periodic tasks.These tasks are receiving data from sensor nodes, the aggregating of the received data, and the sending of the aggregated data to the BS.The consumed energy that can be expended every round is formulated by Equation ( 4): where M is the cluster size of CH i , E R ij is the energy of CH i required to receive the sensed data from cluster member j, E G i represents the energy of CH i required to aggregate the received data, and E T BS is the transmission energy of sending the aggregated data to the BS.The residual energy (RE) of CH i is obtained after each round using Equation (5): On the other hand, each sensor node (SN j ) is also responsible for a set of periodic energy-consuming tasks.These tasks are sensing data from its environment and sending the sensed data to the CH (sink).The consumed energy that can be expended every round by each SN j is expressed as Equation ( 6).
where E s j is the energy consumed by each SN j to collect data from its surroundings, while E T (d CH i ) is the transmission energy from each SN j to the corresponding CH i .Thus, the residual energy of any SN j in each round is expressed by Equation (7).

Proposed Protocol (ICSI Description)
To minimize energy consumption in the cluster formation step, the proposed research introduces an optimized version of the LEACH protocol (ICSI) to extend the durability of the network.ICSI helps in the effective delivery of messages between SNs and CHs with minimum energy and reduced bandwidth consumption using the optimal parameter selection.
According to LEACH, as soon as a CH is elected it broadcasts an announcement message and, according to the shortest distance, SNs select their CHs by sending a join request message.However, each CH announces more nodes than it can add to its cluster and receives numerous join request messages from more nodes than it can add.Although each SN can receive many invitations, it can accept only one.These situations are sources of energy consumption in LEACH.Therefore, the critical questions that ICSI tries to answer are listed as follows: -Which nodes does each CH have to invite?-Which CH does the SN have to request to join? -For which nodes can the CH accept their joining?
According to ICSI, the structure of the cluster may change each round according to the features of the CHs and SNs.These features will contribute to allocating SNs to the most suitable existing clusters.These features represent the factors of selecting optimal CHs and optimizing the cluster size, and they are listed in Table 2.The proposed cluster formation method of ICSI assumes that in each round, the WSN is segmented into a group of clusters defined by CHs that are elected by any election model.
In the process of ICSI, each node, whether it is a CH or an SN, has a set of periodic tasks.The candidate cluster members (CCM i ) of any CH i are those nodes that are in its communication range with distance ≤ d 0 .The number of CCMs can serve as an indicator of the density around each CH.For any CH i , the set of candidate members CCM i is defined by Equation (8).
where SN j is any node in the communication range of CH i .The required energy of any CH to receive sensed data from one node (Ev CH i ) is derived from Equation (4) using Equation ( 9): The maximum possible number of members of each cluster or the maximum size of a cluster (MCSize) is obtained using the RE of the CH using Equation (10): Accordingly, the improved cluster formation process is depicted in Figure 1 as follows: Each CH starts the round by sending an invitation message (IM) with its spatial and energy information to each candidate member.The energy information contains the residual energy of the CH and CEC or the total energy needed for communication with the SNi.This research claims that the CEC between any two nodes reflects the effect of all factors that can influence energy consumption (Equation ( 11)).CEC =  , +  (11) where ( ) represents the energy consumed by the sender node due to all factors that affect the communication between the CH and the SN.
The key component of ICSI is the fitness function, which acts to optimize all factors that concurrently affect the energy consumption during the process of CH selection.SNs receive many invitations from various CHs; therefore, they need to decide which invitation to respond to.
For all received IMs, the first competition is accomplished based on the ability of the current node (CN) to complete the round with the specified CH.This competition seeks to determine the accepted CHs of each SN.According to the 1st competition, the residual energy is higher than the CEC, the elected CH is selected as an accepted CH of the SN, and the SN is remarked as a candidate member of the CH.Equation (12) evaluates the residual energy of the current node compared to the required CEC.The value of f1 (Equation ( 13)) introduces the first evaluation of the cost to reach the CH.This step attempts to establish the set of accepted CHs for each SN and the set of accepted SNs for each CH (that can complete their round communication).A zero value of f1 means that the SN cannot complete its round with the specified CH and that this CH is not acceptable for that SN.Each CH starts the round by sending an invitation message (IM) with its spatial and energy information to each candidate member.The energy information contains the residual energy of the CH and CEC or the total energy needed for communication with the SN i .This research claims that the CEC between any two nodes reflects the effect of all factors that can influence energy consumption (Equation ( 11)).
CEC = E T chi,SN + E delay (11) where (E delay ) represents the energy consumed by the sender node due to all factors that affect the communication between the CH and the SN.
The key component of ICSI is the fitness function, which acts to optimize all factors that concurrently affect the energy consumption during the process of CH selection.SNs receive many invitations from various CHs; therefore, they need to decide which invitation to respond to.
For all received IMs, the first competition is accomplished based on the ability of the current node (CN) to complete the round with the specified CH.This competition seeks to determine the accepted CHs of each SN.According to the 1st competition, the residual energy is higher than the CEC, the elected CH is selected as an accepted CH of the SN, and the SN is remarked as a candidate member of the CH.Equation ( 12) evaluates the residual energy of the current node compared to the required CEC.The value of f1 (Equation ( 13)) introduces the first evaluation of the cost to reach the CH.This step attempts to establish the set of accepted CHs for each SN and the set of accepted SNs for each CH (that can complete their round communication).A zero value of f1 means that the SN cannot complete its round with the specified CH and that this CH is not acceptable for that SN.
The second competition is then performed to weight each accepted CH for each SN according to the cost of the density factor using Equation ( 14), where (MCSize) is the maximum cluster size that is calculated by Equation (10).In the second competition, the accepted CH is weighted for each node according to the density factor of the CH.The density around the CH affects the traffic load, which can affect the residual energy of the SN that reaches the CH.The value of f 2 decreases the chance of a dense CH and raises its weight in the next differentiation: Then, the third competition process for each CH is implemented to evaluate the NPF of each candidate member using the competitive weight of each candidate SN according to Equation (15): where n is the number of accepted SNs and x is calculated using Equation ( 16).
The summation of w is (∑ i=n i=1 W i = 1).
The objective of the fitness function of ICSI is determined using Equation ( 17), which is derived from the third competition process; it can concurrently optimize the variants affecting the network life.
The improved cluster formation process is described in Algorithm 1 as follows: Algorithm 1: ICSI process Inputs: CHs[], SNs[], power and physical properties(RE, EV, E delay , etc.),

Output: Optimal cluster members list
Step 1: Begin Step 2: A better solution means that an SN with a residual energy that is higher than the CEC to lower the dense CH is allowed to join its cluster.Many factors influence the network life.The fitness function of ICSI concurrently optimizes these factors.

Summary of Proposed Work
The ultimate goal of this study is to enhance the cluster formation step for saving power.This goal requires allocating each SN to the optimum cluster, giving a minimum power loss for the CH and the allocated SNs.
Three problems guide three questions that result in an optimized approach, with an objective function that is based on three fitness functions with three contributions.Figure 2 depicts the relationship between the research goal, the questions that the current work on ICSI is trying to answer, the research problems, contributions, and the proposed methods.
Appl.Sci.2023, 13, x FOR PEER REVIEW 11 of 19 Step 14: end for Step 15: End A better solution means that an SN with a residual energy that is higher than the CEC to lower the dense CH is allowed to join its cluster.Many factors influence the network life.The fitness function of ICSI concurrently optimizes these factors.

Summary of Proposed Work
The ultimate goal of this study is to enhance the cluster formation step for saving power.This goal requires allocating each SN to the optimum cluster, giving a minimum power loss for the CH and the allocated SNs.
Three problems guide three questions that result in an optimized approach, with an objective function that is based on three fitness functions with three contributions.Figure 2 depicts the relationship between the research goal, the questions that the current work on ICSI is trying to answer, the research problems, contributions, and the proposed methods.

Simulation and Results
According to the LEACH protocol, the cluster formation step affects the residual power of numerous nodes, which are candidates to become CHs in other rounds; it might drain the residual energy of many nodes.Therefore, the current research gives this step the ultimate importance for conserving the energy; it is mainly introduced as an optimized version of LEACH that introduces three contributions to compensate for any deficiencies in the cluster formation step.The first contribution is to construct clusters depending on all factors that affect energy consumption instead of considering distance as the only variant that helps conserve network power.The second contribution is to propose an efficient method to evaluate the ability of the residual energy of a node to cover the CEC with all current CHs.The third contribution is the adjustment of the cluster size, according to the residual energy of the CH, to avoid the formation of extra full-size clusters.
Since there are few comparable studies that try to enhance or optimize the cluster formation step of LEACH, ICSI has selected the most prominent of them to follow their testing conditions and simulation environment.Therefore, ICSI is compared to I-LEACH-1, proposed by [12]; I-LEACH-2, proposed by [29]; and FBECS, proposed by [33], using two main assessment techniques: 1.The network performance assessment technique, which can be measured using: a.The first node dead (FND), quarter node dead (QND), and half node dead (HND) in each round.The delayed appearance of the dead node corresponds to a better performing network.

Simulation and Results
According to the LEACH protocol, the cluster formation step affects the residual power of numerous nodes, which are candidates to become CHs in other rounds; it might drain the residual energy of many nodes.Therefore, the current research gives this step the ultimate importance for conserving the energy; it is mainly introduced as an optimized version of LEACH that introduces three contributions to compensate for any deficiencies in the cluster formation step.The first contribution is to construct clusters depending on all factors that affect energy consumption instead of considering distance as the only variant that helps conserve network power.The second contribution is to propose an efficient method to evaluate the ability of the residual energy of a node to cover the CEC with all current CHs.The third contribution is the adjustment of the cluster size, according to the residual energy of the CH, to avoid the formation of extra full-size clusters.
Since there are few comparable studies that try to enhance or optimize the cluster formation step of LEACH, ICSI has selected the most prominent of them to follow their testing conditions and simulation environment.Therefore, ICSI is compared to I-LEACH-1, proposed by [12]; I-LEACH-2, proposed by [29]; and FBECS, proposed by [33], using two main assessment techniques: 1.
The network performance assessment technique, which can be measured using: a.
The first node dead (FND), quarter node dead (QND), and half node dead (HND) in each round.The delayed appearance of the dead node corresponds to a better performing network.b.
Network durability (the number of rounds until all nodes are dead) is employed as another metric for the network performance.Network durability can be estimated by the number of rounds with live nodes.

2.
The network survivability assessment technique, which can be measured using: a. Energy depletion, as another metric for network survivability that measures the consumed energy.b.
The average remaining power of all nodes in the network during each round.c.
The network throughput, which can be measured by successful packet delivery to the BS.
ICSI is replicated to certify its performance and durability compared to I-LEACH-1, I-LEACH-2, FBECS, and LEACH.The simulation work is carried out in MATLAB, and it is an edited version from [40,41].Two scenarios are considered for the introduced work.In scenario #1, the nodes are equipped with 0.5 J of energy, and the total count of nodes in this scenario is kept at 100 m 2 .In scenario #2, the total number of nodes is raised to 200 m 2 with 1 J of energy.For a fair comparison, the values of the simulation parameters for the mentioned related works are retained.Table 3 presents the set of parameters and the baseline settings for the simulation experiment.

Network Performance Assessment Results
(1) First Node Dead, Quarter Node Dead and Half Node Dead The percentage of dead nodes is a vital indicator of the non-covered parts of the monitoring area and the consequent performance of the actual system.
The performance of ICSI is analyzed and compared to the mentioned related works.As depicted by the bar graph in Figure 3, the traditional LEACH algorithm shows the first dead node in the 200th round, while the algorithms I-LEACH-1 and I-LEACH-2 show the first dead node in the 300th round and 280th round, respectively.The results show that the suggested algorithm (ICSI) delays the death of the first node as it dies almost in the 380th round.Therefore, it is obvious that the proposed algorithm has a longer network life cycle.This delay of the first node death reflects efficient power utilization that can significantly extend the lifetime by conserving energy.The effectively The results show that the suggested algorithm (ICSI) delays the death of the first node as it dies almost in the 380th round.Therefore, it is obvious that the proposed algorithm has a longer network life cycle.This delay of the first node death reflects efficient power utilization that can significantly extend the lifetime by conserving energy.The effectively delayed first dead node acts to conserve the network energy.As also shown in Figure 3, and as highlighted by the indicator of the death of all nodes, in the LEACH protocol, all nodes died after approximately 800 rounds.In the I-LEACH-1 and I-LEACH-2 protocols, all nodes died after approximately 1500 rounds, whereas in the ICSI protocol, all nodes died after approximately 1800 rounds.The ICSI protocol is 70%, 23.83%, and 77.6% faster than the LEACH-1, LEACH-2, and LEACH protocols, respectively.Also, Figure 4 illustrates the QND and HND metrics obtained from the simulation results.The QND is extended by 150%, 64.51%, 51.27%, and 1% compared to LEACH, LEACH-1, LEACH-2 and FBECS, respectively.The HND is prolonged by 89.14%, 31.22%,11.03%, and 12.73% compared to LEACH, LEACH-1, LEACH-2 and FBECS, respectively.The results show that the suggested algorithm (ICSI) delays the death of the first node as it dies almost in the 380th round.Therefore, it is obvious that the proposed algorithm has a longer network life cycle.This delay of the first node death reflects efficient power utilization that can significantly extend the lifetime by conserving energy.The effectively delayed first dead node acts to conserve the network energy.As also shown in Figure 3, and as highlighted by the indicator of the death of all nodes, in the LEACH protocol, all nodes died after approximately 800 rounds.In the I-LEACH-1 and I-LEACH-2 protocols, all nodes died after approximately 1500 rounds, whereas in the ICSI protocol, all nodes died after approximately 1800 rounds.The ICSI protocol is 70%, 23.83%, and 77.6% faster than the LEACH-1, LEACH-2, and LEACH protocols, respectively.Also, Figure 4 illustrates the QND and HND metrics obtained from the simulation results.The QND is extended by 150%, 64.51%, 51.27%, and 1% compared to LEACH, LEACH-1, LEACH-2 and FBECS, respectively.The HND is prolonged by 89.14%, 31.22%,11.03%, and 12.73% compared to LEACH, LEACH-1, LEACH-2 and FBECS, respectively.The simulation results illustrate that ICSI meets the requirements of power conservation and prolongs the network lifetime and stability period.ICSI outperforming the other protocols is due to its concern from the beginning to allocate SNs to the optimum cluster, which is based on the CH that needs the minimum power requirements to communicate with.In general, this had a great effect on delaying the death of nodes.
(2) Network lifetime As illustrated in Figure 5, the simulation results of ICSI show more live nodes compared to other methods.As the number of rounds rises, the live-node count decreases.At round 1500, the graph shows that ICSI, in terms of the number of live nodes, is 78.88%, 10.64%, and 6.86% better than LEACH, LEACH-1, and LEACH-2, respectively.
Therefore, the proposed ICSI is better than other related models in terms of the number of live nodes.In the optimized selection step of ICSI, the limited power nodes (with lower energy levels) are protected, and the energy consumption of the network is lowered.This finding shows that ICSI is highly concerned with conserving energy, so it is better than the other related protocols in prolonging the network lifetime.The longevity of the network is another result of the ability of ICSI to conserve power by selecting the cluster with the minimum communication energy cost.Reducing the communication energy cost, which is the largest power consumer, has a significant effect on reducing the consumed power and consequently elongating the lifetime of the whole WSN.
The simulation results illustrate that ICSI meets the requirements of power conservation and prolongs the network lifetime and stability period.ICSI outperforming the other protocols is due to its concern from the beginning to allocate SNs to the optimum cluster, which is based on the CH that needs the minimum power requirements to communicate with.In general, this had a great effect on delaying the death of nodes.
(2) Network lifetime As illustrated in Figure 5, the simulation results of ICSI show more live nodes compared to other methods.As the number of rounds rises, the count decreases.At round 1500, the graph shows that ICSI, in terms of the number of live nodes, is 78.88%, 10.64%, and 6.86% better than LEACH, LEACH-1, and LEACH-2, respectively.Therefore, the proposed ICSI is better than other related models in terms of the number of live nodes.In the optimized selection step of ICSI, the limited power nodes (with lower energy levels) are protected, and the energy consumption of the network is lowered.This finding shows that ICSI is highly concerned with conserving energy, so it is better than the other related protocols in prolonging the network lifetime.The longevity of the network is another result of the ability of ICSI to conserve power by selecting the cluster with the minimum communication energy cost.Reducing the communication energy cost, which is the largest power consumer, has a significant effect on reducing the consumed power and consequently elongating the lifetime of the whole WSN.

Network Survivability Assessment Results
(1) Energy Depletion Figure 6 shows the residual energy of nodes in ICSI compared with the related protocols over 1500 rounds.Compared with LEACH, the total residual energy of ICSI is approximately 40% greater than that of the original LEACH, approximately 25% greater than I-LEACH-1, and 21% greater than I-LEACH-2.The lower power consumption reflects the better power balance [29].ICSI can achieve better power equilibrium and prolong the network lifetime as the transmission energy cost is the chief consumer of the energy of nodes.Therefore, the effective power consumption between two nodes can conserve the power (this is a function of ICSI).Decreasing the energy depletion in SNs is validated by such a result.This is due to selecting clusters using the correct factors other than distance, as in the most related works.ICSI chooses to be more efficient by relying on the adequacy of the residual energy for transportation requirements instead of depending weakly on the level of energy without taking into account the level of need for this energy.

Network Survivability Assessment Results
(1) Energy Depletion Figure 6 shows the residual energy of nodes in ICSI compared with the related protocols over 1500 rounds.Compared with LEACH, the total residual energy of ICSI is approximately 40% greater than that of the original LEACH, approximately 25% greater than I-LEACH-1, and 21% greater than I-LEACH-2.The lower power consumption reflects the better power balance [29].ICSI can achieve better power equilibrium and prolong the network lifetime as the transmission energy cost is the chief consumer of the energy of nodes.Therefore, the effective power consumption between two nodes can conserve the power (this is a function of ICSI).Decreasing the energy depletion in SNs is validated by such a result.This is due to selecting clusters using the correct factors other than distance, as in the most related works.ICSI chooses to be more efficient by relying on the adequacy of the residual energy for transportation requirements instead of depending weakly on the level of energy without taking into account the level of need for this energy.(2) Average remnant energy In each round, all nodes lose energy for many reasons, including wireless communication.As the number of rounds increases, the average remaining energy of all nodes decreases.Figure 7 depicts the average remaining energy of all nodes.The average remain- (2) Average remnant energy In each round, all nodes lose energy for many reasons, including wireless communication.As the number of rounds increases, the average remaining energy of all nodes decreases.Figure 7 depicts the average remaining energy of all nodes.The average remaining power of ICSI is always higher than that of LEACH and FBECS for round intervals of 200, 400, 600, 800, 1000, and 1200.This result reveals that the proposed protocol successfully distributes the power load.Increasing the residual energy of SNs is a consequent result of reducing the power consumption which is needed for communication with the CH.ICSI attempts to conserve power from the first step.Including accurate energy-reducing factors has a significant effect on achieving such results.(2) Average remnant energy In each round, all nodes lose energy for many reasons, including wireless communication.As the number of rounds increases, the average remaining energy of all nodes decreases.Figure 7 depicts the average remaining energy of all nodes.The average remaining power of ICSI is always higher than that of LEACH and FBECS for round intervals of 200, 400, 600, 800, 1000, and 1200.This result reveals that the proposed protocol successfully distributes the power load.Increasing the residual energy of SNs is a consequent result of reducing the power consumption which is needed for communication with the CH.ICSI attempts to conserve power from the first step.Including accurate energy-reducing factors has a significant effect on achieving such results.(3) Successful Packet Delivery The network's throughput is measured by the successful packet delivery to the BS over the rounds and is a direct indicator of collected data from the target area.(3) Successful Packet Delivery The network's throughput is measured by the successful packet delivery to the BS over the rounds and is a direct indicator of collected data from the target area.Figure 8 depicts the packets delivered to the BS.It can be clearly observed that ICSI delivers 44.52% and 16.44% more packets to the BS than LEACH and FBECS, respectively.However, the result shows that the proposed protocol obtains higher network throughput than the other methods due to the optimal selection of CHs.
The simulation results illustrate that ICSI meets the requirements of network survivability.Increasing the throughput is a consequent result of elongating the sensor nodes.In fact, this enhancement in productivity was a chief objective of the current work, and it is a consequent result of extending the lifetime of the SNs specifically.These results confirm the validity of the belief of the authors in the role of the cluster formation step in conserving energy and even in wasting it.This step is ignored by most of the works that try to improve LEACH.
depicts the packets delivered to the BS.It can be clearly observed that ICSI delivers 44.52% and 16.44% more packets to the BS than LEACH and FBECS, respectively.However, the result shows that the proposed protocol obtains higher network throughput than the other methods due to the optimal selection of CHs.The simulation results illustrate that ICSI meets the requirements of network survivability.Increasing the throughput is a consequent result of elongating the sensor nodes.In fact, this enhancement in productivity was a chief objective of the current work, and it is a consequent result of extending the lifetime of the SNs specifically.These results confirm the validity of the belief of the authors in the role of the cluster formation step in conserving energy and even in wasting it.This step is ignored by most of the works that try to improve LEACH.

Conclusions
Aiming at addressing the three mentioned limitations of the existing cluster formation step of the LEACH protocol, ICSI is introduced as an enhanced version of the cluster formation step of LEACH.It successfully allocates SNs to the best cluster using all factors that affect the power consumption.Additionally, ICSI considers the adequacy of the residual energy of the SN compared to the required transmission energy as a key factor in allocating each node to a suitable cluster.Finally, ICSI successfully adjusts the sizes of clusters according to the residual energy of the CH and lowers the NPF.The simulation results show that ICSI succeeds in improving the formation of clusters and communication within clusters.The great advantages of ICSI are observed through the increased number of surviving nodes, increased residual energy of nodes, and higher network lifetime.
In fact, LEACH, as a WSN-based IoT application, is highly exposed to various kinds of serious attacks of malicious nodes.For example, these nodes act to dissipate the energy of the WSN as they hamper the data transmission by releasing a lot of false information to raise the rate of receiving packets, reducing the routing performance.Blockchain is a reliable, distributed, self-organizing ledger with cryptographic hash link that can inherently provide trusted security in such distributed systems.The authors are motivated to improve the tolerance of LEACH.Their future work will explore the ability to use blockchain to enhance the security of LEACH while reducing energy consumption.

Conclusions
Aiming at addressing the three mentioned limitations of the existing cluster formation step of the LEACH protocol, ICSI is introduced as an enhanced version of the cluster formation step of LEACH.It successfully allocates SNs to the best cluster using all factors that affect the power consumption.Additionally, ICSI considers the adequacy of the residual energy of the SN compared to the required transmission energy as a key factor in allocating each node to a suitable cluster.Finally, ICSI successfully adjusts the sizes of clusters according to the residual energy of the CH and lowers the NPF.The simulation results show that ICSI succeeds in improving the formation of clusters and communication within clusters.The great advantages of ICSI are observed through the increased number of surviving nodes, increased residual energy of nodes, and higher network lifetime.
In fact, LEACH, as a WSN-based IoT application, is highly exposed to various kinds of serious attacks of malicious nodes.For example, these nodes act to dissipate the energy of the WSN as they hamper the data transmission by releasing a lot of false information to raise the rate of receiving packets, reducing the routing performance.Blockchain is a reliable, distributed, self-organizing ledger with cryptographic hash link that can inherently provide trusted security in such distributed systems.The authors are motivated to improve the tolerance of LEACH.Their future work will explore the ability to use blockchain to enhance the security of LEACH while reducing energy consumption.

Figure 5 .
Figure 5.Comparison of the network lifetime (number of live nodes).

Figure 5 .
Figure 5.Comparison of the network lifetime (number of live nodes).

Figure 7 .
Figure 7.Comparison of the network survivability (remaining energy).

Figure 7 .
Figure 7.Comparison of the network survivability (remaining energy).

Figure 8 .
Figure 8. Comparing the total data transmitted in the network.

Figure 8 .
Figure 8. Comparing the total data transmitted in the network.

Table 1 .
Summary of optimization methods used to enhance LEACH.