## 4 An Energy-Balanced Protocol Based on the Improved CFSFDP
### Proposed CFSFDP-E Algorithm
We define a variable \(\omega\) called density-energy which can be calculated as follows:  
\[\omega_{i}(r)=\rho_{i}(r)E_{i}(r)\quad i\in I \tag{12}\]  
Sort \(\omega\) value in descending order in Table 2. However, the distance of each node is the same with Table 1, which is still determined by its local density according to Equation (4). Suppose that the nodes with largest \(\gamma\) value are node \(c\) and node \(b\), then according to the descending order of \(\omega\), we need to discuss about the class of node \(f\). The class of node \(f\) should be the same as node \(e\). But the node \(e\) hasn't been allocated to any cluster, resulting in the class of node \(f\) can't be determined, either. From the analysis above, we can know that CFSFDP-E needs to multiply residual energy into the expression of \(\gamma\) as Equation (11). The allocation of non-CHs should base on the order of density-energy instead of the local density in CFSFDP algorithm. Besides, the value of distance should also be determined by density-energy \(\omega\) in order to allocate all the nodes correctly. Therefore, the expression of distance should be revised to:  
\[\delta_{i}=\left\{ \begin{array}{cc}\max\bigl{(}d_{ij}\bigr{)}&if\ \omega_{i}=\omega_{\max}\\ \min\limits_{j\omega_{i}>\omega_{i}}(d_{ij})&if\ \omega_{i}\
eq\omega_{\max} \end{array} \right. \tag{13}\]  
Table 3 shows the value of distance according to the \(\omega\). The maximum \(\omega\) is \(\omega_{c}\). The farthest distance from node \(c\) is node \(b\), that is, \(\delta_{c}\) is \(d_{cb}\). Other \(\delta\) values can be calculated through Equation (13). The cluster heads are still node \(c\) and node \(b\), so other unclassed nodes can be allocated into clusters according to the descending order of density-energy \(\omega\). For example, the distance of node \(f\) is \(d_{fc}\) \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Nodes** & \(\mathbf{a}\) & \(\mathbf{b}\) & \(\mathbf{c}\) & \(\mathbf{d}\) & \(\mathbf{e}\) & \(\mathbf{f}\) \\ \hline \(\mathbf{\rho}\) **(DESC)** & \(\rho_{a}\) & \(\rho_{b}\) & \(\rho_{c}\) & \(\rho_{d}\) & \(\rho_{e}\) & \(\rho_{f}\) \\ \(\delta\) & \(d_{af}\) & \(d_{ba}\) & \(d_{ca}\) & \(d_{da}\) & \(d_{cc}\) & \(d_{fe}\) \\
**Class** & **1** & **1** & **2** & **1** & **2** & **2** \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The local density and distance of six nodes. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Nodes** & \(\mathbf{c}\) & \(\mathbf{f}\) & \(\mathbf{b}\) & \(\mathbf{d}\) & \(\mathbf{e}\) & \(\mathbf{a}\) \\ \hline \(\mathbf{\omega}\) **(DESC)** & \(\omega_{c}\) & \(\omega_{f}\) & \(\omega_{b}\) & \(\omega_{d}\) & \(\omega_{e}\) & \(\omega_{a}\) \\ \(\delta\) & \(d_{ca}\) & \(d_{fe}\) & \(d_{ca}\) & \(d_{da}\) & \(d_{cc}\) & \(d_{af}\) \\
**Class** & **1** & **?** & **2** & \(\backslash\) & \(\backslash\) &? \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The density-energy and distance (determined by local density) of six nodes. which means the nearest node to node \(f\) in other nodes that have a higher density-energy is node \(c\). Hence the class of node \(f\) is 1, the same as that of node \(c\). Similarly, the class of node \(d,e,a\) is 2, 1, 2.