Two-Level Clustering Algorithm for Cluster Head Selection in Randomly Deployed Wireless Sensor Networks

: Clustering strategy in wireless sensor networks (WSNs) affects the lifetime, adaptability, and energy productivity of the wireless network system. The low-energy adaptive clustering hierarchy (LEACH) protocol is a convention used to improve the lifetime of WSNs. In this paper, a novel energy-efficient clustering algorithm is proposed, with the aim of improving the energy efficiency of WSNs by reducing and balancing the energy consumptions. The clustering-based convention adjusts the energy utilization by allowing an equal opportunity for each node to turn them into a cluster head (CH). Two-level clustering (TLC) is introduced by adopting LEACH convention where CH selection process undergoes first and second level of clustering to overcome boundary problem in LEACH protocol. The TLC method structures nodes within the scope of the appointed CHs, in order to extend the lifetime of the system. The simulation results show that, in comparison with state-of-the-art methodologies, our proposed method significantly enhanced the system lifetime.


Introduction
With the development of efficient wireless communication and the progress of electronic information technology, wireless sensor networks (WSNs) have widely been used in various fields due to their low cost, miniaturization ability, and multi-functional characteristics [1].Sensor nodes operate with limited computing, storage, and communication capabilities under severe energy constraints and are designed with minimal complexity for large-scale deployment at reduced cost.All of the sensor nodes used in WSNs are small, low-cost, possess good communication capabilities, and are assumed to have similar data processing and routing capabilities.The lifetime of a WSN is defined by either the first node or all system nodes running out of energy.The better energy utilization enhances the lifetime of all of the nodes and results in an energy-efficient WSN.However, key concerns in WSNs have always included energy usage by the sensor nodes.The sensor nodes need to achieve a long life while operating on limited battery reserves.Algorithms should be designed in such a manner that the energy is best utilized by the nodes.
Distributed information processing technologies and wireless communication have enabled the rapid development and deployment of WSNs [2].Recently, research has primarily been concentrated on various routing and clustering techniques [3,4], where the results indicated that clustered networks are energy-efficient and long-lived sensor networks.However, key strategies including clustering methodology, network structure and division, and optimization techniques are still facing significant challenges on enhancing the performance of WSNs.Firstly, clustering should include angular distance that should facilitate optimum reforming cluster centres for efficient utilization of the energy.Secondly, boundary issues should be enhanced while considering network structure and division of WSNs.Finally, an improved optimization strategy is required to balance energy consumption throughout the whole network.
In WSNs, energy is saved by applying different techniques, such as duty cycle scheduling [5], energy-efficient routing [6], node replacement [7], energy replenishment [8], energy balance [9], and energy-efficient medium access control (MAC) [10].The first and most extensively used hierarchical routing protocol is low energy adaptive clustering hierarchy (LEACH) [11,12], which provides data fusion through cluster formation and cluster head (CH) sensor node selection.The selection of CH plays an important role in a wireless network system that oversees data aggregation and transmission.The energy consumed by CH is higher than that in other ordinary nodes.Nodes that decide to be the CH declare their status to the rest of the network based on the received signal strength intensity (RSSI).Each sensor node in LEACH joins the cluster that requires minimal power to connect with the CH.Nodes forward information to the CH, and the CH aggregates and compresses the data and sends it directly to the BS [13].Data aggregation is completed by the CH before it is sent to the BS.After a specific time, the network goes back into the set-up phase and enters another round of CH selection.Reforming in CH selection is crucial to compute the remaining energy of the nodes and distance to BS [14][15][16].The reformist computation for CH selection enhanced energy efficiency over the traditional LEACH protocol by more than 40%.The state-of-the-art LEACH algorithms [17,18] mostly focus on novel routing strategies by avoiding collisions and organizing data transmission.Two-level clustering is introduced in [18] for a water-saving irrigation system based on the ratio of remaining energy and distance to the BS in the local region.However, conventional LEACH algorithms fail to select regular CH due to angular distance estimation and boundary conditions between nodes and CHs.The failure in LEACH adaptations adds an additional cost to the energy consumption of all nodes in the network and the network lifetime.
In this paper, we propose a two-level clustering (TLC) mechanism for LEACH network that provide significant enhancement in WSN energy consumption such that the network lifetime is extended.At first level, the selection of appropriate CHs jointly balanced the energy consumption of all nodes in a uniformly distributed energy region.An algorithm is developed for first-level clustering that selects a node with a higher level of energy, called the CH, as a routing path to transmit the information.In second level, an angular distance estimation mechanism is introduced to minimize the node's data transmission energy consumption in the wireless system network.The paper has following main contributions as follows: • A novel clustering algorithm is introduced in the first level with a grid mechanism followed by CH selection and having a predefined number of CHs.• A CH selection mechanism is developed in the first level based on the minimum average distance between nodes in each cluster while taking into consideration the residual energy level per node.• A distance threshold parameter is introduced in the first level to improve the communication between the nodes to CH and CH to BS. • An angular distance parameter in the second level is introduced CH selection for remaining outside nodes while clustering due to insufficient boundary conditions.• A robust comparison has been demonstrated with three different clustering algorithms (LEACH, I-LEACH, E-LEACH) under different network conditions, and significant performance improvements.
The remainder of the paper is organized as follows.In Section 2, related works in the previous literature are discussed.In Section 3, the TLC model is illustrated with the proposed algorithm and analysis.The simulation performance of the proposed algorithm and its comparison with existing protocols are presented in the Section 4. Finally, Section 5 concludes the paper with a brief summary of the proposed work.

