# A Cluster-Based Dual-Adaptive Topology Control Approach in Wireless Sensor Networks
## 3 The Improved Clustering Scheme
### Cluster Formation
#### 3.2.2 Selecting MCHs  
Unlike the CMIMO in which the selection criterion for MCHs is only the nodes' RBLs, our selection criterion considers both the nodes' RBLs and the nodes' approximate maximum transmission range, which is modeled as the weighted sum of RBL and approximate maximum transmission range, since the two metrics are important for selecting cluster heads. The new selection criterion for MCHs is based on the following formula to compute the MCH eligibility metric of each node (e.g., \(i\)):  
\[MM_{i}=w_{e}\cdot\frac{e_{i}}{e_{ref}}+w_{r}\cdot\frac{d_{i,max}}{d_{ref}} \tag{7}\]  
In Equation (7), \(w_{e}\) and \(w_{r}\) are the weights of energy and range respectively (they are more than 0 but less than 1, and their sum is equal to 1); \(e_{ref}\) is a reference energy and \(d_{ref}\) is a reference distance, which can be determined and issued by the sink, and thus identical for all nodes. Since the metric unit of RBL is different from that of approximate maximum transmission range, we unify their units by using a ratio form. By an appropriate selection of reference values (i.e., \(e_{ref}\) and \(d_{ref}\) ), \(e_{i}/e_{ref}\) and \(d_{i,max}/d_{ref}\) can be controlled in the same order of magnitude. Therefore, a small change of the weight coefficients (i.e., \(w_{e}\) and \(w_{r}\)) can lead to a more obvious change of the weighted sum, and thus increase the sensitivity of adjustment. If we hope that the elected MCH has more residual energy, we should increase the value of \(w_{e}\) and reduce the value of \(w_{r}\) accordingly, and vice versa. If there is no clear requirement, the two weight variables usually take the roughly same values. Our MCH selection process is described in the Algorithm 2. ```
Run at any wireless node (e.g., \(u\))  Input: \(N_{max}\)  Output: The identifiers and approximate maximum transmission ranges of all neighbors
1. Initialize the state variable \(s_{u}\) as \"undecided\"
2.for each entry (\(ID_{v}\), \(d_{v,u}\)) in \(L_{u,nei}\)do initialize the state variable \(s_{v}\) as \"undecided\"
3. Compute node \(u\)'s \(R_{u,intra}\) according to the Formulas (5) and (6)
4. Compute node \(u\)'s MCH eligibility metric \(MM_{u}\) according to the Formula (7)
5. Initialize \(FLAG_{1}\) as \(true\)
6.for each entry (\(ID_{v}\), \(d_{v,u}\)) in \(L_{u,nei}\)do
7.if(\(s_{v}==\)\"undecided\") and (\(d_{v,u}\leq R_{u,intra}\))then
8. Compute node \(v\)'s MCH eligibility metric \(MM_{v}\) according to the Formula (7)
9.if(\(MM_{u}<MM_{v}\)) or (\(MM_{u}==MM_{v}\)&&\(ID_{u}>ID_{v}\))then\(FLAG_{1}\) = false
10.endif
11.endfor
12.if(\(FLAG_{1}==\)\(true\))then
13. Determine itself (i.e., node \(u\)) as the MCH and change the value of \(s_{u}\) as \"decided MCH\" Broadcast the updated \(s_{u}\) to its neighbors to which the distance is not more than \(R_{u,intra}\) from it
14.else
16. Set the timer \(t_{\tau}\) as \(\tau\)
17. Initialize \(FLAG_{2}\) as \(true\)
18.while the timer \(t_{\tau}\) does not expire do
19.if receive a state variable (e.g., \(s_{v}\)) from any node (e.g., \(v\)) then
20.if the received \(s_{v}\) is \"decided MCH\"then
21. Change the value of \(s_{u}\) as \"decided non-MCH\" Broadcast the updated \(s_{u}\) to the neighbors to which the distance is not more than
22.\(R_{u,intra}\) from \(u\)
23.\(FLAG_{2}\) = false
24.else update the initial value of \(s_{v}\) kept in \(u\) as \"decided non-MCH\"
25.endif
26.endif
27.endwhile
28.if(\(FLAG_{2}==\)\(true\))then go to step 5
29.endif
```  
**Algorithm 2** MCH Selection (_MCHS_)  
After the neighborhood discovery is completed, the selection for MCHs starts. Each node (e.g., \(u\)) keeps the latest hello messages of all its 1-hop neighbors (obtained during the neighborhood discovery process). All nodes start the clustering process in the \"undecided\" state. Therefore, for each node (e.g., \(u\)), besides the initialization of its own state variable \(s_{u}\) (see line 1), it also initializes its neighbors' state variables as the \"undecided\" state (see line 2).