## 3 Proposed Algorithm and Analysis
### 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. Figure 3: Distribution of random nodes (10) and corresponding angles with BS. 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 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. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameters** & **Abbreviations** & **Values** \\ \hline Initial energy & E\({}_{\text{IN}}\) & 0.5 J \\ Transmission energy & E\({}_{\text{IN}}\) & \(5\times 10^{-7}\) J \\ Receiving energy & E\({}_{\text{Er}}\) & \(10^{-7}\) J \\ Data aggregation energy & E\({}_{\text{DA}}\) & \(5\times 10^{-9}\) J/bit/signal \\ Max. number of rounds & R\({}_{\text{MAX}}\) & 200–1000 \\ Free space amplifier & E\({}_{\text{FS}}\) & \(10^{-9}\) J/bit/m\({}^{2}\) \\ Multi-path amplifier & E\({}_{\text{MP}}\) & \(13\times 10^{-11}\) J/bit/m\({}^{4}\) \\ Operating energy & E\({}_{\text{elec}}\) & \(5\times 10^{-8}\) J/bit \\ Parcel size & s & 4000 bits \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Energy consumption model. 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. 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.