# A Combined Localization Algorithm for Wireless Sensor Networks

Authors: Xiaogang Qi; Xiaoke Liu; Lifang Liu
Journal: Mathematical Problems in Engineering
 (2018)

---

## Abstract

Wireless sensor networks (WSNs) are widely used in various fields to monitor and track various targets by gathering information, such as vehicle tracking and environment and health monitoring. The information gathered by the sensor nodes becomes meaningful only if it is known where it was collected from. Considering that multilateral algorithm and MDS algorithm can locate the position of each node, we proposed a localization algorithm combining the merits of these two approaches, which is called MA-MDS, to reduce the accumulation of errors in the process of multilateral positioning algorithm and improve the nodes’ positioning accuracy in WSNs. It works in more robust fashion for noise sparse networks, even with less number of anchor nodes. In the MDS positioning phase of this algorithm, the Prussian Analysis algorithm is used to obtain more accurate coordinate transformation. Through extensive simulations and the repeatable experiments under diverse representative networks, it can be confirmed that the proposed algorithm is more accurate and more efficient than the state-of-the-art algorithms.


---

## Body

## 1. Introduction

Wireless sensor networks are composed of a large number of sensor nodes with sensing, computing, and wireless communication capabilities. They are widely used in military reconnaissance, environmental monitoring, smart home, and other fields. Interestingly, the location service of WSN is a guarantee of important services such as information collection, target tracking, and information management. Only by obtaining the location of the sensor node corresponding to the collected information will the data make sense. Therefore, determining the location information of sensor nodes becomes particularly important in WSNs. Global Navigation Satellite systems (INS) and Global Positioning System (GPS) have been widely employed for localization, but it is unpractical and costly to integrate a GPS receiver in each sensor of an entire large-scale sensor network. A large number of localization algorithms thus are proposed.Existing localization algorithms mainly fall into two strategies: range-free and range-based approaches, according to whether the distance between nodes is to be measured before positioning. Range-based algorithms include trilateral algorithm [1], multilateral algorithm [2], DEP algorithm [3], etc. Specifically, the multilateral algorithm [2], possessing of high positioning accuracy, is a commonly used algorithm among them. An equation can be constructed by using the distance between the anchor nodes and the unknown nodes, and then the solution can be worked out via the least square method in the algorithm. The disadvantage of this method is that the selection of the anchor node serial number will have some influence on the positioning accuracy in the process of constructing the equation. Range-free algorithms comprise centroid localization algorithm [4], APIT (Approximate Point-in-Triangulation Test) algorithm [5], DV-Hop (Distance Vector-Hop) algorithm [6], etc. The centroid location algorithm [4] is very simple and convenient but entirely based on network topology which can be influenced by communication range of nodes. The range may be disturbed by various factors in practice, bringing about a relatively large error. By determining the location relationship between the unknown node and the neighbor anchor nodes, the APIT algorithm [5] keeps shrinking and covering the unknown area, ultimately approaching the unknown node. The APIT algorithm relies on highly connectivity of nodes, so this algorithm is not suitable for sparse networks. The DV-Hop algorithm [6] is one of the popular hop-count localization methods, which obtains the information of each anchor node mainly through the distance vector routing protocol. However, with the increase of the hop count between the anchor node and the unknown node, the gradually accumulating measured distance leads to the poor positioning accuracy of unknown nodes. Moreover, [7] compares the performance of APIT algorithm with DV-Hop algorithm in detail, and the results show that the performance of DV-Hop algorithm is much better than of the APIT algorithm no matter how the number of anchor nodes changes. The localization algorithm based on MDS [8–10] can be considered as the range-based algorithm, as well as the range-free algorithm, and this paper mainly considers it as range-based algorithm. More narrowly, the WSNs can be regarded as a weighted undirected graph with the weight is the distance between two adjacent nodes. Distance matrix, as the only input of MDS algorithm, derives from the shortest path calculated by Floyd algorithm between any two nodes. It is well known that the accuracy of the MDS algorithm is closely related to the hops between nodes. The larger the hops, the larger the error of replacing the real distance with the shortest path distance, which eventually lead to poor positioning accuracy of the MDS algorithm. Comparing range-based algorithm with range-free algorithm, the former has higher hardware cost but has high localization accuracy. In the application scenarios with high accuracy requirements, range-based algorithms are generally adopted.Based on the range-based localization algorithm and the range-free localization algorithm, some researchers have proposed the idea of combining the heuristic optimization algorithm with the WSN node localization technology. The principle of this idea is to construct the optimal positioning model by obtaining the distance information between nodes or the connected topological relations and use the heuristic optimization algorithm to calculate the optimal solution by iterating the optimal positioning model. So far, many optimization algorithms have been used in the realm of heuristic optimization algorithms, such as Simulated Annealing (SA) [11], Artificial Fish Swarm Algorithm (AFSA) [12], Flower Pollination Algorithm (cFPA) [13], and Particle Swarm Optimization (PSO) [14]. Carrying out a great number of simulation experiments on the above heuristic algorithm, we intuitively discover that the heuristic algorithm is too computationally expensive and time-consuming for the centralized localization optimization to apply in the real scene localization. In addition, a universal weakness of heuristic algorithms is that they are overly dependent on the initial parameters. Improper selection of the initial parameters may cause the localization algorithm to be paralyzed.Ultrawide Band (UWB) technology, first appeared in 1960 radar applications, has now developed into an emerging technologies which sets wireless data communications and real-time sensing as a whole. Differing from the traditional communication technologies, UWB technology is a pulsed radio technology, which transmits data through extremely short nanosecond pulses, replacing carrier signals, between transceivers. According to the definition and characteristics of the signal, UWB technology has the advantages of large bandwidth, fast transmission, low transmission power, high multipath resolution, and strong antifading. UWB ranging techniques commonly used today can be categorized into Time of Arrival (TOA), Time Difference of Arrival (TDOA), Angle of Arrival (AOA), and Received Signal Strength Indication (RSSI). TOA technique requires precise clock synchronization technique, so the hardware requirements are higher. The principle of TDOA is to use the difference of transmission speed by wireless signal or ultrasonic signal to measure the distance between nodes. It has higher ranging accuracy but needs to be equipped with ultrasonic launcher for nodes, which increases the hardware cost. AOA algorithms need antenna arrays to extract angle information. RSSI is a technique for measuring the distance between nodes based on the power loss of a wireless signal during transmission. Since the inherent wireless communication chip in the node has the ability to calculate and transmit signals, RSSI does not require additional hardware. In addition, the accuracy of the localization algorithm based on RSSI has obvious merits compared with that of range-free algorithm, so this paper selects RSSI ranging technology for measuring the distance between nodes.In large-scale sensor networks with anchor nodes distributed on the edge, due to the limitation of communication range, the location of all unknown nodes could not be obtained by one-time multilateral algorithm, and they must be hierarchically positioned: firstly, finding all unknown nodes adjacent to at least three anchor nodes, called 1-level nodes. Then, the multilateral algorithms are used to calculate the estimated position of the 1-level nodes. Further, the 1-level nodes as new anchor nodes join into the anchor node set. At this point, the 1-level nodes location ends. Similar to the steps of positioning the 1-level nodes, nodes from 2-level to n-level can be located by the multilateral algorithm until all the unknown nodes have obtained the geographical position. As can be seen from the above steps, the multilateral algorithm will produce the cumulative error; the more nodes’ level, the greater the cumulative error, the poorer positioning accuracy. In order to prevent overaccumulation of cumulative error, this paper presents a combined algorithm (MA-MDS), which uses the MDS algorithm to calculate the location of the remaining unknown nodes after positioning a specific level of nodes (such as six-level nodes) location by the multilateral algorithm.We will examine the performance of MA-MDS on networks of 100 to 200 nodes, with node locations either chosen randomly or deployed according to a rough grid, and compared the positioning error of the MA-MDS algorithm with other representative algorithms. It is worth stating that the anchor nodes in this article are only distributed on the edge of the node deployment area to cater to some special application scenarios.The rest of paper is organized as follows: In Section2, we discuss related work. Section 3 describes show the MA-MDS algorithm. Computer simulation results and experiment analysis are shown in Sections 4 and 5.


