# A Routing Protocol for Multisink Wireless Sensor Networks in Underground Coalmine Tunnels
## 4 Design of PCEB-MS Protocol
### DPCA Algorithm  
According to the power control model, the control problem of the transmission power is converted to the control problem of the communication radius, and the following theorem is obtained. **Theorem 1**. : _Two sinks (S1 and S2) are deployed in a rectangular area, P, with a size of a \(\times\) b, and in the central line of the rectangular area. It is necessary for the wireless range circling the two sinks to intersect outside of the area \(P\) to guarantee sink coverage in the network. In addition, the rectangular top point corresponding to the sink location needs to be within the wireless range of the sink. Here we use \(R_{S1}\) to represent the wireless range of S1 and \(R_{S2}\) to represent the wireless range of S2._  
Proof. : Two sinks are distributed in the \(ABCD\) rectangle area with a size of \(a\times b\) (Figure 3). The two circling sink wireless ranges intersect at \(E\) and \(F\). The following relation thus needs to be met to ensure network coverage:  
\[(AEFB\cup EDCF)\supseteq ABCD. \tag{5}\]  
Accordingly, \(EF\) is the connecting line between the two intersecting points of two circles. This line intersects with line \(AD\) of the rectangle at \(E^{\prime}\). \(F^{\prime}\) intersects with line \(BC\) of the rectangle. Therefore, \(EF\geq E^{\prime}F^{\prime}\) needs to be met to satisfy Equation (5), and it is necessary for the two circling wireless ranges of the sink to intersect outside region P.  
If we suppose that the rectangular vertices corresponding to sink \(S2\) are not inside its wireless range (Figure 2), the rectangular vertices are then extended to \(D^{\prime}\) and \(C^{\prime}\), and rectangle \(ABC^{\prime}D^{\prime}\) intersects with the wireless range circle \(S2\) at \(H\), \(H^{\prime}\), \(G\), and \(G^{\prime}\). However, the range covered by the circling wireless range of the two sinks does not cover the entire rectangular \(ABC^{\prime}D^{\prime}\) area,  
\[(AEFB\cup EHGF\cup HH^{\prime}GG^{\prime})\subset ABC^{\prime}D^{\prime}. \tag{6}\]  
As Equation (6) does not meet the requirements of Equation (5), the rectangular vertices corresponding to the sink need to be located in the wireless range of the sink to ensure network coverage. \(\square\)  
According to Theorem 1, the wireless ranges of \(R_{S1}\) and \(R_{S2}\) should meet the following formula,  
\[\left\{ \begin{array}{l}\left(x_{s1}-x\right)^{2}+\left(y_{s1}-y\right)^{2}= R_{s1}^{2}\\ \left(x_{s2}-x\right)^{2}+\left(y_{s2}-y\right)^{2}=R_{s2}^{2}\end{array} \right., \tag{7}\]  
where \((x,y)\) refers to any sensor node in the sink communication range, and \((x_{s1},y_{s1})\) and \((x_{s2},y_{s2})\) refer to the coordinates of the two sink nodes. The transmission power of each sink is minimized to ensure network coverage. Function \(f\) is defined as follows:  
Figure 3: WSN with two sinks. \[ \begin{array}{l}f=\min\sum\limits_{i=1}^{2}\ R_{si}^{2}\\ s.t.\\ \left(x_{s1}-x_{A}\right)^{2}+\left(y_{s1}-y_{A}\right)^{2}\leq R_{s1}^{2}\\ \left(x_{s2}-x_{C}\right)^{2}+\left(y_{s2}-y_{C}\right)^{2}\leq R_{s2}^{2}\\ x_{E}>0,x_{F}<a\\ y_{E}\geq b,y_{F}\leq 0\end{array} , \tag{8}\]  
Here, the two sinks are taken as examples, but the remaining sinks can be deduced using the same method. Handshake data packet needs to be defined to ensure communication between the sink nodes for the DPCA algorithm. This handshake packet includes three data domains (Figure 4), namely, the packet header, sink ID, and sink location information. Among these domains, the sink ID in ascending order is unique in the network. At network initialization, each sink is able to obtain information relating to its adjacent sink by receiving a handshake packet. \(k\) sink nodes are deployed in the network with a size of \(L\times W\), and the coordinates are represented by \(\left(x_{si},y_{si}\right)\), where \(1\leq i\leq k\). \(P(X,Y)\) is set as a rectangular area, where \(X\) is the length of the rectangle and \(Y\) is the width of the rectangle, and \(X>Y\).