## 4 Methods
### Cluster-Head Election Phase
#### 4.2.2 Elect the Vice Cluster-Heads in DCK-LEACH  
Since the cluster-head needs to receive the data from the member nodes in the cluster and communicate with the base station and other cluster-heads, the energy consumption of cluster-heads increases significantly with increasing network scale. To address this problem, our solution, which features direct communication with the base station via the vice cluster-head, is proposed to reduce the energy consumption of the primary cluster-head by the vice cluster-head. When the vice cluster-head is elected in the cluster, we \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Node ID** & \(f_{1}(i)\) & \(f_{2}(i)\) & \(p\)**-Value** \\ \hline
1 & 0.9836 & 0.8627 & 0.9132 \\
2 & 1.0341 & 0.8168 & 0.9255 \\
3 & 0.9807 & 0.7026 & 0.8417 \\
4 & 0.8169 & 0.9837 & 0.9003 \\
5 & 0.7026 & 1.0341 & 0.8684 \\
6 & 1.3911 & 1.0356 & 1.2134 \\
7 & 0.8141 & 0.9807 & 0.8974 \\
8 & 0.7544 & 1.0400 & 0.8676 \\
9 & 1.0504 & 0.8867 & 0.9686 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Comparison of function values of member nodes in the cluster. assume that the distance between the vice cluster-head and the base station is closer than that of the cluster-head to the base station. Member nodes in a cluster will aggregate their local data and send it to the primary cluster-head in that cluster. The primary cluster-head will transmit the data to the vice cluster-head, and the latter will send it to the base station. This solution reduces the transmission energy consumption of cluster-heads. In DCK-LEACH, the vice cluster-heads are selected using a weighted probability. This mainly considers two factors: the distance between the node and the base station, and the residual energy of the node. Firstly, it calculates the adaptive degree function (\(Q\)) in DCK-LEACH by these two factors, and then dynamically adjusts the weight probabilities of the two factors. Finally, the DCK-LEACH algorithm selects the best vice cluster-head with the maximal value of \(Q\). For the first factor, we prefer to choose the node which is as close as possible to the base station among the same cluster, since, as the data transmission distance between nodes increases, the data transmission energy consumption increases exponentially [36]. This will reduce the energy consumption of the vice cluster-head in forwarding packets to the base station. Algorithm 2 in DCK-LEACH for the vice cluster-head election is as follows. ```
Input: all member nodes and their primary cluster-heads within K clusters Output: all vice cluster-heads in the set C2 (1) For each cluster (2) For member nodes in the same cluster except the primary cluster-head (3) Calculate the residual energy objective function \(f_{1}(i)\) and the distance function \(f_{3}(i)\) of each node, respectively (4) If the sum of residual energy of all nodes is greater than half of the initial energy of the network (0.5 * n\(E_{0}\)) (5) Calculate the node adaptation function value according to \(Q(i)=1/2\) *\(f_{1}(i)+\frac{1}{2}\) *\(f_{3}(i)\) (6) Else (7) Calculate the node adaptation function value according to \(Q(i)=\frac{E_{m}(i)}{E_{0}}*f_{1}(i)+(1-\frac{E_{m}(i)}{E_{0}})/2\) *\(f_{3}(i)\) (8) Find the node with the largest fitness function value and save this node in formation in the set C2 (9) End
```
**Algorithm 2**The vice cluster-head election  
An objective function (\(f_{3}\)) is used for selecting the optimal node that is close to the base station. \(f_{3}\) in DCK-LEACH is calculated as shown in Equation (11):  
\[f_{3}(i)=\frac{\frac{1}{n}\sum\limits_{i=1}^{n}d_{tobes}(i)}{d_{tobes}(i)} \tag{11}\]  
where, \(d_{tobes}(i)\) is the distance from node \(i\) to the base station. Equation (11) indicates that when the node is closer to the base station, the larger the value of \(f_{3}\), the higher the chance of becoming a vice cluster-head. For the second factor, we prefer to select the node with the largest possible residual energy among the same cluster.