## 2. Problem Description

### 2.1. Problem Formulation

Consider a WSN withN wireless nodes labeled 1,2,…,N in 2-dimensional space. The number of anchors whose locations are all known already is MM<N, so there are N-M unknown nodes that should be localized in this problem. By using RSSI signal propagation model, we can estimates the distance from one node to its neighbors. Denote the distance measured between nodes i and j as d^ij. Let X=xii=1N; xi=xi,yi∈R represents the real coordinates of all nodes and A=xii=1M represents the set of anchor nodes’ coordinates. Note that anchor nodes must be distributed on the edge of the node deployment area.


### 2.2. Error in Localization Problem

Consider a WSN with wireless sensor nodes which includeM anchors and N-M unknown nodes, and define the average location error in WSN as follows.Definition 1.
Average Localization Error is(1)ErrorA=∑i=1N-Mxi-x~i2+yi-y~i2R∗N-Mwhere R is the communication radius of the node in network.


### 2.3. RSSI Signal Propagation Model

An important feature of wireless signal transmission is that the strength of signal attenuates with the increase of distance. The most widely used simulation model to generate RSSI samples as a function of distance in Radio Frequency (RF) channels is the log-normal shadowing model [15].(2)PRd=PT-PLd0-10ηlg⁡dd0+XσwherePR is the received signal power, PT is the transmit power, and PLd0 is the path loss for a reference distance of d0. η is the path loss exponent, and Xσ is a zero-mean Gaussian noise with a standard deviation σ, which means Xσ~N0,σ2. All powers are in dB, and all distances are in meters. Moreover, in this model, we assume there is not obstruction like walls between nodes.


## 2.1. Problem Formulation

Consider a WSN withN wireless nodes labeled 1,2,…,N in 2-dimensional space. The number of anchors whose locations are all known already is MM<N, so there are N-M unknown nodes that should be localized in this problem. By using RSSI signal propagation model, we can estimates the distance from one node to its neighbors. Denote the distance measured between nodes i and j as d^ij. Let X=xii=1N; xi=xi,yi∈R represents the real coordinates of all nodes and A=xii=1M represents the set of anchor nodes’ coordinates. Note that anchor nodes must be distributed on the edge of the node deployment area.


## 2.2. Error in Localization Problem

Consider a WSN with wireless sensor nodes which includeM anchors and N-M unknown nodes, and define the average location error in WSN as follows.Definition 1.
Average Localization Error is(1)ErrorA=∑i=1N-Mxi-x~i2+yi-y~i2R∗N-Mwhere R is the communication radius of the node in network.


## 2.3. RSSI Signal Propagation Model

