## 4 EMTARP: System Model and Protocol Description
### Operation of EMTARP
#### 4.3.1 Description of Calculating Routing Cost  
The following example illustrates the procedures for calculating routing cost as well as the next hop decision making process using the AHP and SAW method. As we described before, we first need to determine the pairwise comparison matrix to calculate the weights of each metric. The pairwise comparison matrix used in this example is given as  
\[ \begin{array}{cccc}&H&Temp&Link\\ H&\begin{pmatrix}1&1/3&1/2\\ 3&1&2\\ 2&1/2&1\end{pmatrix}\\ \end{array}  \tag{6}\]  
After the pairwise comparison matrix is determined, the next step is to compute the priority vector, which is the normalized eigen vector of the matrix. In order to obtain an eigen vector, we need to normalize the pairwise comparison matrix as follows [18],  
\[\overline{C_{ij}}=\frac{C_{ij}}{\sum_{i=1}^{n}C_{ij}} \tag{7}\]  
The eigen vector of decision factor \(i\) is obtained as [18],  
\[v_{i}=\frac{\sum_{j=1}^{n}\overline{C_{ij}}}{n} \tag{8}\]  
where \(v_{i}\) is the priority vector of decision factor \(i\). Equation (9) shows the result of calculations. The result column indicates the priority vector of each decision factor. As shown in Equation (9), the priority vector of \(Temp\) is the highest. This means decision factor \(Temp\) performs a major role in the multi-criteria decision making process. \[ \begin{array}{cccc}&H&Temp&Link&Result\\ H&\begin{pmatrix}1&1/3&1/2\\ 3&1&2\\ 2&1/2&1\end{pmatrix}&\begin{pmatrix}0.164\\ 0.539\\ 0.297\end{pmatrix}\\ \end{array}  \tag{9}\]  
However, the pairwise comparison matrix may not be consistent because it is determined by the decision maker's judgments. Thus, Ratio Consistency (\(CR\)) is a parameter used for checking whether the pairwise comparison matrix is determined properly or not. The \(CR\) is obtained as [18],  
\[CR=\frac{CI}{RI} \tag{10}\]  
where \(RI\) is the random index proposed by Oakridge laboratory and these values are shown in Table 4. \(CI\) is the consistency index; this value is calculated as [18],  
\[CI=\frac{\lambda_{max}-n}{n-1} \tag{11}\]  
where  
\[\lambda_{max}=\sum_{j=1}^{n}(v_{j}*\sum_{i=1}^{n}X_{ij}) \tag{12}\]The \(CR\leq 0.1\) indicates that the pairwise comparison matrix is consistent. Otherwise, the decision maker must re-define the pairwise comparison matrix. In this example, we give more relative importance to \(temp\) metric than other metrics because the main objective of the proposed protocol is to prevent the temperature rise of the node. The \(link\) metric is considered as the second important criteria while the \(H\) metric is the least important criteria. Note that, the eigen vector denotes the weight of criteria so the sum of eigen vectors must be 1.0. Once the weights of the metrics are calculated, the next step is to normalize the actual value using the SAW method. The neighbor table used in this example is given below in Table 5.  
In the given neighbor table, we have to evaluate whether the metrics should be minimized or maximized to get a high rating. In the proposed protocol, both \(H\) metric and \(Temp\) metric should be minimized according to Equation (2), and the \(Link\) should be maximized according to Equation (3). Table 6 shows the results of normalization. Once the normalization of each value is finished, the next step is to construct a weighted normalized decision matrix. The weighted normalized value is obtained as,  
\[W_{ij}=e_{ij}*v_{i} \tag{13}\]  
where \(W_{ij}\) denotes the weighted normalized value. The \(e_{ij}\) denotes the normalized value of each alternative and the \(v_{i}\) is the weight of criteria \(i\) as shown in Equation (9). Table 7 shows the weighted normalized decision matrix. \begin{table}
\begin{tabular}{c c c c} \hline \hline \(Id\) & \(H\) & \(Temp\) & \(Link\) \\ \hline N1 & 0.500 & 0.901 & 0.600 \\ N2 & 1 & 0.635 & 0.400 \\ N3 & 0.666 & 1 & 0.500 \\ N4 & 0.500 & 0.730 & 1.000 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Normalized decision matrix.