# Relational Positioning Method for 2D and 3D Ad Hoc Sensor Networks in Industry 4.0
## 3 Relational Positioning Method
### Three-Dimensional (3D) Localization  
In the case of 3D scenarios, the node to be located is meant to be within the 3D convex hull volume \(V\) defined by the ANs. For instance, in the case of four equidistant Ans, the convex hull coincides with a regular tetrahedron, as is illustrated in Figure 5a. As explained before, a discretization of the searching space is conducted with vertices \(\mathbf{v}_{j,k,l}\) in a three-dimensional regular grid with step \(L\). The weight \(w_{j,k,l}\) assignment process is extended to 3D, where (_i,k,l_) stands for the coordinates in the searching space, though it remains based on distance relationships \(\zeta_{i,m}\). As an example, consider the case in which \(n_{0}\) is contained within a regular tetrahedron with \({}_{4}\)C\({}_{2}\) = 6 (where \({}_{4}\)C\({}_{2}\) is the combinatorial coefficient) relative distance comparisons. It is anticipated that performance improvements can be achieved when the number of ANs is increased in the same volume or area as more distance relationships, e.g., \({}_{5}\)C\({}_{2}\), from ANs to \(n_{0}\) can be used. Therefore, we obtain a different weight assignment from that obtained for four ANs in the tetrahedron. As stated before, a discretization process is performed first. Secondly, the weight assignment process is carried out according to distance relationships \(\zeta_{i,m}\). Finally, the searching equation as that shown in (2) can be reformulated based on the distance sets \(\Delta_{i,\,(j,k,l)}\), and \(\delta_{i,(j,k,l)}\), where sub-indices \(1\leq i\leq m\) refer to the corresponding \(AN_{i}\), and (_j,k,l_) refers to the coordinate (\(x\), \(y\), \(z\)) in a tridimensional space. Figure 4: Location entropy for three ANs scenarios using different relational stages. Figure 5: The 3D Scenario for (**a**) four available ANs and (**b**) up to eight available ANs. As stated before, uncertainty reduction helps to decrease the searching space, allowing lower processing time, required processing capacity, and power consumption. The final location will be determined by an optimal searching process over the feasible region \(\mathbf{R}^{*}\)= \(\{\mathbf{v}_{j,k,l}\), \(w_{j,k,l}\
eq 0\}\) where a minimum-error searching equation is formulated as follows:  
\[\min_{j,k,l}[\rho_{j,k,l}^{-1}\sum_{i}|\Delta_{i,(j,k,l)}-\delta_{i,(j,k,l)}|], \tag{2}\]  
where \(\rho_{j,k,l}=w_{j,k,l}/\sum\limits_{j,k,l}w_{j,k,l}\) and \(1\geq i\geq 4\). A vertex \(\mathbf{v}_{j,k,l}\) will be the solution to the localization problem, if such vertex gives the minimum difference between its associated distance set \(\delta_{i,(j,k,l)}\) and the estimated distances from ANs to node \(\mathbf{n}_{0}\), \(\Delta_{i,(j,k,l)}\), multiplied by the inverse of \(\rho_{j,k,l}=w_{j,k,l}/\sum\limits_{j,k,l}w_{j,k,l}\). Note that the region of interest \(\mathbf{R}\) can have different shapes and sizes depending on the available ANs and their locations. Additionally, it is worth noting that the inclusion of additional ANs can improve localization accuracy. In the following section, we deduce that uncertainty is reduced significantly when the proposed searching method is combined with a finer discretization which helps to achieve significant improvements. We also evaluate how the weight assignment process can reduce uncertainty. Additionally, the performance of the proposed method is assessed under different scenarios. We summarize the 3D relational positioning method with the following set of steps:  
1. Discretize the working operational area or space, obtaining \(\mathbf{v}_{j,k,l}\);
2. Calculate the Manhattan distance from \(AN_{i}\) to \(\mathbf{v}_{j,k,l}\), \(\delta_{i,(j,k,l)}\);
3. Obtain the route from ANs to the node of interest \(\mathbf{n}_{0}\);
4. Calculate distance from \(AN_{i}\) to \(\mathbf{n}_{0}\) based on the number of hops in the route \(\Delta_{i,(j,k,l)}\);
5. Calculate distance relationships between every pair of ANs as \(\zeta_{i,m}=\Delta_{i,(j,k,l)}/\Delta_{m,(j,k,l)}\);
6.