An important feature of wireless signal transmission is that the strength of signal attenuates with the increase of distance. The most widely used simulation model to generate RSSI samples as a function of distance in Radio Frequency (RF) channels is the log-normal shadowing model [15].(2)PRd=PT-PLd0-10ηlg⁡dd0+XσwherePR is the received signal power, PT is the transmit power, and PLd0 is the path loss for a reference distance of d0. η is the path loss exponent, and Xσ is a zero-mean Gaussian noise with a standard deviation σ, which means Xσ~N0,σ2. All powers are in dB, and all distances are in meters. Moreover, in this model, we assume there is not obstruction like walls between nodes.


## 3. Localization Algorithm

This section mainly introduces MA-MDS localization framework, described MDS algorithm and multilateral algorithm in detail. As mentioned in Section1, MA-MDS is an algorithm, combining the advantages of the multilateral algorithm and the MDS algorithm. Multilateral algorithms are prone to produce large errors of high-level nodes as the effect of cumulative error, and the reverse is true for the low-level nodes. Therefore, MDS algorithm is used to positioning the high-level nodes with larger errors to obtain more accurate results. The detailed process of the MA-MDS algorithm is as follows. Primarily, the multilateral algorithm is used to obtain the estimated coordinates of the nodes from 1-level to k-level nodes as set B, and each node in B can be regarded as a new anchor node, namely, A=A∪B. Next, we have to get the distance matrix that the MDS algorithm needs to input. The solution is to get the weighted shortest path distance by using Floyd algorithm. Finally, running the MDS algorithm to get the relative map, and then the Procrustes analysis (PA) algorithm [16, 17] is referenced to convert the relative map into an absolute map (estimated node location). It should be noted that, at this moment, the anchor nodes are union of all estimated nodes calculated by the multilateral algorithm and the original anchor nodes. The detailed flow of the MA-MDS algorithm is shown in Algorithm 1.Algorithm 1:The MA-MDS algorithm.
Inputs (i)  A: the set of anchor nodes locations. (ii)  k: threshold. (iii) Bi: the estimated coordinates of i-level nodes. Outputs (i) X^N×2: the estimated coordinates of all nodes in the entire WSNs. Step 1: Low-level nodes positioning For i=1 to k do (i)  Find the set of i-level nodes. (ii)  Running the multilateral algorithm to obtain the estimated coordinates of the i-level nodes, Bi; (iii)  Refresh the set of anchor nodes coordinates, A≔A∪Bi; End for. Step 2: High-level nodes positioning (i)  Get the weighted shortest path distance matrix by using Floyd algorithm, DN×N; (ii)  Running MDS algorithm, get relative coordinates for all nodes in WSNs, RN×2; the relative coordinates of anchor nodes are A^; (iii)  Transform relative coordinates to absolute coordinates by PA algorithm, get finally estimated coordinates of all nodes, X^N×2; Step 3: Calculation error (i)  Calculate average localization error by Eq. (1);There is a problem pressing to be solved is how to determine the threshold k, so that wheni>k, the i-level nodes are called the high-level nodes and are, instead, called the low-level nodes when i≤k is satisfied. Obviously, since the distribution of nodes varies under different application scenarios, the selection of k may change. In the simulation experiment of this paper, the selection of k will be described in detail in Section 4.The detailed introduction and analysis of multilateral algorithm and MDS algorithm are as follows.


### 3.1. The MDS Algorithm

MDS is a set of mathematical techniques which have their origins in psychometrics and psychophysics. MDS has been applied in many fields, such as computational chemistry, machine analysis, and target localization. When used for localization, MDS takes full advantage of connectivity or distance information between known and unknown nodes.UseX=xi,yiN×2 to denote the true locations of the set of N wireless nodes in 2-dimensional space. dijX represents the Euclidean distance between the nodes i and j.(3)dijX=xi-xj2+yi-yj2Let H=X·XT, and we can get(4)dijX2=xi2+yi2+xj2+yj2-2xixj+yiyj=Hii+Hjj-2HijWe can get (6) after applying double center to X,(5)∑i=1NHij=0Then,(6)1N∑i=1Ndij2=1N∑i=1NHii+Hjj(7)1N∑j=1Ndij2=1N∑j=1NHjj+Hii(8)1N2∑i=1N∑j=1Ndij2=2N∑i=1NHiiFurther,(9)Hij=121N∑j=1Ndij2+1N∑i=1Ndij2-dij2-1N2∑i=1N∑j=1Ndij2Calculate the Singular Value Decomposition (SVD) of H(10)H=UVUTwhere U=u1,u2,…,uN, V=diag⁡v1,v2,…,vN.LetX^=UV1/2; the localization scenes is 2-dimensional space, so get the first two rows of X^, which is relative location of nodes. We need eventually to get the absolute position of nodes which can be achieved from the rigid transformation (rotation, scaling, and translation). This transformation can be achieved using Procrustes analysis (PA) algorithm.


### 3.2. The Multilateral Algorithm

