# A Failure Risk-Aware Multi-Hop Routing Protocol in LPWANs Using Deep Q-Network
## 4 System Models
### Routing Failure Risk Value  
To reduce transmission disruption probability, ENs with higher Routing Failure Risk Value (RFRV) are deprioritized in FRDR. The effectiveness of this approach is demonstrated in Figure 1.  
**Definition 1**. : _For a given EN, its neighboring ENs are all ENs located within its maximum direct communication range._  
Generally, neighborhood state characteristics, including the number of neighbors \(N_{n}\), the residual energy level of neighbors \(E_{n}\), and link quality \(LQ\), are jointly considered when evaluating RFRV. An EN with lower \(N_{n}\), \(E_{n}\), and \(LQ\) is associated with a higher RFRV. For \(EN_{i}\), \(RFRV_{i}\) can be computed via Equations (4)-(6). \[RFRV_{i}=\lambda_{1}\widetilde{N}_{n}^{i}+\lambda_{2}\widetilde{LQ}_{i}+ \lambda_{3}\widetilde{E}_{n}^{i}, \tag{4}\]\[LQ_{i}=\sqrt{\frac{\overline{RSSI_{i}}-RSSI_{th}}{RSSI_{th}}\cdot\frac{\overline{ SNR_{i}}-SNR_{th}}{SNR_{th}}}, \tag{5}\]  
\[E_{n}^{i}=\overline{e_{res}^{n}(i)}/e_{init}, \tag{6}\]  
\[\widetilde{x}=(x-x_{\min})/(x_{\max}-x_{\min}), \tag{7}\]  
where \(\overline{RSSI_{i}}\) and \(\overline{SNR_{i}}\) denote the average received signal strength indicator (RSSI) and signal-to-noise ratio (SNR) at \(EN_{i}\) from signals transmitted by its neighbors, while \(RSSI_{th}\) and \(SNR_{th}\) are the corresponding thresholds. \(\overline{e_{res}^{n}(i)}\) indicates the average residual energy of neighbors, while \(e_{init}\) is the initial energy. To eliminate dimensional differences among heterogeneous indicators, \(N_{n}\), \(E_{n}\), and \(LQ\) are standardized by the min-max normalization, as defined in Equation (7). The weights \(\lambda_{i}(i=1,2,3)\) in Equation (4) are determined using the Analytical Hierarchy Process (AHP) [23]. Benefiting from its capability in establishing quantitative frameworks for complex and ambiguous decision-making problems, as well as systematically relating criterion weights to overarching objectives, AHP is widely adopted for deriving criterion weights in multi-criteria decision analysis [24]. The AHP process begins by constructing a pairwise comparison matrix \(A\) for decision criteria, as defined in Equation (8). \[A=\left(a_{ij}\right)_{k\times k}=\left[ \begin{matrix}1&a_{12}&\dots&a_{1k}\\ a_{21}&1&\dots&a_{2k}\\ \vdots&\vdots&\vdots&\vdots\\ a_{k1}&a_{k2}&\dots&1\end{matrix} \right], \tag{8}\]  
where each element \(a_{ij}\) denotes the relative importance of the criterion associated with row index \(i\) compared to the criterion related to the column index \(j\). When constructing \(A\), a 1-9 scale [25] is widely adopted to quantify the relative importance between each pair of criteria. This well-known AHP scale is shown in Table 1.  
The weight vector \(w\) is then derived by solving the characteristic equation:  
\[Aw=\lambda_{\max}w, \tag{9}\]  
where \(\lambda_{\max}\) is the largest eigenvalue of the pairwise comparison matrix \(A\). Since \(w\) represents unnormalized priorities, the final criteria weights \(w_{i}^{\prime}\) are obtained through normalization:  
\[w_{i}^{\prime}=w_{i}/\sum_{j=1}^{k}w_{j}, \tag{10}\]  
where \(k\) is the order of \(A\) (i.e., the number of criteria). Figure 1: Routing diagram with and without RFRV. Since pairwise comparisons in AHP are heavily dependent on human judgment, they are susceptible to inconsistencies. To address this issue, a standard procedure is provided in [26] to check for the consistency of the pairwise comparison matrix by utilizing the largest eigenvalue \(\lambda_{\text{max}}\). The deviation of \(\lambda_{\text{max}}\) from the matrix dimension \(k\) is quantified by the Consistency Index (CI):  
\[CI=\frac{\lambda_{\text{max}}-k}{k-1}, \tag{11}\]  
To benchmark CI, Random CI (RI) is also proposed in [26] (Table 2), which is derived from randomly generated reciprocal matrices of various dimensions. The Consistency Ratio (CR) is then calculated as follows:  
\[CR=\frac{CI}{RI}, \tag{12}\]  
According to the established threshold [27], \(CR\leq 0.1\) indicates that the results are satisfactory.