Related Works
As a sensor node's energy is used predominantly for information gathering and transmission [19], the conventional steering technique considers how to move information from the source node to the BS as quickly as possible using the most limited resources.Nevertheless, in the energy-compelled sensor organization, much information is sent from source nodes to a sink node in a "many-to-one" mode, which effectively presents a genuine funnel effect and energy hole issues.Therefore, the energy utilization of nodes situated around a BS is much higher than in others, bringing about energy lop-sidedness and a lower network lifetime.Some customary strategies diminish the network's transmission distance and energy utilization, subsequently enhancing the general lifetime of the system [20,21].Neighbor nodes with the least utlization hop from source to sink as the handover, utilizing the leftover energy of the node as the determinant [20].A ladder diffusion algorithm is developed based on ant colony optimization (ACO) to address the issue of energy utilization [21].This method primarily utilizes the ACO component to decide the transmitting paths, which adequately diminishes energy utilization.An energy efficient TLC algorithm for WSNs is presented in [22].Cluster relay node is introduced which acts as a backup for CH.This node is selected according to the minimum distance between the nodes in the cluster and the sink while considering the residual energy.The least hop-dependent calculations are comparable to the base energy direction [23].This type of strategy can lessen the energy utilization of the network, but with clear inconveniences for few nodes that attempt information transmission in a specific timeframe while different nodes are inactive.In other words, when the sending node is picked, the leftover energy is ignored which can easily lead to a few nodes running out of energy, thus causing lop-sided energy conveyance between nodes.In this manner, the network lifetime is consistently at a lower level.A multiobjective particle swarm optimization with Levy distribution (MOPSO-L) is presented for organizing the clusters [24].In every round of information exchange, the best of each local solution is assigned as a global optimal solution which acts as a CH.
In any case, without limiting the energy utilization of the network, energy losses may occur due to diversions.Thus, as expected, a few calculation techniques can limit the energy use while guaranteeing the energy equilibrium of nodes [25,26].ACOHCM, proposed by [25], utilizes the upsides of the ACO and the minimum hop directing system to adequately diminish the network energy utilization.ESRA, proposed by [27], develops a base energy-use tree and uses a cut-edge technique to adjust the load between nodes, and successfully expanding the network lifetime.However, the computational intricacy and overhead generated by the two calculations are enormous and consume many assets in practical applications.Therefore, considering only single steering data or utilizing a basic numerical model for directing choices is irrational.As such, it is vital to thoroughly consider the different network properties.The key idea of [28] is to preferentially rank nodes which have better energy efficiency.Nodes at a large distance from the CH will consume higher energy compared with nodes nearer to CH.The distance of a node to its CH is also taken into account along with energy parameter to select the optimal forwarder.
The original LEACH activity is isolated into rounds.Each round starts with a setup phase, when the clusters are coordinated, followed by a steady-state stage, where information is moved from the sensor nodes to the BS.The set-up stage is split into advertisement, cluster set-up, and schedule creation phases.In the set-up stage, an arbitrary number between 0 and 1 is chosen for each node n.When a selected node is presenting less than a threshold T(n), the node becomes the fortunate CH for the current round.Mathematically, T(n) is expressed as follows: where p is the percentage of CHs in all network systems, r is the chosen round number, mod r, 1 p represents the quantity of selected CHs before the current round, and G is the collection of sensor nodes that have not been chosen as the CH previously.At r = 0, the chance that every node becomes CH is p.If any node becomes the CH in the r-th round, it will not be reappointed as CH in any round, all nodes have a possibility p of becoming a CH again [12].The length of r is chosen prior, with each node being expected to perform a CH task once during its lifetime.Hence, CH selection process is repeating round by round until getting a minimum energy consumption.
For the choice of the CH, a reformist calculation has been proposed [14][15][16].In [14], reforming in CH selection process for LEACH is introduced by incorporating the remaining energy of the nodes and the distance to the BS.The enhanced protocol ensures that a node with a higher residual energy has a higher probability of becoming CH.Nodes close to BS are more likely to be selected as CHs since the protocol minimizes the energy required for data transmission.Similarly, CH selection is reformed for LEACH based on minimum distance to the BS by targeting the inefficiency in [15].
These methodologies separate nodes into clusters with a CH that is similar with the original LEACH protocol.Toward the start of each round, every node not previously picked as a CH settles on a free choice through a randomized calculation of whether to expect a CH task.Nodes that decide to be a CH declare their status to the remainder of the network system.The distance between CHs can be obtained from the ad message that CHs send to all nodes in the network [29].Afterward, each node makes a list of the chosen CHs and picks the CH with the lowest distance.The assessment for determining the CH involves the residual energy and distance.The CH is turned on in each round by processing both assessment boundaries.
LEACH-E is an improved version of LEACH that computes the choice variable (d ij ), which is the decision value of node i for CH j, as follows: where the sensitivity parameter, α = ∆E avg ∆S avg , is the ratio between the average residual energy and the average distance from each node to the CH within the same cluster.Furthermore, s ij is the estimated distance between node i and CH j, E i is the initial energy for node i, E m is the remaining energy of CH j, and (E i − E m ) is defined as the first-order difference in the consumed energy.The calculation in [25] has some improvement over LEACH-E, in terms of average delay and number of alive nodes.Each round starts with the remaining energy of every neighbor in its group range for every node.
I-LEACH is an improved version of LEACH that select CH regarding the residual energy, the number of adjoining nodes, and the node's position with respect to the BS.This method of selection of CH in I-LEACH has a deformity, which prompts an extreme CH determination that clusters a non-uniform number of nodes and, thus, a non-uniform energy level in the network at the same time.The choice variable (d ij ) is determined as follows: where α = ∆E avg and β = ∆S avg .The fundamental disadvantage of LEACH is that every node is assumed to be communicate with sufficient ability to arrive at the BS, if necessary, and that every node has computational ability to facilitate distinctive MAC conventions.Even though the LEACH-E and LEACH-I have advantages over LEACH, in terms of prolonging the network's lifetime, they have energy hole and long distance problems, respectively.The calculation of d ij in LEACH-E only involves nodal distance and residual energy, which can lead to energy hole issues when subjected to a greater round of information exchange.On the other hand, the calculation of d ij in I-LEACH and its derived algorithm [30], when evaluated for randomly deployed sensor nodes and a BS located far from the network system, and with a high numerical value of r, degrades the network performance.
Two-level CH selection for LEACH is introduced [18].Novel level CHs were selected from two-level CH based on the highest ratio of remaining energy to distance to the base station.Data was aggregated and transmitted from nodes to two-level CHs, from two-level CHs to level CHs, and ultimately to the BS.However, modern LEACHs are still having difficulty handling outside nodes while clustering due to inefficient boundary conditions.A distance threshold in first-level clustering and angular distance estimation in second-level clustering are very useful for selecting CHs and exploring boundary conditions.Hence, in this paper, we propose a novel dynamic routing TLC algorithm that uses angular distance estimation and reliable boundary conditions to ensure a higher energy efficiency among the sensor nodes in WSN.