Figure1 shows the anchor nodes A1,…,All<M with their coordinates x1,y1,…,xl,yl and the unknown node Bx,y. From them, the distance between anchors and unknown nodes can be worked out. Consider the distance between anchor nodes and the unknown node as d1,d2,…,dl.Figure 1
The schematic of the multilateral algorithm.According to the Pythagoras theorem, the distance equation is(11)x-x12+y-y12=d12x-x22+y-y22=d22⋮x-xl2+y-yl2=dl2By dealing with (11), we have(12)2x1-xlx+2y1-yly=x12-xl2+y12-yl2-d12+dl22x2-xlx+2y2-yly=x22-xl2+y22-yl2-d22+dl2⋮2xl-1-xlx+2yl-1-yly=xl-12-xl2+yl-12-yl2-dl-12+dl2Equation (12) can be expressed in matrix form:(13)2x1-xl2y1-yl2x2-xl⋮2xl-1-xl2y2-yl⋮2yl-1-ylxy=b1b2⋮bl-1Let(14)A=2x1-xl2y1-yl2x2-xl⋮2xl-1-xl2y2-yl⋮2yl-1-yl,X=xy,b=b1b2⋮bl-1.Equation (13) can be written as AX=b.Then, the least squares solution can be calculated as(15)X⌢=ATA-1ATbThus, the estimated coordinates of unknown nodes are obtained.


### 3.3. Procrustes Analysis (PA) Algorithm

The Procrustes problem is to get the matrix Q, which satisfies AQ as close as possible to B; there A and B are given.We begin by defining the setOStp,k of orthogonal Stiefel matrices: (16)OSp,k=Q:Q∈Rp×k,QTQ=Ik×kLetA∈Rm×k and B∈Rm×pm≥p≥k.LetAF=trace(ATA)1/2 denote the standard Frobenius norm in Rm×k.The Procrustes problem for orthogonal Stiefel matrices can be expressed in formula:(17)fQ=minQ⁡AQ-BF2where Q∈OSp,k.Whenp=k, (17) is called the equilibrium Procrustes problem.This research tries to use the Procrustes analysis to convert the relative coordinates to absolute coordinates. UseGM×2 to denote the true locations of the set of M anchor nodes and YM×2 to denote the estimated locations of the set of M anchor nodes. The purpose is to find the transformed coordinate matrix YM×2′ so that the mean square error ofYM×2′ and GM×2 is minimized.(18)Y∗=sYT+etTe=1,1,…,1M×1TIn the above formula,S is the scaling factor, t is the coordinate translation vector, and T is the rotation mirror matrix.Through the above analysis, the Procrustes problem is(19)min⁡Ls,t,T=trG-sYT+etTTG-sYT+etTIn order to weaken the correlation between the transformation parameters and the rotation parameters, centralized processing of X and Y is(20)J=I-1Me∗eT,G′=JG,Y′=JYThen, formula (20) can be simplified as(21)min⁡Ls,T=trG′-sY′TTG′-sY′TThe process of solving the minimum value by Lagrange function method is as follows:(22)f=trG′-sY′TTG′-sY′T-trλTTT-I(23)∂f∂T=-2sY′TG′+2sY′TY′T-Tλ+λTLet Q=Y′TG′, P=Y′TY′, and h=λ+λT/2; then,(24)∂f∂T=-2sQ+2sPT-2Th=0h=-sTTQ+sTTPTIn formula (24), since both h and sTTPT are symmetric matrices, TTQ is symmetric matrices.(25)QQT=TQTTTTQTT=TQTQTTThe Singular Value Decomposition ofQ is(26)Q=UΣVT,Σ=diag⁡σ1,…,σr.We have(27)QQT=UΣVTVΣUT=UΣ2UTQQT=TQTQTT=TVΣ2VTTT(28)∂f∂s=-2trG′-sY′TY′TT=-2trY′TG′+2strY′Y′T=0Solving formulas (27) and (28), we can get(29)T=UVT,s=trG′TY′TtrY′TY′=trGTJYTtrYTJY,t=1MG-sYTTeAfter the various parameters are obtained by formula (29), all the coordinates in the relative map can be converted to absolute coordinates.


## 3.1. The MDS Algorithm

MDS is a set of mathematical techniques which have their origins in psychometrics and psychophysics. MDS has been applied in many fields, such as computational chemistry, machine analysis, and target localization. When used for localization, MDS takes full advantage of connectivity or distance information between known and unknown nodes.UseX=xi,yiN×2 to denote the true locations of the set of N wireless nodes in 2-dimensional space. dijX represents the Euclidean distance between the nodes i and j.(3)dijX=xi-xj2+yi-yj2Let H=X·XT, and we can get(4)dijX2=xi2+yi2+xj2+yj2-2xixj+yiyj=Hii+Hjj-2HijWe can get (6) after applying double center to X,(5)∑i=1NHij=0Then,(6)1N∑i=1Ndij2=1N∑i=1NHii+Hjj(7)1N∑j=1Ndij2=1N∑j=1NHjj+Hii(8)1N2∑i=1N∑j=1Ndij2=2N∑i=1NHiiFurther,(9)Hij=121N∑j=1Ndij2+1N∑i=1Ndij2-dij2-1N2∑i=1N∑j=1Ndij2Calculate the Singular Value Decomposition (SVD) of H(10)H=UVUTwhere U=u1,u2,…,uN, V=diag⁡v1,v2,…,vN.LetX^=UV1/2; the localization scenes is 2-dimensional space, so get the first two rows of X^, which is relative location of nodes. We need eventually to get the absolute position of nodes which can be achieved from the rigid transformation (rotation, scaling, and translation). This transformation can be achieved using Procrustes analysis (PA) algorithm.


## 3.2. The Multilateral Algorithm

