# A Routing Protocol for Multisink Wireless Sensor Networks in Underground Coalmine Tunnels
## 4 Design of PCEB-MS Protocol
### DPCA Algorithm
\(Cir(x_{si},y_{si},r_{si})\) is a circular region with \(\left(x_{si},y_{si}\right)\) as the center and \(r_{si}\) as the radius. The following then needs to be met to ensure 100% network coverage,  
\[P\left(X,Y\right)\subset Cir\left(x_{1},y_{1},r_{1}\right)\cup Cir\left(x_{2},y_{2},r_{2}\right)\cup\ldots\cup Cir\left(x_{k},y_{k},r_{k}\right). \tag{9}\]  
It is necessary for each sink to have appropriate transmission power after negotiation to ensure that each sink reaches 100% network coverage after transmission power control. Equation (4) indicates that the transmission power is calculated after obtaining the communication radius of each sink. Therefore, calculation of transmission power is converted to the solution of the communication radius. In this respect, each sink firstly obtains its own coordinate information using the UWB technology. A handshake packet and a PCM message are then broadcasted to the neighboring sink. The distance between the sink with the minimum sink ID and the corresponding top of the rectangular area are regarded as the wireless range. There are four intersection points between the wireless range circle and the rectangular boundary of this sink (S1 in Figure 3). The other sinks also have four intersection points, if an appropriate wireless range is selected (S2 in Figure 3). After the wireless range is determined, each sink then sends a sink ID message to all the sensor nodes in its coverage. Moreover, this sink ID message is used in the clustering algorithm. For the overlapping region with two sinks, the sensor node will obtain two sink IDs, and these sensor nodes then select the closest sink and transmit the data to the sink directly. In this study, it is considered that the sink coverage is guaranteed for the entire network once the union of the cutting line contains four lines of the entire rectangle, and after the circle (with each sink as the center of the circle) and the corresponding wireless range (as the radius) intersect with the rectangle's lines. The wireless range, \(r_{i}\), starting from the second sink, \(i\in k\), must then meet the following relation,  
\[X\subset\left(2x_{1}\right)\cup\sqrt{r_{2}^{2}-\left(x_{2}-2x_{1}\right)^{2} }\cup\ldots\cup\sqrt{r_{i}^{2}-\left(x_{i}-2x_{i-1}\right)^{2}}. \tag{10}\]  
Based on this theory (Figure 5), the following three selections of the sink for the wireless range are found, if three sinks exist in the network: (a) extremely large; (b) suitable; and (c) extremely small. Figure 4: Frame format of a handshake packet in the distributed power control algorithm (DPCA). Calculations are then required for each sink to obtain the most ideal wireless range, and then each sink can select the proper transmission power by automatic adjustment. Figure 6 introduces the calculation process for determining the wireless range. Two sinks are deployed in S1 and S2: the coordinates of S1 are (\(x_{s1}\), \(y_{s1}\)) and those of S2 are (\(x_{s2}\), \(y_{s2}\)). S1 is the first sink with sink ID 1. This sink regards \(\mid\)S1B1\(\mid\) as its wireless range (i.e., \(R_{S1}\)). S2 therefore needs to calculate its wireless range (\(R_{S2}\)) based on R\({}_{S1}\),  
\[R_{S2}=\sqrt{\left(\left(x_{S2}-x_{S1}\right)-\sqrt{R_{S1}^{2}-y_{S1}^{2}} \right)^{2}+y_{S2}^{2}}. \tag{11}\]  
The wireless range \(R_{Si}\) of each sink is then represented by  
\[\left\{ \begin{array}{ll}R_{Si}=\sqrt{x_{Si}{}^{2}+y_{Si}^{2}}&i=1\\ R_{Si}=\sqrt{\left(\left(x_{Si}-x_{S(i-1)}\right)-\sqrt{R_{S(i-1)}^{2}-y_{S(i- 1)}^{2}}\right)^{2}+y_{Si}^{2}}&2\leq i\leq k\end{array} \right.. \tag{12}\]  
The UCEBA proposed in this paper is used for clustering after the transmission power of each sink has been adjusted. After clustering has been completed, the sensor nodes in each cluster initiate a one hop communication with the cluster head in the same cluster. Finally, the cluster head sends data to the sink using the one hop communication, thereby ensuring that the data are rapidly and stably transmitted to the sink from the sensor node.