## 4 The Proposed Algorithm-TCEB
### Inter-Cluster Topology Construction  
The inter-cluster topology construction is the final process to connect all of the parts (i.e., clusters) as a tree for further communication requirement. It actually is how to build the communication link between the clusters and the sink. That is the construction of the global network if the intra-cluster topology construction can be regarded as the local network formation. Consequently, in this section, we need to find a way to rapidly build the path from the cluster-head to the sink. Specially, the cluster-head which is far away from the sink should be give more care, because it cannot directly communicate with the sink by one-hop transmission. It must rely on another cluster-head that is closer to the sink by multiple-hop communication to complete the task of data transmission. When the inter-cluster topology is tried to build, it begins from the sink. Initially, the sink broadcasts the HELLO message to the monitoring area as its minimum transmission power, and then gradually increases until its maximum transmission power or the communication radius can reach over the entire monitoring region. As shown in Figure 2, according to the power level of the sink, it can be recorded as level I, level II, level III, etc. (from low to high), which are corresponding to the different ring monitoring area. If a cluster-head receives the HELLO message within one of the broadcast ranges corresponding to a power level of the sink, then it records its current power level. Once the grading is completed, the cluster-head with the lowest power level of the sink (e.g., the area in which the power level I is located in Figure 2) first starts to establish the communication relationship with the sink. Then, the cluster-head within power level II is considered to be next task that makes the connection to the sink. Whether it chooses one of the cluster-heads within power level I as the relay node or still keeps directly communicating with the sink depends on the communication cost it spends. The main cost function of communication between the cluster-head \(i\) and the cluster-head \(j\) (may be the sink) is given as:  
\[\cos\t{i,j}=\omega\frac{E_{r}\left(i\right)}{E_{Init}\left(i\right)}+\left(1- \omega\right)\frac{d\left(i,j\right)}{r_{sens}\left(i\right)} \tag{17}\]  
where \(E_{r}(i)\) and \(E_{Init}(i)\) are the residual energy and the initial energy of cluster-head \(i\), respectively; \(d(i,j)\) refers to the distance between cluster-head \(i\) and \(j\); and \(r_{sens}(i)\) is the sensing radius of the cluster-head \(i\). \(\omega\) denotes the adjustment factor, which can adjust the proportion relationship of the residual energy and the communication distance. ```
1:Initialize power level of \(k_{opt}\) cluster-heads \(power[k]\gets 0\)
2:for\(i\gets 1\)to maxPower(sink)do
3:if\(power[k]==0\)&&\(chs_{k}\) receives HELLO from the sink then
4:\(power[k]\gets i\)
5:endif
6:endfor
7:\(k\gets 1\)
8:while\(k\leq k_{opt}\)do
9:if\(power[k]>1\)then
10:\(best\gets cost(k,sink)\)// Initial best cost by Equation (17)
11:\(relay\gets sink\)
12:for\(j\gets 1\)to\(k_{opt}\)do
13:if\(cost(k,j)+cost(j,sink)<best\)then
14:\(best\gets cost(k,j)+cost(j,sink)\)
15:\(relay\gets j\)
16:endif
17:endfor
18:\(comm[chs[k],chs[relay]]\gets 1\)
19:else
20:\(comm[chs[k],sink]\gets 1\)
21:endif
22:\(k\gets k+1\)
23:endwhile
```  
**Algorithm 3** Inter-cluster topology construction  
Figure 2: Divide the hierarchical area with the broadcast radius of the sink. Through Equation (17), we can make a correct decision whether the current cluster-head needs the relay cluster-head to forward the data to the sink. If the cost of the cluster-head spent is indeed less than previous communication way (i.e., directly communicate with the sink) via the relay cluster-head, then it establishes the multi-hop communication between the cluster-head and the sink. In that way, it also enhances the close connection between the different inter-clusters simultaneously.