Figure1 shows the anchor nodes A1,…,All<M with their coordinates x1,y1,…,xl,yl and the unknown node Bx,y. From them, the distance between anchors and unknown nodes can be worked out. Consider the distance between anchor nodes and the unknown node as d1,d2,…,dl.Figure 1
The schematic of the multilateral algorithm.According to the Pythagoras theorem, the distance equation is(11)x-x12+y-y12=d12x-x22+y-y22=d22⋮x-xl2+y-yl2=dl2By dealing with (11), we have(12)2x1-xlx+2y1-yly=x12-xl2+y12-yl2-d12+dl22x2-xlx+2y2-yly=x22-xl2+y22-yl2-d22+dl2⋮2xl-1-xlx+2yl-1-yly=xl-12-xl2+yl-12-yl2-dl-12+dl2Equation (12) can be expressed in matrix form:(13)2x1-xl2y1-yl2x2-xl⋮2xl-1-xl2y2-yl⋮2yl-1-ylxy=b1b2⋮bl-1Let(14)A=2x1-xl2y1-yl2x2-xl⋮2xl-1-xl2y2-yl⋮2yl-1-yl,X=xy,b=b1b2⋮bl-1.Equation (13) can be written as AX=b.Then, the least squares solution can be calculated as(15)X⌢=ATA-1ATbThus, the estimated coordinates of unknown nodes are obtained.


## 3.3. Procrustes Analysis (PA) Algorithm

The Procrustes problem is to get the matrix Q, which satisfies AQ as close as possible to B; there A and B are given.We begin by defining the setOStp,k of orthogonal Stiefel matrices: (16)OSp,k=Q:Q∈Rp×k,QTQ=Ik×kLetA∈Rm×k and B∈Rm×pm≥p≥k.LetAF=trace(ATA)1/2 denote the standard Frobenius norm in Rm×k.The Procrustes problem for orthogonal Stiefel matrices can be expressed in formula:(17)fQ=minQ⁡AQ-BF2where Q∈OSp,k.Whenp=k, (17) is called the equilibrium Procrustes problem.This research tries to use the Procrustes analysis to convert the relative coordinates to absolute coordinates. UseGM×2 to denote the true locations of the set of M anchor nodes and YM×2 to denote the estimated locations of the set of M anchor nodes. The purpose is to find the transformed coordinate matrix YM×2′ so that the mean square error ofYM×2′ and GM×2 is minimized.(18)Y∗=sYT+etTe=1,1,…,1M×1TIn the above formula,S is the scaling factor, t is the coordinate translation vector, and T is the rotation mirror matrix.Through the above analysis, the Procrustes problem is(19)min⁡Ls,t,T=trG-sYT+etTTG-sYT+etTIn order to weaken the correlation between the transformation parameters and the rotation parameters, centralized processing of X and Y is(20)J=I-1Me∗eT,G′=JG,Y′=JYThen, formula (20) can be simplified as(21)min⁡Ls,T=trG′-sY′TTG′-sY′TThe process of solving the minimum value by Lagrange function method is as follows:(22)f=trG′-sY′TTG′-sY′T-trλTTT-I(23)∂f∂T=-2sY′TG′+2sY′TY′T-Tλ+λTLet Q=Y′TG′, P=Y′TY′, and h=λ+λT/2; then,(24)∂f∂T=-2sQ+2sPT-2Th=0h=-sTTQ+sTTPTIn formula (24), since both h and sTTPT are symmetric matrices, TTQ is symmetric matrices.(25)QQT=TQTTTTQTT=TQTQTTThe Singular Value Decomposition ofQ is(26)Q=UΣVT,Σ=diag⁡σ1,…,σr.We have(27)QQT=UΣVTVΣUT=UΣ2UTQQT=TQTQTT=TVΣ2VTTT(28)∂f∂s=-2trG′-sY′TY′TT=-2trY′TG′+2strY′Y′T=0Solving formulas (27) and (28), we can get(29)T=UVT,s=trG′TY′TtrY′TY′=trGTJYTtrYTJY,t=1MG-sYTTeAfter the various parameters are obtained by formula (29), all the coordinates in the relative map can be converted to absolute coordinates.


## 4. Complexity and Simulation Results Analysis

### 4.1. Time Complexity Analysis

Assume that the total number of nodes in the network isN and the number of anchor nodes is M. The original classic MDS algorithm uses a centralized calculation method. The time complexity of the shortest path distance between nodes calculated by Floyd algorithm is ON3 and that of MDS algorithm is ON3. The time complexity of the multilateral algorithm is ON2. For the heuristic optimization algorithms, we assume that the maximum number of iterations is m, the population number is n, the number of try times is L, and the number of decision variables, that is, the dimension of space, is D. The time complexity of the algorithm is ON∗n∗m∗L∗D. n is the number of fishes and pollen in the AFSA [12] and cFPA [13], respectively. Setting the simulation parameters of AFSA algorithm as n=m=L=1/2N, the time complexity of this algorithm is ON4, while the time complexity of MA-MDS algorithm is ON3. Obviously, the time complexity of the MA-MDS algorithm is lower than that of the heuristic algorithm.


### 4.2. Simulation Results Analysis