Proposed Algorithm and Analysis
The relationship between the initial energy of each node, E N , and the total energy of the whole system, E T , expressed as The threshold distance to distinguish free space (FS) transmission from multi-path (MP) transmission is given by the following formulae: The total energy required to transmit s bits of information over a distance d is given as follows: In addition, energy required to receive s bits of information is given as follows:

First-Level Clustering: Uniform Energy Region
To begin with, network was partitioned into little working region known as grid (matrix) and the number of nodes residing in each grid is calculated as shown in the Figure 1.The quantity of sensor nodes dwelling in each matrix was noted.The grid space was concatenated with the adjoining matrix until the number of grids (G) and the expected number of grids (p) were equivalent.The number of CHs (p) to be elected is known in prior.Number of grids solely depends upon the desired number of p.The first phase network system is divided into p 2 number of girds.Figure 1 shows the grid network that consist of 100 number of nodes randomly scattered over the area 100 * 100 square units.The location of each node is acknowledged by BS (150, 50) upon deployment.
Let count ci denotes the number of nodes present in the ith grid, then we combine the adjacent grid until the following is true: Equation ( 8) eliminates the probability of a node joining a cluster with a large number of nodes at any given number of r of information exchange.Due to the variation in number of nodes, concatenating the grid satisfied results in lowering the overhead for the CHs in adjacent cluster.Grid concatenating process of cluster formation maintains homogeneity in the whole network system.The number of nodes in a particular cluster is already known.
The distance between these nodes within a cluster (d N ) ci and distance between each node of the cluster and BS (d BS ) ci are calculated using the Euclidean matrix.From each cluster, a node (N)i is elected as CH which satisfy the following condition: Node (N) i which acts as an initial CH is discovered based on distance where energy level of each node is same upon the deployment.In such an incident, the proposed algorithm selects the node that satisfies the concluding fitness function {(d BS ) ci }, as energy is utilized more while transmitting data characterized by Equation ( 6).The selection of CH undergoes two rounds in the system.In the first round, CH selection based on LEACH convention.After the first round in the system, the remaining energy in the nodes (E N ) rem and energy of the whole system (E T ) rem are calculated as follows: While transmitting data to the CH, ordinary nodes lose energy.The remaining energy of each node is calculated using Equation (10).CH, which receives these data, also drops energy.The term p * E rx is used to calculate this drop energy where p being the number of CHs.For the data summation purpose, CH uses its energy.Since CH is aggregating data and at the same time receiving data, the last term p * (E DA + E rx ) in Equation (11)  computes the total data dissipating by the CH nodes.
In the second round, the assortment of CH can be established by updating Equation (5) as follows: Telecom 2024, 5 528 CHs from this round are the function of both distance and remaining energy.CH will have a minimum distance with other nodes and bear a maximum energy level.In the second round, the energy burned through in the first round by each sensor node was accounted for.When CH is not elected, the system forces the sensors to perform direct transmission to BS, which consumes more energy, which will never be the case in this algorithm.
When the first round is completed based on the ascending number of nodes count, then the minimum value of the (d N ) ci node is computed by comparing it with the (d N ) c(i+j) node.Here, subscript j denotes the node, which is already in the same cluster as the i node.Similarly, the minimum value of (d N ) c(i−j) is calculated if first-level clustering is performed based on a descending number of nodes count.The value of j changes from two to p or from p to two if the i-th node is considered at position 1.These newly formed clusters with newly appointed CHs now transmit data to the BS.An identical strategy is applied when calculating the values of (d BS ) ci and (E i ) rem .Figure 2 shows the flow chart of the proposed TLC method including two rounds of CHs selection.
() =  ( )  {( ) CHs from this round are the function of both distance and remaining energy.CH have a minimum distance with other nodes and bear a maximum energy level.In the ond round, the energy burned through in the first round by each sensor node wa counted for.When CH is not elected, the system forces the sensors to perform direct t mission to BS, which consumes more energy, which will never be the case in this rithm.
When the first round is completed based on the ascending number of nodes co then the minimum value of the ( ) node is computed by comparing it with ( ) ( ) node.Here, subscript j denotes the node, which is already in the same clust the i node.Similarly, the minimum value of ( ) ( ) is calculated if first-level cluste is performed based on a descending number of nodes count.The value of j changes two to p or from p to two if the i-th node is considered at position 1.These newly for clusters with newly appointed CHs now transmit data to the BS.An identical strate applied when calculating the values of ( ) and ( ) . Figure 2 shows the flow of the proposed TLC method including two rounds of CHs selection.

Second-Level Clustering: Angular Distance Estimation
An angle θ between BS and node is introduced in second-level clustering to further enhance clustered network efficiency.Figure 3 shows ten randomly deployed sensor nodes and their corresponding location and angles with BS.To show how the value of θ (0 ≤ θ ≥ π/2, as all the nodes are assumed to be in the first quadrant) alters the network performance, three CHs, N 2 , N 3 , and N 8 , are formed according to the criteria defined in Equation (12).The rest of the sensor nodes are represented as the ordinary nodes.
The ordinary node N 7 is located in the outer range of CH nodes N 3 and N 8 .N 7 computes the energy needed to send its data to BS via any CH present in the network.The previously formed cluster by N 8 is suitable to join, as the distance is only 4.1 units.However, it chooses a CH with the following condition: In Equation ( 13), nodal distance ((d N ) ci ), distance with BS ((d BS ) ci ), and θ computed at the very beginning and remains the same until the very end.After some rounds of information exchange, the network starts showing heterogeneous characteristics, i.e., the energy level of each node is different; this is due to the position of some nodes being farther or nearer to CH.Hence, it is necessary to define a boundary condition in addition to the remaining energy and the nearest distance.For some nodes like N 7 which is yet to be included to any cluster, makes decision on its projection angle with BS.The number of rounds r for a sensor node in the boundary is defined as follows: r plays a vital role in determining the efficiency of the network.A network system that transmits data to BS for a greater number of r is energy efficient.We calculate the values of E rounds and compare these values to different algorithms to find the network efficiency.The value of r is set from 200 to 2000 for our simulation to calculate different network metrics.

Second-Level Clustering: Angular Distance Estimation
An angle ϴ between BS and node is introduced in second-level clustering to further enhance clustered network efficiency.Figure 3 shows ten randomly deployed sensor nodes and their corresponding location and angles with BS.To show how the value of ϴ (0 ≤ ϴ ≥ π/2, as all the nodes are assumed to be in the first quadrant) alters the network performance, three CHs, N2, N3, and N8, are formed according to the criteria defined in Equation (12).The rest of the sensor nodes are represented as the ordinary nodes.The ordinary node N7 is located in the outer range of CH nodes N3 and N8.N7 computes the energy needed to send its data to BS via any CH present in the network.The previously formed cluster by N8 is suitable to join, as the distance is only 4.1 units.However, it chooses a CH with the following condition: In Equation ( 13), nodal distance ((d ) ), distance with BS ((d ) ), and ϴ computed at the very beginning and remains the same until the very end.After some rounds of information exchange, the network starts showing heterogeneous characteristics, i.e., the energy level of each node is different; this is due to the position of some nodes being farther or nearer to CH.Hence, it is necessary to define a boundary condition in addition to the remaining energy and the nearest distance.For some nodes like N7 which is yet to be included to any cluster, makes decision on its projection angle with BS.The number of

CH Selection Using Two-Level Clustering (TLC)
The sensor node with the least normal distance within the wide range of various nodes was chosen as the first CH for that network in the first round of information transmission.In the second round, the energy used by each sensor node in the first round was accounted for, and the grid development measure was re-hashed.Nodes that were chosen as the CH in the second round as a function of: (1) minimum average distance from the other nodes within the cluster; (2) least normal separation from the BS; (3) most extreme normal leftover energy; and (4) the direction of data transmission towards the BS.
Algorithm 1 demonstrates the proposed algorithm for selecting appropriate CHs to communicate with BS.The first-level clustering is initially performed by combining the adjacent grid in either an ascending or descending number of nodes count granted by Equation ( 4).The subscript i denotes the current node competing to become CH.There are four criteria for a node to become CH: viz.nodal distance, remaining energy, distance with BS, and projection angle (θ).Among these four criteria, distance with BS ((d BS ) ci ), nodal distance ((d N ) ci ), and θ, are computed at the very beginning and remain the same until the very end.Furthermore, remaining energy ((E i ) rem ) costs relatively more than the calculation of (d BS ) ci , (d N ) ci , and θ.The accumulated cost by (E i ) rem is a key factor in determining the efficiency of the network.

Simulation Results
The proposed algorithm was verified through many simulations in MATLAB, and was compared with two multi-attribute algorithms: I-LEACH and LEACH-E.With the intention of escaping the likelihood of the experimental results, different numbers of sensor nodes were randomly distributed with different network sizes.The precise simulation boundaries are shown in Table 1.In this model, both the multi-path fading and the free-space channel models were considered [28,29].The data trade strategy between nodes was as described in [31]; that is, every node had a unique identifier (ID), and keeps a buffer to store data, such as the leftover energy, packet ID, sender's IDs, and so on.These data are refreshed continuously as the forward neighbor changes.
Figure 4 shows the extra energy levels of 100 sensor nodes after 200 rounds.Each sensor node is initialised with an energy of 0.5 J.The energy burned through for every sensor node is distinct in various calculations.Sub-plot (1,1) shows the remaining energy of 100 nodes, which ranged from −0.28 J to 0.45 J.When a node uses more energy than the pre-assigned one, it is considered a "Dead Node".Sub-plots (1,2), (2,1), and (2,2) show the lingering energy of 100 nodes under various calculation methods.The quantities of nodes beneath the energy level of 0.0 J in these sub-plots are high.This indicates that the numbers of dead nodes in the methods presented in the previous literature were greater than that when using the proposed method.Parcel size s 4000 bits Figure 4 shows the extra energy levels of 100 sensor nodes after 200 rounds.Each sensor node is initialised with an energy of 0.5 J.The energy burned through for every sensor node is distinct in various calculations.Sub-plot (1,1) shows the remaining energy of 100 nodes, which ranged from −0.28 J to 0.45 J.When a node uses more energy than the pre-assigned one, it is considered a "Dead Node".Sub-plots (1,2), (2,1), and (2,2) show the lingering energy of 100 nodes under various calculation methods.The quantities of nodes beneath the energy level of 0.0 J in these sub-plots are high.This indicates that the numbers of dead nodes in the methods presented in the previous literature were greater than that when using the proposed method.Figure 5 shows the number of CHs in different algorithms.Despite the statement p = 0.1% of the total nodes, non-uniform CHs were formed when using LEACH-E and I-LEACH.This problem arises when a node cannot join any clusters, due to its remoteness, despite having sufficient energy.In this condition, these nodes assign themselves as CHs, resulting in an inhomogeneous network system.This problem can be solved by enlarging the boundary conditions given by Equation (12).The result shown in the TLC section of Figure 5 indicates that appropriate numbers of CHs were formed in each round, making it easier for nodes to transfer data to the BS through these CHs. Figure 5 shows the number of CHs in different algorithms.Despite the statement p = 0.1% of the total nodes, non-uniform CHs were formed when using LEACH-E and I-LEACH.This problem arises when a node cannot join any clusters, due to its remoteness, despite having sufficient energy.In this condition, these nodes assign themselves as CHs, resulting in an inhomogeneous network system.This problem can be solved by enlarging the boundary conditions given by Equation (12).The result shown in the TLC section of Figure 5 indicates that appropriate numbers of CHs were formed in each round, making it easier for nodes to transfer data to the BS through these CHs.
Figure 6 shows the leftover energy of the entire network system when 100 nodes were exposed to 1000 rounds.The beginning energy of the framework was 0.25 * 100 J = 25 J.A network that operates for a more prominent number of rounds uses more energy; hence, the leftover energy of the system was low.After information transmission for a number of rounds (200 to 1000), the proposed calculation tended to have better remaining energy.Accordingly, its predominance was increased, regardless of the number of rounds in the TLC calculation.Figure 6 shows the leftover energy of the entire network system when 100 nodes were exposed to 1000 rounds.The beginning energy of the framework was 0.25 * 100 J = 25 J.A network that operates for a more prominent number of rounds uses more energy; hence, the leftover energy of the system was low.After information transmission for a number of rounds (200 to 1000), the proposed calculation tended to have better remaining energy.Accordingly, its predominance was increased, regardless of the number of rounds in the TLC calculation.The effectiveness of a network system relies on the number of alive nodes.Nodes with remaining pre-defined energy partake in information transmission to the BS.Figures 7a, 7b, and 7c show the number of dead nodes after 200 rounds, 500 rounds, and 1000 rounds of information transmission to the BS, separately.Upon detailed examination, after 200 rounds, execution of the system using TLC was expanded by 9.72% compared to I-LEACH, 16.52% compared to LEACH-E, and 195.95% compared to LEACH.Similar augmentations in system execution were seen after 500 rounds (50.5%, 98.34%, and 123.57%, respectively) and 1000 rounds (92.34%, 95.1%, and 97%, respectively).Figure 6 shows the leftover energy of the entire network system when 100 nodes were exposed to 1000 rounds.The beginning energy of the framework was 0.25 * 100 J = 25 J.A network that operates for a more prominent number of rounds uses more energy; hence, the leftover energy of the system was low.After information transmission for a number of rounds (200 to 1000), the proposed calculation tended to have better remaining energy.Accordingly, its predominance was increased, regardless of the number of rounds in the TLC calculation.The effectiveness of a network system relies on the number of alive nodes.Nodes with remaining pre-defined energy partake in information transmission to the BS.Figures 7a, 7b, and 7c show the number of dead nodes after 200 rounds, 500 rounds, and 1000 rounds of information transmission to the BS, separately.Upon detailed examination, after 200 rounds, execution of the system using TLC was expanded by 9.72% compared to I-LEACH, 16.52% compared to LEACH-E, and 195.95% compared to LEACH.Similar augmentations in system execution were seen after 500 rounds (50.5%, 98.34%, and 123.57%, respectively) and 1000 rounds (92.34%, 95.1%, and 97%, respectively).The effectiveness of a network system relies on the number of alive nodes.Nodes with remaining pre-defined energy partake in information transmission to the BS.Figures 7a, 7b and 7c show the number of dead nodes after 200 rounds, 500 rounds, and 1000 rounds of information transmission to the BS, separately.Upon detailed examination, after 200 rounds, execution of the system using TLC was expanded by 9.72% compared to I-LEACH, 16.52% compared to LEACH-E, and 195.95% compared to LEACH.Similar augmentations in system execution were seen after 500 rounds (50.5%, 98.34%, and 123.57%, respectively) and 1000 rounds (92.34%, 95.1%, and 97%, respectively).
The results in Figure 8a show a comparison of the number of stable and die operational sensor nodes between DTC-BR [17], MCCA [17], and the proposed algorithm based on several rounds.The number of die nodes in our method was only about 20% within 1000 rounds which is significantly lower as compared to DTC-BR and MCCA.Furthermore, the network lifetime of the proposed method in terms of throughput is compared with the existing heterogeneous routing method [18].The throughput of the proposed method was demonstrated 10% higher with 5000 rounds.The results in Figure 8a show a comparison of the number of stable and die operational sensor nodes between DTC-BR [17], MCCA [17], and the proposed algorithm based on several rounds.The number of die nodes in our method was only about 20% within 1000 rounds which is significantly lower as compared to DTC-BR and MCCA.Furthermore, the network lifetime of the proposed method in terms of throughput is compared with the existing heterogeneous routing method [18].The throughput of the proposed method was demonstrated 10% higher with 5000 rounds.

Discussion
A novel clustering approach for CH selection in LEACH is introduced for identifying energy-efficient algorithms and presenting simulation results demonstrating the effectiveness of the proposed approach.

•
With a predefined number of CHs, a distance threshold-based clustering algorithm was developed in the first level that has a minimum average distance in terms of  The results in Figure 8a show a comparison of the number of stable and die operational sensor nodes between DTC-BR [17], MCCA [17], and the proposed algorithm based on several rounds.The number of die nodes in our method was only about 20% within 1000 rounds which is significantly lower as compared to DTC-BR and MCCA.Furthermore, the network lifetime of the proposed method in terms of throughput is compared with the existing heterogeneous routing method [18].The throughput of the proposed method was demonstrated 10% higher with 5000 rounds.

Discussion
A novel clustering approach for CH selection in LEACH is introduced for identifying energy-efficient algorithms and presenting simulation results demonstrating the effectiveness of the proposed approach.

•
With a predefined number of CHs, a distance threshold-based clustering algorithm was developed in the first level that has a minimum average distance in terms of

Discussion
A novel clustering approach for CH selection in LEACH is introduced for identifying energy-efficient algorithms and presenting simulation results demonstrating the effectiveness of the proposed approach.
• With a predefined number of CHs, a distance threshold-based clustering algorithm was developed in the first level that has a minimum average distance in terms of residual energy level per node.Also, the distance threshold supported communication between nodes to CH and CH to BS. • The homogeneity in the network was maintained by grid concatenating of cluster formation.Although the position of residual nodes was changing frequently, the defined boundary conditions based on angular distances covered all the nodes within the network.
• The second-level CH selection within clusters added additional computational complexity to the linear but remained within \(O(N \cdot k)\) due to the quadratic term within each cluster.The other parameters including initialization of the cluster, CH selection process, and broadcasting steps were also linearly complex computations.
This complexity indicates that the algorithm scales linearly with the number of nodes and the average number of nodes per cluster, making it efficient for large networks with well-distributed clusters.
In conclusion, the performance of the LEACH algorithm is enhanced by introducing angular distance estimation and boundary conditions while selecting CHs in a randomly deployed WSN network.

Conclusions
Effective ways to boost the performance of a WSN include smooth data aggregation and the proper choice of CHs.The difficulties related to selecting a randomly deployed distant sensor node as a CH in data transmission are addressed by selecting appropriate CHs based on node energy.To select an adequate CH in the network for data aggregation, TLC strategies were proposed that solved existing LEACH boundary issues.In first-level clustering, the node density problem in a particular network region, which can lead to the draining of node energy, was solved by creating a uniform energy region.In the secondlevel clustering, angular distance estimation was introduced to overcome the heterogeneous characteristics of nodes and support the CHs selection.The energy level in each node remains higher while working with TLC, and thus, dead nodes within the network were significantly reduced.As a result, the simulation results demonstrated that WSN efficiency was considerably enhanced and distant BS issues were remarkably minimized.Hence, the proposed TLC method for CH selection in randomly deployed WSN is effective for distant BS problems and efficient data transmission.
In this paper, we used a fixed clustering approach that may not perfectly cover dynamic network changes, potential energy imbalance among frequently acting CHs, and scalability challenges in large networks.Additionally, issues related to interference, collisions, and the environmental impact on performance are not thoroughly addressed, and the algorithm assumes static nodes, limiting its applicability in mobile scenarios.Future research should focus on developing dynamic clustering algorithms, integrating energy harvesting techniques, and enhancing scalability to ensure efficient operation in larger networks.Further exploration into interference management, environmental adaptability, and support for mobile nodes will broaden the algorithm's applicability.Incorporating multi-hop routing within the TLC framework and conducting real-world implementation and testing will provide valuable insights and validate the algorithm's practical effectiveness, ultimately leading to a more robust and efficient solution for wireless sensor network applications.
This enhances the chances of different sensor nodes becoming CHs.After the 1 p th

Figure 1 .
Figure 1.Deciding the number of nodes in the specified grid (Matrix).Blue diamond symbol indicates the number of nodes in each grid.

Figure 2 .
Figure 2. Flowchart showing the working mechanism of the proposed TLC.

Figure 2 .
Figure 2. Flowchart showing the working mechanism of the proposed TLC.

Figure 3 .
Figure 3. Distribution of random nodes (10) and corresponding angles with BS.

Figure 3 .
Figure 3. Distribution of random nodes (10) and corresponding angles with BS.

Figure 4 .
Figure 4.The residual energy distribution of every sensor node toward the end of 200 rounds of information exchange in various algorithms cited in the literature, compared to the proposed method.

Figure 4 .
Figure 4.The residual energy distribution of every sensor node toward the end of 200 rounds of information exchange in various algorithms cited in the literature, compared to the proposed method.

Figure 5 .
Figure 5. Distribution of CHs in various algorithms cited in the literature, compared to the proposed method.

Figure 6 .
Figure 6.Residual energy distribution of the network system toward the end of 1000 rounds of information exchange in various algorithms cited in the literature, compared to the proposed method.

Figure 5 .
Figure 5. Distribution of CHs in various algorithms cited in the literature, compared to the proposed method.

Figure 5 .
Figure 5. Distribution of CHs in various algorithms cited in the literature, compared to the proposed method.

Figure 6 .
Figure 6.Residual energy distribution of the network system toward the end of 1000 rounds of information exchange in various algorithms cited in the literature, compared to the proposed method.

Figure 6 .
Figure 6.Residual energy distribution of the network system toward the end of 1000 rounds of information exchange in various algorithms cited in the literature, compared to the proposed method.

Figure 7 .
Figure 7.The number of dead nodes after different numbers of information exchange rounds: (a) 200 rounds; (b) 500 rounds; and (c) 1000 rounds.

Figure 8 .
Figure 8. Performance comparison between proposed and existing state-of-the-art method: (a) network lifetime; and (b) network throughput.

Figure 7 .
Figure 7.The number of dead nodes after different numbers of information exchange rounds: (a) 200 rounds; (b) 500 rounds; and (c) 1000 rounds.

Figure 7 .
Figure 7.The number of dead nodes after different numbers of information exchange rounds: (a) 200 rounds; (b) 500 rounds; and (c) 1000 rounds.

Figure 8 .
Figure 8. Performance comparison between proposed and existing state-of-the-art method: (a) network lifetime; and (b) network throughput.

Figure 8 .
Figure 8. Performance comparison between proposed and existing state-of-the-art method: (a) network lifetime; and (b) network throughput.