# A Comprehensive Evaluation Algorithm of Multi-Point Relay Based on Link-State Awareness for UANETs
## 3 Proposed Algorithm
### Evaluation Algorithm of TOPSIS-MPR  
Leveraging the valuable information extracted from received HELLO and TC packets, nodes within the network compute key evaluation metrics such as LD, SDL, ANSCR, LL, and LNS. In most cases, there is no neighbor node whose various indicators are superior to others, so it is necessary to weigh multiple indicators and select the best MPR nodes from the neighbor set. * Construct the original evaluation matrix \(M\). With \(n\) neighbors of a node in the network as the evaluation objects, we select the LD, SDL, ANSCR, LL, and LNS of neighbors as evaluation metrics. The original evaluation matrix \(M_{n\times 5}\) is constructed as follows:  
\[M_{n\times 5}=\left[d_{ij}\right]_{n\times 5}= \begin{bmatrix}LD_{1}SDL_{1}ANSCR_{1} LL_{1}LNS_{1}\\ LD_{2}SDL_{2}ANSCR_{2}LL_{2}LNS_{2}\\ \vdots\vdots\vdots\vdots\vdots\vdots\vdots\vdots\\ LD_{n}SDL_{n}ANSCR_{n}LL_{n}LNS_{n}\end{bmatrix} _{n\times 5} \tag{12}\]
* Construct the standardized matrix \(N\). Since the dimensions and attribute types of each evaluation metric vary, direct comparison of the original data is not feasible. To calculate and compare various evaluation metrics, it is necessary to normalize the original evaluation matrix to obtain a standardized evaluation matrix. Parameter types can be broadly categorized into benefit-type and cost-type. Benefit-type parameters have values that are better when they are larger, while cost-type parameters have values that are better when they are smaller. In the original evaluation matrix \(M_{n\times 5}\), LD and SDL belong to the benefit type parameters, while ANSCR, LL, and LNS belong to the cost type parameters. After normalization, the standardized evaluation matrix \(N_{n\times 5}\) is obtained as follows:  
\[N_{n\times 5}=\left[nd_{ij}\right]_{n\times 5} \tag{13}\]  
\[nd_{ij}=\left\{ \begin{array}{l}\frac{d_{ij}-\min\limits_{1\leq i\leq n}\{d_ {ij}\}}{\max\limits_{1\leq i\leq n}\{d_{ij}-\min\limits_{1\leq i\leq n}\{d_{ ij}\}}},j\in\{LD,SDL\}\\ \frac{\max\limits_{1\leq i\leq n}\{d_{ij}\}-d_{ij}}{\max\limits_{1\leq i\leq n }\{d_{ij}\}-\min\limits_{1\leq i\leq n}\{d_{ij}\}},j\in\{ANSCR,LL,LNS\}\end{array} \right. \tag{14}\]
* Construct the weight matrix \(W\). The entropy weighting method is employed to construct the weight matrix \(W\). This is an objective weighting method that eliminates subjectivity and obtains high-precision weights. The core of this method is to associate the entropy value of evaluation indicators with the weight value. The more scattered the data, the greater the difference, and the smaller the entropy value, which means that the indicator carries more discriminative information and the weight of the indicator is greater. The weight matrix \(W_{1\times 5}\) constructed by the entropy weight method is as follows:  
\[\left\{ \begin{array}{l}p_{ij}=\frac{nd_{ij}}{\sum\limits_{i=1}^{5}nd_{ij}}\\ E_{j}=-\frac{1}{\ln(n)}\sum\limits_{i=1}^{n}p_{ij}\ln(p_{ij})\end{array} ,j=\{1,2,\cdots,5\}\right. \tag{15}\]  
\[W_{1\times 5}=\left[w_{j}\right]_{1\times 5}w_{j}=\frac{1-E_{j}}{5-\sum\limits_{k =1}^{5}E_{k}},j=\{1,2,\cdots,5\} \tag{16}\]* Construct the weighted evaluation matrix \(R\). By using the weight matrix \(W_{1\times 5}\) and the standardized evaluation matrix \(N_{n\times 5}\), we obtain the weighted evaluation matrix \(R_{n\times 5}\) as follows: \[R_{n\times 5}=\left[r_{ij}\right]_{n\times 5},r_{ij}=w_{j}\cdot nd_{ij},i=\{1,2, \cdots,n\},j=\{1,2,\cdots,5\}\] (17)
* Determine the theoretical optimal solution \(O^{+}\) and the worst-case solution \(O^{-}\). \[\left\{ \begin{array}{l}O_{j}^{+}=\underset{1\leq i\leq n}{max}r_{ij}\\ O_{j}^{-}=\underset{1\leq i\leq n}{min}r_{ij}\end{array} ,j=\{1,2,\cdots,5\}\right.\] (18)
* Calculate the proximity factor matrix \(C\). Based on the Euclidean distance formula, we separately calculate the distance between each evaluation object and the theoretical optimal solution and the theoretical worst solution.