In this section we conduct the simulation studies on the MA-MDS algorithm. The nodes subject to uniform distribution are placed randomly, or on a square grid with some placement errors. Table1 shows the parameters for grid placement, and Table 2 shows the parameters for random deployment. The connectivity (average number of neighbors) is controlled by communication radius. In order to determine the threshold k, we simulate the MA-MDS algorithm 50 times in the case of grid deployment and random deployment respectively and then calculate 95% confidence interval of the Average Positioning Error of each level node shown in Tables 3 and 4. Since positioning error less than 1.5 m is acceptable in practical application scenarios, we observe the confidence intervals in Tables 3 and 4 to conclude that k=6 is a reasonable solution in the case of grid placement and in the case of random placement it needs to set k=2. In addition, the superiority of MA_MDS algorithm is verified by comparison with the state-of-the-art algorithms, such as the AFSA and the cFPA. In the AFSA, we set scale of fish n=100, visual field of artificial fish Visual=10, maximum step size Step=8, congestion factor δ=0.618, the number of try times TryNumber=100, and maximum iteration number MaxItera=100. In the cFPA, the size of pollen population is fixed at 100 and the number of iterations is 100.Table 1
Parameters used for grid placement.
Variable Value Map size 200 m × 200 m Sensor nodes 121 Anchor nodes 20 Radio range 30mTable 2
Parameters used for random placement.
Variable Value Map size 200 m × 200 m Sensor nodes 200 Anchor nodes 20 Radio range 40mTable 3
95% confidence interval of Average Location Error of each level node in grid placement.
Node type 95% confidence interval 1-level nodes [0.195157,0.288841] 2-level nodes [0.250563,0.562676] 3-level nodes [0.487096,0.562676] 4-level nodes [0.469369,0.529228] 5-level nodes [0.941971,1.086544] 6-level nodes [1.024073,1.164885] 7-level nodes [2.549522,3.562547]Table 4
95% confidence interval of Average Location Error of each level node in random placement.
Node type 95% confidence interval 1-level nodes [0.217256,0.234132] 2-level nodes [0.529685,0.614348] 3-level nodes [1.831667,2.425615] 4-level nodes [5.470236,7.708749] 5-level nodes [13.19939,21.78891]


### 4.3. Grid Placement

The sensor nodes are deployed according to square grid. Actually, nodes are usually placed in the surrounding of the vertices due to random placement error. The parameters of the simulation are shown in Table1. 121 nodes are placed on a 200m×200m square grid, with a unit edge distance r. Figure 2 shows the result of average localization error for a network, where the number of nodes in the network varies from 64 to 196 nodes. It is worth noting that, in this experiment, the communication range is R=1.5r. Since the size of the network area is constant, r varies with the increase of the number of nodes and R changes correspondingly, which makes the monotonous relationship between the number of nodes and the positioning error of algorithms not clearly shown in Figure 2. This relationship can be seen in Figure 3. By analyzing Figure 2, we can draw the following conclusions:(i)
The MA_MDS has a smaller error than the other localization analyzed algorithm. This is due to the fact that, in the process of localization of the MA-MDS algorithm, not only did it reduce the cumulative error in the multilateral algorithm positioning stage but it also increased the number of anchor nodes and reduced the hops between nodes in the positioning phase of the MDS algorithm.(ii)
Continuous accumulation of accumulated errors results in the sharp increase of positioning error of the multilateral algorithm, with the increase of the number of nodes.(iii)
The heuristic algorithm is less robust. Small changes in the initial parameters may cause a huge change in positioning results. Random deployment of the initial population is also a factor that affects the robustness of the algorithm.Figure 2
Comparison of the Average Positioning Error in grid.Figure 3
The relationship between communication range and Average Positioning Error in grid network with 20 anchor nodes.Varying the communication rangeR from 30 to 50m, the Average Positioning Error of a network with 100 unknown nodes and 20 anchor nodes is observed in Figure 3. This result shows that there is a monotonous relationship between the communication range and the positioning error. The larger the communication range, the smaller the error. This is because the larger the communication range, the greater connectivity the network is.Remaining the total number of nodes and the value of the communication radius, the relationship between Range Error Rate and Average Positioning Error in network is shown in Figure4. The ranging error rate is equal to the value dividing the difference between the estimated distance and the true distance by the communication range of nodes. Since heuristic optimization algorithms have much larger errors than other algorithms, heuristic algorithms are not drawn in the figure. As can be seen from Figure 4, all the algorithms satisfy the rule that the larger the range error rate, the larger the average position error. Moreover, the polyline of the MA_MDS is always at the bottom of the graph, which means that the MA_MDS has higher positioning accuracy than the MA algorithm and the MDS algorithm no matter how the range error rate changes.Figure 4
The relationship between Range Error Rate and Average Positioning Error in grid network with 20 anchor nodes.In addition, we compared the positioning performance of MA_MDS algorithm with the range-free algorithm. The idea of the APIT algorithm is triangular coverage approximation. That is, the unknown node is in the centroid of overlapping regions of multiple triangles constructed by the anchor node. The application scenario in this paper is that the anchor nodes are distributed at the edge of the area and the number of anchor nodes is small. For each unknown node, no multiple triangles exist which are formed by the anchor nodes, so that the algorithm is no longer applicable. The DV-Hop algorithm and the centroid location algorithm are compared with the MA-MDS. The location error is shown in Figure5. Compared with the range-free algorithm, the MA_MDS algorithm has overwhelming superiority.Figure 5
Comparison of positioning performance between MA-MDS algorithm and the range-free algorithm.


### 4.4. Random Placement

