## 4 Relay Scheme based on FAHP
### Measurement of Relative Importance
#### 4.2.1 Criterion 1: Distance to the Sink  
With the objective of obtaining the relative importance between two nodes on the Saaty scale, an initial estimation value for the longest possible direct route is marked in Figure 3, which would be that between a node located in the bottom corner opposite to the upper corner in diagonal, where the GW would be located (on the surface). This maximum distance of the direct longest route (no hops, only theoretical) is given by  
\[d_{Max}=\sqrt{\left(a-0\right)^{2}+\left(0-b\right)^{2}+\left(0-c\right)^{2}} =\sqrt{a^{2}+b^{2}+c^{2}} \tag{16}\]  
Of course, there could be longer routes once they are created due to the multiple hops to reach the GW, but this value can be updated as long as it is known by the network (i.e., the route has reached the final node, the GW). The final objective of the comparison now is to set the relative importance between two nodes for constructing the pairwise matrix that is necessary to apply FAHP among the alternatives (not between every pair of criteria, which has been set by \(T^{k}\) in (8)). In Figure 4, we introduce a situation to introduce the problem of comparing the relative importance of distance to the gateway node. We have two nodes \(A\) and \(B\) with different distances \(d_{A}\) and \(d_{B}\), respectively. Additionally, we can assume two restrictions in the deployment zone: a minimum (\(d_{min}\)) and maximum (\(d_{max}\)) distance (to the gateway) that a node can have. The problem is determining how to grade the importance on the Saaty scale proposed (a value in the range [1; 9]) when a node is closer to or further from the gateway than another one. Figure 4: Distances (**left**) and constraints (**right**) for applying the distance criterion. Figure 3: Maximum distance in a 3D box. In order to compare how good the distance of node \(A\) to the gateway is compared to that of node \(B\) to the gateway, the difference between the distances can be firstly considered, and then a linear normalization can be used to give a value on the Saaty scale (within [1; 9]). For doing that, we can take into account the limit situations, i.e., the best case and the worst case. Assuming that \(d_{B}>d_{A}\) (\(A\) is closer than \(B\)), both cases are defined by the difference in distances:  
\[(\text{Best case:})\ \ \Delta_{b}=d_{B}-d_{A}\ /\left\{d_{B}=d_{max},\ d_{A}=d_{ min}\right\}=d_{max}-d_{min} \tag{17}\]  
\[(\text{Worst case:})\ \ \Delta_{w}\ =d_{B}-d_{A}/\left\{d_{B}=d_{A}+\delta\ \right\}=\delta \tag{18}\]  
where \(\Delta_{b}\) and \(\Delta_{w}\) stand for the best and worst distance differences, respectively. The parameter \(\delta\) is a threshold defining what is considered the same distance in a practical way. In order to have nine equal space intervals in the domain of difference in distances (\(\delta\), \(\Delta_{b}\)), a new interval \(\Delta_{S,d}\) (\(S\) subindex comes from Saaty) is defined:  
\[\Delta_{S,d}=\frac{d_{max}-d_{min}}{9} \tag{19}\]  
Finally, in order to obtain a single natural value of the importance of \(d_{A}\) vs. \(d_{B}\), it only remains to employ the following expression, where \(\lceil\cdot\rceil\) is the ceil function (round toward positive infinity):  
\[I_{AB}=\left\{ \begin{array}{rcl}&\lceil\frac{d_{B}-d_{A}}{\Delta_{S,d}}\rceil,&\quad if\ d_{B}>d_{A}\\ &1,&\quad if\ |d_{B}-d_{A}|\ \leq\ \delta\end{array} \right. \tag{20}\]  
where \(I_{AB}\) is the importance level for distance criterion on the Saaty scale (see Table 1) of node \(A\) vs. node \(B\). Note that \(I_{AB}\in[1,9]\). In case of \(d_{A}>d_{B}\), the comparison is similar but in the opposite way: it would be the comparison of the \(B\) node with the \(A\) node. In that case, the reciprocal TFN value should be used in the pairwise comparison matrix for node \(A\) vs. node \(B\). As an example, Figure 5 shows the importance level \(I_{AB}\) calculated by (20) for various locations of two nodes \(A\) and \(B\).