## 3 Proposed Model and its Phases
### Cluster-Head Selection Phase (CHSP) in the Second Level Nodes  
At the second level, the distributed clustering technique is applied with \(n\) heterogeneous nodes simultaneously with the centralized cluster head section process in the first level \(m\) homogeneous nodes. The main reason to add heterogeneous nodes is to balance the network lifetime in both regions. In the distributed scheme of cluster heads selection, at the time of network initialization, some preliminary information such as initial energy, residual energy, the nodes' position, and the status of nodes within the whole network is exchanged between all nodes by broadcasting hello packets by gradual increasing the signal strength to detect neighboring nodes for cluster formation. In the second level, two types of nodes are used concerning their residual energy. If \(a\) normal nodes have \(E_{0}\) residual energy and \(b\) advanced nodes have \(\alpha\) additional energy than the normal nodes, then each advanced node has \(E_{0}(1+\alpha)\). At the start of the network, all advanced nodes are deployed with the same energy. Once the network starts collecting and broadcasting information, each node will consume its residual energy according to assigned processes. To find the average residual energy in the second level, we can calculate the total energy of normal and advanced nodes separately. \[E_{nor}=\sum_{i=1}^{a}E_{0} \tag{7}\]  
\[E_{adv}=\sum_{i=1}^{b}E_{0}(1+\alpha_{i}) \tag{8}\]  
The total energy (\(E_{total}\)) in the second level can be find by Equations (7) and (8) as:  
\[E_{total}=E_{nor}+E_{adv} \tag{9}\]  
where \(i\) is the rotating epoch in each time-based round. The average residual energy \(\overline{E}(r)\) in an epoch \(E_{i}\) can be calculated as:  
\[\overline{E}(r)=\frac{1}{n}\sum_{i=1}^{n}E_{i} \tag{10}\]  
If \(P_{opt}\) is the pre-determined number of CHs and \(P_{i}\) is the probability of a node to be selected as a CH in the second-level nodes, then:  
\[P_{i}=P_{opt}\frac{E_{i}}{\overline{E}(r)} \tag{11}\]The threshold \(T\) to select CHs can be calculated as:  
\[T=\left\{ \begin{array}{ll}\frac{P_{nor}}{1-P_{nor}\times(r\times mod \frac{1}{P_{nor}})\times d},&\text{if }n\in G^{\prime}\\ \frac{P_{adv}}{1-P_{adv}\times(r\times mod\frac{1}{P_{adv}})\times d},&\text{if }n\in G^{ \prime\prime}\\ 0,&\text{otherwise}\end{array} \right. \tag{12}\]  
where \(G^{\prime}\) and \(G^{\prime\prime}\) are the sets of eligible normal and advanced-energy nodes in a cluster which can be selected as CHs, \(r\) is the current round, and \(d\) is the distance from the BS, a random number is generated by each node \(s_{i}\). If the value of \(s_{i}\) is less than the threshold value in Equation (12), the node will be selected as CH; otherwise, the node will wait for the hello message from selecting CHs. As the second-level region comprises the heterogeneous nodes of two different residual energy levels, so the desired percentage value of the normal (\(P_{nor}\)) and advanced (\(P_{adv}\)) nodes can be calculated as:  
\[P_{nor}=\frac{P_{opt}}{1+\alpha m} \tag{13}\]  
\[P_{adv}=\frac{P_{opt}(1+\alpha)}{1+\alpha m} \tag{14}\]  
In a similar fashion, the value of \(P_{i}\) can be calculated for two-level heterogeneity as:  
\[P_{i}=\left\{ \begin{array}{ll}\frac{P_{opt}E_{I}(r)}{(1+\alpha m )E(r)},&\text{if node is normal}\\ \frac{P_{opt}(1+\alpha)E_{I}(r)}{(1+\alpha m)E(r)},&\text{if node is Advance} \end{array} \right. \tag{15}\]  
In multilevel heterogeneous networks, the formation of clusters is based on the energy of the nodes. The nodes at a higher level will have more energy than lower-level nodes and are likely to select as a CH.