In this set of experiments, nodes are placed randomly in a 200m∗200m square and 20 anchor nodes are deployed on the boundary of the square region. The parameters of the simulation are shown in Table 2. The initial parameters of the AFSA and the cFPA are consistent with those in the grid deployment scenario and the analyzing process just likes it. Figure 6 shows the result of average localization error for a network, where the number of nodes random deployment in the network varies from 120 to 200 nodes. In this experiment, as the communication radius is fixed at R=40m, the more the number of nodes, the greater the connectivity of the network and the lower the Average Positioning Error. In addition, it can be seen from the figure that the positioning accuracy of the heuristic algorithms is poor under the application scenario where the anchor nodes are distributed on the boundary. Figure 7 shows the relationship between communication range and Average Positioning Error in random deployment network. The positioning error of MA_MDS algorithm is lower than other algorithms and decreases with increasing communication radius. Figure 8 shows relationship between Range Error Rate and Average Positioning Error in network.Figure 6
Comparison of the Average Positioning Error in random placement.Figure 7
The relationship between communication range and Average Positioning Error in random placement network with 20 anchor nodes.Figure 8
The relationship between Range Error Rate and Average Positioning Error in random placement network with 20 anchor nodes.The Average Positioning Error of range-free algorithm is shown in Figure9. Keeping the communication radius unchanged, the Average Positioning Error of the DV-Hop algorithm and MA_MDS algorithm gradually decreases with the number of nodes increasing. However, the positioning error of the centroid location algorithm has an increasing trend. In centroid location algorithm, the greater the connectivity of the network as the number of nodes increases, the greater the probability that different nodes have the same neighbor anchor nodes. With the number of nodes increasing, different unknown nodes are more likely to obtain the same estimated coordinates through this algorithm, making the Average Positioning Error of the network, the final result, excessively large. In addition, it can be seen from Figure 9 that the error of the centroid location algorithm is much higher than others. The reason is that the anchor nodes adjacent to the unknown node are approximately in a straight line and are generally on the same side of the unknown node, which is determined by application scenario in this paper. Through this simulation experiment, we are able to conclude that the positioning accuracy of range-based algorithm is significantly better than range-free algorithm.Figure 9
Comparison of positioning performance between MA-MDS algorithm and the range-free algorithm.


## 4.1. Time Complexity Analysis

Assume that the total number of nodes in the network isN and the number of anchor nodes is M. The original classic MDS algorithm uses a centralized calculation method. The time complexity of the shortest path distance between nodes calculated by Floyd algorithm is ON3 and that of MDS algorithm is ON3. The time complexity of the multilateral algorithm is ON2. For the heuristic optimization algorithms, we assume that the maximum number of iterations is m, the population number is n, the number of try times is L, and the number of decision variables, that is, the dimension of space, is D. The time complexity of the algorithm is ON∗n∗m∗L∗D. n is the number of fishes and pollen in the AFSA [12] and cFPA [13], respectively. Setting the simulation parameters of AFSA algorithm as n=m=L=1/2N, the time complexity of this algorithm is ON4, while the time complexity of MA-MDS algorithm is ON3. Obviously, the time complexity of the MA-MDS algorithm is lower than that of the heuristic algorithm.


## 4.2. Simulation Results Analysis

In this section we conduct the simulation studies on the MA-MDS algorithm. The nodes subject to uniform distribution are placed randomly, or on a square grid with some placement errors. Table1 shows the parameters for grid placement, and Table 2 shows the parameters for random deployment. The connectivity (average number of neighbors) is controlled by communication radius. In order to determine the threshold k, we simulate the MA-MDS algorithm 50 times in the case of grid deployment and random deployment respectively and then calculate 95% confidence interval of the Average Positioning Error of each level node shown in Tables 3 and 4. Since positioning error less than 1.5 m is acceptable in practical application scenarios, we observe the confidence intervals in Tables 3 and 4 to conclude that k=6 is a reasonable solution in the case of grid placement and in the case of random placement it needs to set k=2. In addition, the superiority of MA_MDS algorithm is verified by comparison with the state-of-the-art algorithms, such as the AFSA and the cFPA. In the AFSA, we set scale of fish n=100, visual field of artificial fish Visual=10, maximum step size Step=8, congestion factor δ=0.618, the number of try times TryNumber=100, and maximum iteration number MaxItera=100. In the cFPA, the size of pollen population is fixed at 100 and the number of iterations is 100.Table 1
Parameters used for grid placement.
Variable Value Map size 200 m × 200 m Sensor nodes 121 Anchor nodes 20 Radio range 30mTable 2
Parameters used for random placement.
Variable Value Map size 200 m × 200 m Sensor nodes 200 Anchor nodes 20 Radio range 40mTable 3
95% confidence interval of Average Location Error of each level node in grid placement.
Node type 95% confidence interval 1-level nodes [0.195157,0.288841] 2-level nodes [0.250563,0.562676] 3-level nodes [0.487096,0.562676] 4-level nodes [0.469369,0.529228] 5-level nodes [0.941971,1.086544] 6-level nodes [1.024073,1.164885] 7-level nodes [2.549522,3.562547]Table 4
95% confidence interval of Average Location Error of each level node in random placement.
Node type 95% confidence interval 1-level nodes [0.217256,0.234132] 2-level nodes [0.529685,0.614348] 3-level nodes [1.831667,2.425615] 4-level nodes [5.470236,7.708749] 5-level nodes [13.19939,21.78891]


## 4.3. Grid Placement

