## 3 A Resilient Routing Protocol
### Protocol Design
#### 3.1.2 Weight Determination Using AHP  
To objectively evaluate the importance of each mobility-resilient parameter, the AHP is employed. AHP facilitates systematic pairwise comparisons of parameters, enabling the assignment of consistent and reliable weighting factors. These weights reflect the relative significance of each parameter in influencing routing decisions, thereby enhancing the decision-making framework of the routing protocol.  
The process begins by identifying and listing the mobility-resilient parameters that influence routing decisions. In this protocol, the parameters include the number of neighboring nodes (\(N_{i}\)), average connection time (\(T_{i}\)), buffer usage rate (\(U_{i}\)), RSSI fluctuation rate (\(R_{i}\)), and distance to the center (\(D_{i}\)). A pairwise comparison matrix \(A=[a_{ij}]\) is then constructed, where each element \(a_{ij}\) represents the relative importance of parameter \(i\) compared to parameter \(j\). The scale typically ranges from 1 (equally important) to 9 (extremely more important), and the matrix is reciprocal, meaning \(a_{ji}=\frac{1}{a_{ji}}\), with \(a_{ii}=1\) for all \(i\).  
Once the matrix is established, the priority vector \(\mathbf{w}=[w_{1},w_{2},w_{3},w_{4},w_{5}]^{T}\) is derived by normalizing the principal eigenvector of matrix \(A\). This can be approximated using the geometric mean method, where each weight \(w_{i}\) is calculated as follows:  
\[w_{i}=\frac{\frac{\sqrt[5]{a_{i1}\times a_{i2}\times a_{i3}\times a_{i4} \times a_{i5}}}{\sum_{k=1}^{5}\sqrt[5]{\prod_{j=1}^{5}a_{kj}}}}{\text{C}\text{ R}}\]  
To ensure the reliability of the pairwise comparisons, the Consistency Index (CI) and Consistency Ratio (CR) are calculated using the following formulas:  
\[\text{CI}=\frac{\lambda_{\text{max}}-n}{n-1}\]  
\[\text{CR}=\frac{\text{CI}}{\text{RI}}\]  
Here, \(\lambda_{\text{max}}\) is the maximum eigenvalue of matrix \(A\), and RI is the Random CI, which depends on the number of parameters \(n\). A CR of less than 0.1 is generally considered acceptable, indicating that the comparisons are sufficiently consistent.  
For instance, consider five parameters with the following pairwise comparison matrix \(A\):  
\[A=\begin{pmatrix}1&3&5&7&9\\ \frac{1}{3}&1&2&4&6\\ \frac{1}{5}&\frac{1}{2}&1&3&5\\ \frac{1}{2}&\frac{1}{4}&\frac{1}{3}&1&3\\ \frac{1}{3}&\frac{1}{6}&\frac{1}{5}&\frac{1}{3}&1\end{pmatrix}\]  
Using the geometric mean method, the priority vector \(\mathbf{w}\) is calculated as follows:\[w_{1} =\frac{\sqrt[5]{1}\times 3\times 5\times 7\times 9}{\sum_{k=1}^{5} \sqrt[5]{\prod_{j=1}^{5}a_{kj}}}\approx 0.40\] \[w_{2} =\frac{\sqrt[5]{3}\times 1\times 2\times 4\times 6}{\sum_{k=1}^{5} \sqrt[5]{\prod_{j=1}^{5}a_{kj}}}\approx 0.18\] \[w_{3} =\frac{\sqrt[5]{1}\times 1\times 2\times 1\times 3\times 5}{\sum_{k=1}^{5} \sqrt[5]{\prod_{j=1}^{5}a_{kj}}}\approx 0.14\] \[w_{4} =\frac{\sqrt[5]{1}\times 1\times 2\times 1\times 3}{\sum_{k=1}^{5} \sqrt[5]{\prod_{j=1}^{5}a_{kj}}}\approx 0.10\] \[w_{5} =\frac{\sqrt[5]{1}\times 1\times 6\times 1\times 1\times 1}{\sum_{k=1}^{5} \sqrt[5]{\prod_{j=1}^{5}a_{kj}}}\approx 0.18\]  
Subsequently, the CI and CR are calculated to verify the consistency of the pairwise comparisons. Suppose \(\lambda_{\max}=5.1\) and RI for \(n=5\) is 1.12:  
\[\text{CI}=\frac{5.1-5}{5-1}=\frac{0.1}{4}=0.025\]  
\[\text{CR}=\frac{0.025}{1.12}\approx 0.022\quad(\text{which is}<0.1)\]  
Since the CR is less than 0.1, the pairwise comparisons are deemed consistent, and the weights \(\mathbf{w}=[0.40,0.18,0.14,0.10,0.18]^{T}\) are accepted for use in the routing protocol.  
By incorporating these mathematical formulations, the AHP-based weight determination process becomes transparent and quantifiable, enhancing the robustness of the routing protocol's decision-making framework.