# Energy-Efficient Opportunistic Routing Algorithm for Post-Disaster Mine Internet of Things Networks
## 4 Proposed DEOR Algorithm
### Construction of Candidate Forwarding Set
This is because a larger network density \(D\) means more candidate forwarding nodes of \(n_{i}\), leading to an increase in packet replicas in the post-disaster network. To reduce the number of neighbors participating in packet forwarding, the width of the FZ \(w_{i}\) should be reduced. Conversely, the smaller the network density \(D\), the larger the width \(w_{i}\) of the sender \(n_{i}\). This is because the smaller the network density \(D\), the fewer candidate forwarding nodes of \(n_{i}\) there are, leading to a lower packet success delivery rate. Therefore, under the condition of a fixed sensing region, the width of FZ \(w_{i}\) should be increased to improve the probability of packet forwarding by relay routing nodes. The location of the sink is denoted by \((x_{\text{sink}},y_{\text{sink}})\). In the network initialization phase, each node \(n_{i}\) computes the location of the four points of \(F_{i}\) using Formula (5). These four points \((f_{1}\),\(f_{2}\),\(f_{3}\),\(f_{4})\) are attached to the header of packets. Obviously, the number of forwarders can be limited according to the FZ. \[ \begin{array}{l}f_{1}=\left(x_{\text{sink}}+\frac{w_{i}(y_{\text{sink}}-y_{ i})}{2d_{i,\text{sink}}},y_{\text{sink}}+\frac{w_{i}(x_{i}-x_{\text{sink}})}{2d_{i, \text{sink}}}\right)\\ f_{2}=\left(x_{\text{sink}}-\frac{w_{i}(y_{\text{sink}}-y_{i})}{2d_{i,\text{ sink}}},y_{\text{sink}}-\frac{w_{i}(x_{i}-x_{\text{sink}})}{2d_{i,\text{sink}}} \right)\\ f_{3}=\left(x_{i}+\frac{w_{i}(y_{\text{sink}}-y_{i})}{2d_{i,\text{sink}}},y_ {i}+\frac{w_{i}(x_{i}-x_{\text{sink}})}{2d_{i,\text{sink}}}\right)\\ f_{4}=\left(x_{i}-\frac{w_{i}(y_{\text{sink}}-y_{i})}{2d_{i,\text{sink}}},y_ {i}-\frac{w_{i}(x_{i}-x_{\text{sink}})}{2d_{i,\text{sink}}}\right)\end{array}  \tag{5}\]  
We define the neighbor set of \(n_{i}\) within the forwarding zone as \(F_{i}\). In Figure 3, the candidate zone (CZ) of each node \(n_{i}\) is defined as the intersection area between the forwarding zone \(F_{i}\) and the communication range of \(n_{i}\). Furthermore, the set of nodes within the CZ is described as  
\[Z_{i}=\left\{n_{j}|n_{j}\in(F_{i}\cap N_{i})\right\} \tag{6}\]  
In practice, due to the harsh underground mine environment after the disaster, there still exists the problem of node failure at any time. Therefore, in order to avoid encountering void routing during packet forwarding, candidate nodes with more neighbor nodes should be selected so that the packet transmission success rate can be improved. In addition, candidate nodes with relatively high residual energy should be selected to balance the node load and extend the network lifetime. Consequently, the node \(n_{j}\) in the CFS of node \(n_{i}\) should satisfy Formulas (7) and (8). \[N(m_{i})=\left\{\{n_{j},n_{v}\}\in N_{i}|m_{j}\geq\frac{\sum_{v}m_{v}}{m_{i}}\right\} \tag{7}\]  
\[N(\varepsilon_{i})=\left\{\{n_{j},n_{v}\}\in N_{i}|\varepsilon_{j}\geq\frac{1 }{2}\frac{\sum_{v}\varepsilon_{v}}{m_{i}}\right\} \tag{8}\]  
where \(m_{j}\) and \(m_{v}\) represent the number of neighbor nodes of \(n_{j}\) and \(n_{v}\), respectively, while \(\varepsilon_{j}\) and \(\varepsilon_{v}\) represent the residual energy of \(n_{j}\) and \(n_{v}\), respectively. As a result, the nodes satisfying Formulas (6)-(8) constitute the candidate forwarding set \(C_{\text{up}}(i)\) of \(n_{i}\) as follows:  
\[C_{\text{up}}(i)=Z_{i}\cap N(m_{i})\cap N(\varepsilon_{i}) \tag{9}\]  
In this article, the constructed candidate forwarding set \(C_{\text{up}}(i)\) restricts the number of forwarders, which contributes to reducing the waiting time of the sender. Moreover, the nodes in \(C_{\text{up}}(i)\) have the characteristics of high energy and more neighboring nodes, which is conducive to improving the network lifetime and data transmission reliability of post-disaster MIoT. The pseudocode of the selection of the candidate forwarding set is shown in Algorithm 1.