The sensor nodes are deployed according to square grid. Actually, nodes are usually placed in the surrounding of the vertices due to random placement error. The parameters of the simulation are shown in Table1. 121 nodes are placed on a 200m×200m square grid, with a unit edge distance r. Figure 2 shows the result of average localization error for a network, where the number of nodes in the network varies from 64 to 196 nodes. It is worth noting that, in this experiment, the communication range is R=1.5r. Since the size of the network area is constant, r varies with the increase of the number of nodes and R changes correspondingly, which makes the monotonous relationship between the number of nodes and the positioning error of algorithms not clearly shown in Figure 2. This relationship can be seen in Figure 3. By analyzing Figure 2, we can draw the following conclusions:(i)
The MA_MDS has a smaller error than the other localization analyzed algorithm. This is due to the fact that, in the process of localization of the MA-MDS algorithm, not only did it reduce the cumulative error in the multilateral algorithm positioning stage but it also increased the number of anchor nodes and reduced the hops between nodes in the positioning phase of the MDS algorithm.(ii)
Continuous accumulation of accumulated errors results in the sharp increase of positioning error of the multilateral algorithm, with the increase of the number of nodes.(iii)
The heuristic algorithm is less robust. Small changes in the initial parameters may cause a huge change in positioning results. Random deployment of the initial population is also a factor that affects the robustness of the algorithm.Figure 2
Comparison of the Average Positioning Error in grid.Figure 3
The relationship between communication range and Average Positioning Error in grid network with 20 anchor nodes.Varying the communication rangeR from 30 to 50m, the Average Positioning Error of a network with 100 unknown nodes and 20 anchor nodes is observed in Figure 3. This result shows that there is a monotonous relationship between the communication range and the positioning error. The larger the communication range, the smaller the error. This is because the larger the communication range, the greater connectivity the network is.Remaining the total number of nodes and the value of the communication radius, the relationship between Range Error Rate and Average Positioning Error in network is shown in Figure4. The ranging error rate is equal to the value dividing the difference between the estimated distance and the true distance by the communication range of nodes. Since heuristic optimization algorithms have much larger errors than other algorithms, heuristic algorithms are not drawn in the figure. As can be seen from Figure 4, all the algorithms satisfy the rule that the larger the range error rate, the larger the average position error. Moreover, the polyline of the MA_MDS is always at the bottom of the graph, which means that the MA_MDS has higher positioning accuracy than the MA algorithm and the MDS algorithm no matter how the range error rate changes.Figure 4
The relationship between Range Error Rate and Average Positioning Error in grid network with 20 anchor nodes.In addition, we compared the positioning performance of MA_MDS algorithm with the range-free algorithm. The idea of the APIT algorithm is triangular coverage approximation. That is, the unknown node is in the centroid of overlapping regions of multiple triangles constructed by the anchor node. The application scenario in this paper is that the anchor nodes are distributed at the edge of the area and the number of anchor nodes is small. For each unknown node, no multiple triangles exist which are formed by the anchor nodes, so that the algorithm is no longer applicable. The DV-Hop algorithm and the centroid location algorithm are compared with the MA-MDS. The location error is shown in Figure5. Compared with the range-free algorithm, the MA_MDS algorithm has overwhelming superiority.Figure 5
Comparison of positioning performance between MA-MDS algorithm and the range-free algorithm.


## 4.4. Random Placement

In this set of experiments, nodes are placed randomly in a 200m∗200m square and 20 anchor nodes are deployed on the boundary of the square region. The parameters of the simulation are shown in Table 2. The initial parameters of the AFSA and the cFPA are consistent with those in the grid deployment scenario and the analyzing process just likes it. Figure 6 shows the result of average localization error for a network, where the number of nodes random deployment in the network varies from 120 to 200 nodes. In this experiment, as the communication radius is fixed at R=40m, the more the number of nodes, the greater the connectivity of the network and the lower the Average Positioning Error. In addition, it can be seen from the figure that the positioning accuracy of the heuristic algorithms is poor under the application scenario where the anchor nodes are distributed on the boundary. Figure 7 shows the relationship between communication range and Average Positioning Error in random deployment network. The positioning error of MA_MDS algorithm is lower than other algorithms and decreases with increasing communication radius. Figure 8 shows relationship between Range Error Rate and Average Positioning Error in network.Figure 6
Comparison of the Average Positioning Error in random placement.Figure 7
The relationship between communication range and Average Positioning Error in random placement network with 20 anchor nodes.Figure 8
The relationship between Range Error Rate and Average Positioning Error in random placement network with 20 anchor nodes.The Average Positioning Error of range-free algorithm is shown in Figure9. Keeping the communication radius unchanged, the Average Positioning Error of the DV-Hop algorithm and MA_MDS algorithm gradually decreases with the number of nodes increasing. However, the positioning error of the centroid location algorithm has an increasing trend. In centroid location algorithm, the greater the connectivity of the network as the number of nodes increases, the greater the probability that different nodes have the same neighbor anchor nodes. With the number of nodes increasing, different unknown nodes are more likely to obtain the same estimated coordinates through this algorithm, making the Average Positioning Error of the network, the final result, excessively large. In addition, it can be seen from Figure 9 that the error of the centroid location algorithm is much higher than others. The reason is that the anchor nodes adjacent to the unknown node are approximately in a straight line and are generally on the same side of the unknown node, which is determined by application scenario in this paper. Through this simulation experiment, we are able to conclude that the positioning accuracy of range-based algorithm is significantly better than range-free algorithm.Figure 9
Comparison of positioning performance between MA-MDS algorithm and the range-free algorithm.


## 5. Conclusions

In this research, we have presented a localization method by combining the multilateral algorithm and the MDS algorithm in WSNs. The simulation results reveal that the proposed algorithm can locate the sensor network of the anchor node on the edge and the positioning accuracy is much higher than the state-of-art algorithms. The proposed algorithm is very practical due to its good robustness, high positioning accuracy, and low cost. We plan to conduct large-scale experiments in real environments to analyze the algorithms in future.



---

*Source: 4648109-2018-07-03.xml*