# A Cluster-Based Dual-Adaptive Topology Control Approach in Wireless Sensor Networks
## 3 The Improved Clustering Scheme
### Cluster Formation
#### 3.2.1 Neighborhood Discovery  
Unlike the CMIMO in which a predefined clustering range is used in neighborhood discovery, each node employs its maximum transmission power to discover its neighbors in our scheme. Moreover, each node will obtain its neighbors' approximate maximum transmission ranges and their identifiers. To achieve the above goal, the format of the hello message is defined as follows: \([ID_{t},e_{t},p_{t,max},d_{t,max},\)\(L_{t,nei}\)=\(\{\dots,(ID_{i},d_{i}),\dots\}]\), where \(ID_{t}\) denotes the identifier of transmitting node \(t\); \(e_{t}\), \(p_{t,max}\), and \(d_{t,max}\) are the Remaining Battery Lifetime (RBL), maximum transmission power, and approximate maximum transmission range of transmitting node \(t\) respectively; \(L_{t,nei}\) denotes the list of known neighbors (i.e., the nodes from which the transmitting node \(t\) has received the hello messages). Each entry in \(L_{t,nei}\) is a tuple with the two elements (i.e., the identifier (e.g., \(ID_{i}\)), and the distance (e.g., \(d_{i,t}\)) from a neighbor (e.g., node \(i\) ) to itself (e.g., node \(t\))). Once receiving the hello message, a receiving node can measure its receiving power and thus estimate the distance between it and the transmitting node according to the wireless propagation model (e.g., the Equation (2) or Equation (3) in the following text). In our scheme, for simplicity and without the loss of generality, we only consider the two widely used wireless propagation models, namely the free space model and the two-ray ground model [29]. According to the literature [29], the crossover distance is formulated as follows:  
\[d_{\textit{crossover}}=\frac{4\pi\sqrt{L}{h_{t}}{h_{r}}}{\lambda} \tag{1}\]  
In Equation (1), \(h_{t}\) and \(h_{r}\) are the height of the transmitting and receiving antenna above ground respectively; \(\lambda\) is the wavelength of the carrier signal; and \(L\) is the system loss factor not related to propagation. According to the relation of crossover distance \(d_{\textit{crossover}}\) and the distance between communicating nodes, one of the two propagation models is chosen. For any link \(i\)\(\rightarrow\)\(j\), the free space model is adopted when \(d_{i,j}\) (i.e., the distance between node \(i\) and \(j\)) is less than \(d_{\textit{crossover}}\), and thus the wireless propagation formula is as follows:  
\[p_{i,j}^{r}=\frac{p_{i,j}^{t}\cdot G_{t}\cdot G_{r}\cdot\lambda^{2}}{\left(4 \pi\right)^{2}\cdot\left(d_{i,j}\right)^{2}\cdot L} \tag{2}\]  
If \(d_{i,j}\) is not less than \(d_{\textit{crossover}}\), the two-ray ground model is adopted and the corresponding formula is as follows:  
\[p_{i,j}^{r}=\frac{p_{i,j}^{t}\cdot G_{t}\cdot G_{r}\cdot{h_{t}}^{2}\cdot{h_{r }}^{2}}{\left(d_{i,j}\right)^{4}} \tag{3}\]  
In Equations (2) and (3), \(p^{t}_{i,j}\) and \(p^{r}_{i,j}\) are the transmission power of node \(i\) and the receiving power of node \(j\) respectively when node \(i\) sends packets to node \(j\); \(G_{t}\) and \(G_{r}\) are the gains of the transmittingand receiving antenna respectively. Therefore, according to the Equations (2) and (3), the calculating formula for the transmission range from node \(i\) to \(j\) is easily derived as follows:  
\[d_{i,j}=\left\{ \begin{array}{ll}\sqrt{\frac{p_{i,j}^{T}\cdot G_{i}\cdot G_{j} \cdot k^{2}}{(4\pi)^{2}\cdot p_{i,j}^{T}L}}&d_{i,j}<d_{crossover}\\ \sqrt{\frac{p_{i,j}^{T}\cdot G_{i}\cdot G_{i}\cdot h_{j}\cdot h_{j}\cdot h_{j} }{p_{i,j}^{T}}}&d_{i,j}\geq d_{crossover}\end{array} \right. \tag{4}\]  
Our neighborhood discovery process is described in Algorithm 1. ```
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 variables (e.g., \(L_{u,nei}=\phi\); \(d_{u,max}=0\); \(N=0\))
2. Use a CSMA/CA scheme to contend for the channel
3.if succeed in accessing the channel then
4. Send [\(ID_{u}\), \(e_{u}\), \(p_{u,max}\), \(d_{u,max}\), \(L_{u,nei}\)] at the maximum transmission power \(p_{u,max}\)
5.