# Energy-Efficient Opportunistic Routing Algorithm for Post-Disaster Mine Internet of Things Networks
## 4 Proposed DEOR Algorithm
### Selection of Relay Node  
In this section, the proposed relay node selection method based on routing quality is described in detail. In opportunistic routing, the relay node is the ultimate node responsible for packet forwarding, so the selection of relay nodes will directly affect the performance of data transmission in the post-disaster Mine Internet of Things (MIoT). After the candidate forwarding set is determined, we need to further optimize the forwarding strategy with the goal of selecting the optimal forwarder as the next-hop relay node. Based on the system model shown in Figure 2, aiming to reduce the energy consumption for data transmission in the post-disaster MIoT, an energy-efficient routing path should be selected from the source to the sink [38]. Here, we design a routing quality evaluation function in the proposed DEOR algorithm for forwarders that considers three factors, including direction angle, transmission distance, and residual energy of nodes. The smaller the directional angle attribute value of the current forwarder, the closer the forwarder is to the sink and the lower the transmission energy consumption of sensor nodes. The larger the relative distance attribute value between the sender and forwarder, the farther the transmission distance of the current forwarder is within the same communication range, which shortens the total routing path for packet forwarding and thus reduces the transmission energy consumption of the post-disaster network. In this article, the schematic diagram of the directional angle and transmission distance between the sender \(n_{i}\) and forwarder \(n_{j}\) is shown in Figure 4. Then, nodes in the CFS are prioritized based on the routing quality value. After the forwarder's coordination, the node with the highest priority is selected as the relay to forward packets, and other nodes in the CFS will drop packets after listening for a successful transmission message. As shown in Figure 4a, the directional angle attribute of the node is considered in this paper to give higher priority to forwarders closer to the sink. The direction angle \(\theta_{i,j}\) between the sender \(n_{i}\) and the neighbor \(n_{j}\) towards the sink is expressed by Formula (10), where \(\overrightarrow{a}=(x_{j}-x_{i},y_{j}-y_{i})\) and \(\overrightarrow{c}=(x_{\text{sink}}-x_{i},y_{\text{sink}}-y_{i})\). Figure 4a shows that the smaller the direction angle \(\theta_{i,j}\) between the sender \(n_{i}\) and its neighbor \(n_{j}\) is, the closer the neighbor \(n_{j}\) is to the sink, where it can provide lower energy consumption for packet forwarding. To avoid the situation where \(\theta_{i,j}=0\), the \(\theta_{i,j}\) is normalized into \(\overline{\theta}_{i,j}\) by Formula (11), where \(1\leq\overline{\theta}_{i,j}\leq 2\). Then, the distribution of the direction angle \(\overline{\theta}_{i,j}\) is obtained by using the mass function expressed as Formula (12). \[\theta_{i,j}=\arccos\frac{\overrightarrow{a}\cdot\overrightarrow{c}}{ \left|\overrightarrow{a}\right|\left|\cdot\right|\left|\overrightarrow{c} \right|} \tag{10}\]  
\[\overline{\theta}_{i,j}=\frac{3-\theta_{i,j}}{2} \tag{11}\]  
\[\overline{\theta}_{i,j}=\frac{e^{-(\overline{\theta}_{i,j})^{\alpha_{\theta}} }}{\sum_{k=0}^{c_{i}}e^{-(\overline{\theta}_{i,k})^{\alpha_{\theta}}}} \tag{12}\]  
where \(c_{i}\) is the number of nodes in \(C(i)\), \(\left\{n_{j},n_{k}\right\}\in C(i)\), and \(\alpha_{\theta}(\alpha_{\theta}\geq 0)\) is the control parameter of the direction angle factor. Note that a larger \(\alpha_{\theta}\) indicates the greater probability distribution for forwarders that are closer to the sink to be selected as relay nodes. As shown in Figure 4b, the transmission distance attribute of nodes is considered in our work to give higher priority to forwarders that are further away from the sender.