Neighbor Constraint Assisted Distributed Localization for Wireless Sensor Networks

Localization is one of the most significant technologies in wireless sensor networks (WSNs) since it plays a critical role in many applications. The main idea in most localization methods is to estimate the sensor-anchor distances that are used by sensors to locate themselves. However, the distance information is always imprecise due to the measurement or estimation errors. In this work, a novel algorithm called neighbor constraint assisted distributed localization (NCA-DL) is proposed, which introduces the application of geometric constraints to these distances within the algorithm. For example, in the case presented here, the assistance provided by a neighbor will consist in formulating a linear equality constraint. These constraints can be further used to formulate optimization problems for distance estimation. Then through some optimization methods, the imprecise distances can be refined and the localization precision is improved.


Introduction
Wireless sensor networks (WSNs) composed of a large number of low-power sensors have been a subject of increased interest in recent years [1][2][3].Location information of sensor nodes is vital for location-aware applications such as environmental monitoring, routing, and coverage control [4,5].Due to cost limitations and energy consumption, having each one of the sensors locate its position individually via GPS or other similar means is no longer a viable option.Hence, lots of works have focused on the localization algorithms for WSNs [6].
Based on the type of information they require, localization algorithms can be divided into two categories: (i) range-based and (ii) range-free [7][8][9][10].For both categories of localization algorithms, the most crucial phase of the process lies in the determination of the distances between the sensor nodes which need to be located and the anchors.In rangebased algorithms, the respective distances between sensors and anchors can be obtained via various ranging techniques such as time of arrival (TOA), time difference of arrival (TDOA), and received signal strength indication (RSSI).On the other hand, in range-free algorithms, distances can be estimated through topological or geometric information.
DV-Hop is a classical distributed range-free algorithm which determines distances by hop counts [11].By further combination with ranging techniques, DV-Hop can be extended in order to decrease its localization error; a noteworthy example of these methods is robust position [12][13][14].However, no matter which method is used, the acquired distances information to the anchors is usually imprecise compared with the true distances because of ranging and estimation errors [15,16].The imprecise distances will result in poor localization performance.Actually, these imprecise distances can be refined since the true distances between nodes should satisfy the geometric relations.In other words, the localization precision can be improved with the help of some geometric constraints.
In this work, a novel algorithm called neighbor constraint assisted distributed localization (NCA-DL) is proposed which is effective in refining the distances required for localization.NCA-DL describes the geometric relations among the distances between sensor nodes and anchors as some equality constraints.The core idea behind NCA-DL is to use the Cayley-Menger determinant [17,18] which will be defined in the following section.In NCA-DL, by using an adjacent neighbor which could be a mobile anchor, a linear equality constraint of distance estimation errors can be obtained.Through some optimal solution computation methods that are used to minimize the sum of the squared errors, the distances can be refined and the localization precision can be improved.The major contribution of this paper is twofold.First, the proposed algorithm is distributed so that sensor nodes can estimate their locations by themselves.Second, it introduces the idea of geometric constraints and decreases the distance estimation errors with the help of an adjacent neighbor.In general, the proposed method can largely improve the localization precision.
The layout of the paper is organized as follows.In Section 2, the preliminaries to the problem are introduced.In Section 3, the geometric relations among sensor nodes are formulated as constraints.In Section 4, the proposed distributed localization method will be described in detail.Section 5 presents the implementation and results of the numerical simulations that were performed to validate the method.Finally, conclusion will be drawn from this research in Section 6.

Preliminaries
Let us first consider {a 1 , a 2 , . . ., a  } and {b 1 , b 2 , . . ., b  } which represent a set of  distinct points, respectively.The Cayley-Menger matrix of these two sets can be defined as where (a  , b  ); ∀(, ) ∈ {1, 2, . . ., } denotes the Euclidean distance between the points a  and b  .The Cayley-Menger bideterminant of these two sequences of  points is defined as ( The above determinant is widely used in distance geometry theory [17].When the two sequences of points are the same, (a 1 , a 2 , . . ., a  ; a 1 , a 2 , . . ., a  ) is denoted for convenience by (a 1 , a 2 , . . ., a  ) which is simply called a Cayley-Menger determinant.
A brief summary of the Cayley-Menger determinant is generalized as follows [19].In a 2-dimensional Euclidean space, each node has a set of coordinates (  ,   ).The study of the localization problem applied to WSNs first requires some basic terminology and concepts to be defined.Definition 3 (regular nodes).Most of the nodes in the network do not know their locations.The whole purpose of localization algorithms is to estimate the coordinates of these nodes.

Theorem 1. Consider an n-tuple of points a
Definition 4 (anchors).Some of the nodes can know their locations through manual placement or with the help of specific equipment such as GPS.The coordinates of these nodes are used as reference information to assist in the localization procedure.
According to the above theorems and definitions, an interesting development of localization is how to use the Cayley-Menger determinant to reduce the impact of distance measurement errors [20].As shown in Figure 1, let   = (a  , a  ) denote the accurate Euclidean distance between anchors a  and a  with  ̸ = , (,  = 1, 2, 3), which can be inferred from known anchor positions;  0 = (r 0 , a  ) denotes the accurate distances between the regular node r 0 and node a  with  = 1, 2, 3 and  0 denotes the inaccurate distances acquired by either noisy range measurement or computations.Then the following equation is defined: Theorem 5.The errors   for  = 1, 2, 3 as defined immediately above satisfy a single algebraic equality which is quadratic though not homogeneous in the   's: Suppose the anchors are nonlinear, (a 1 , a 2 , a 3 ) ̸ = 0. From (7), the following equation can be derived: where Then according to (4), we can obtain Multiplying both sides of ( 10) by the determinant of E −1 , we can arrive at (5).This completes the proof.

Geometric Relations with Neighbor Constraint
In this section, we will focus on the geometric relations among the distances between nodes, which can be transformed to an algebraic constraint of the distance estimation errors.At first, we define another basic term.
Definition 6 (neighbors).Each node in WSNs has a communication range.So, for a node  in network, the nodes which can communicate with node  directly are the neighbors of node .
As shown in Figure 2, r( 0 ,  0 ) represents a regular node which needs to be located, n( 1 ,  1 ) represents a neighbor of node r  and a  (  ,   ) represents the anchors with  = 2, 3, 4. Then Let   = (a  , a  ) denote the accurate Euclidean distance between anchors a  and a  with  ̸ = , ,  = 2, 3, 4,  1 = (n, a  ) denote the accurate distances between the neighbor node n and anchor a  with  = 2, 3, 4,  0 = (r, a  ) denote the accurate distances between the regular node r and anchor a  with  = 2, 3, 4, and  01 denote the accurate distance between regular node r and its neighbor node n.In this case, suppose we know the accurate distances  1 ( = 2, 3, 4) and the accurate distance  01 by refinement or setting node n as a mobile anchor.Then  2 0 =  2 0 −   denote the inaccurate distances squared between node r and anchor a  with  = 2, 3, 4 for some error   .That is to say, the true distances represented by the dotted line in Figure 2 cannot be obtained.In this work, we aim to refine these inaccurate distances to trend toward actual values.

Neighbor Constraint Assisted Distributed Localization
Based on the algebraic constraints mentioned in the previous sections, a neighbor constraint assisted distributed localization algorithm (NCA-DL) is hereby proposed as a means of improving the localization precision.The main idea behind NCA-DL is to refine the distances to anchors using a neighbor node.In NCA-DL, the regular nodes estimate the initial distances to the anchors using the method similar to DV-Hop [11].Then according to the algebraic constraints of the distance estimation errors, Lagrangian multiplier method is introduced in order to obtain the optimal errors and refine the distances.The following section will give a full description of the principles and performance analysis of this novel NCA-DL algorithm.
4.1.Principles of the Algorithm.Initially, anchors (set ) are deployed in the sensing field with the regular nodes (set ).
We assume each node has the ability of ranging, and for simplicity, the number of the anchors is set to 3. The whole process of NCA-DL is divided into four phases.
(A) Distance Estimation.Each regular node is supposed to obtain initial distance estimation to the anchors.So two times of flooding are required to accomplish the process of distance estimation.In the first flooding, the anchors start by propagating their location information.Then all nodes receive the location information from every anchor as well as the hop count to these anchors.When an anchor node receives location information from other anchors, it can calculate the average size of a hop based on their locations and the hop count among them.In the second flooding, the average size of a hop is transmitted in a controlled manner into the network as a correction factor.When a regular node receives the correction, it can be able to estimate the distances to the anchors using the correction and the hop count information received in the previous flooding.
(B) Neighbor Node Election.The main purpose of this phase is to choose a proper neighbor for each regular node to assist distance refinement in the next phase.For most ranging technology, when sensors are closer, the distance estimations are more accurate.According to the requirement of Theorem 7, in order to obtain the constraint equation of the distance estimation errors, it is fundamental to choose an adjacent neighbor because the distance between the regular node and its neighbor can be measured accurately.Meanwhile, the distances among the neighbor and the anchors also should satisfy geometry relationship, that is to say, the distances should be refined by the method in [20].So in this phase, the nearest node of each regular node is chosen as an assistant neighbor and its distances to the anchors obtained in the previous phase are supposed to be refined using Theorem 5.
To improve the localization precision of the regular node further, the distances between the neighbor and the anchors need to be estimated accurately.Though the imprecise distances can be refined through Theorem 5 which can meet the requirement of Theorem 7, the distances are still imprecise.So in this phase, with the growing research for the mobility of sensors [21], a mobile anchor also can be used to be a "neighbor" of each regular node.The distances between this "neighbor" and the other static anchors can be accurately calculated by the coordinates of these anchors, which definitely meets the requirement of Theorem 7. In this case, the mobile anchor is supposed to move in the sensing field.The aim is just to assist the regular node with localization through the constraint defined in Theorem 7 and it does not need to consider the collinear problems of the anchors.So SCAN [22] could be used for the path planning method, which is the most straightforward one.
(C) Distance Refinement.The algebraic equalities that define the errors and relate the distances to the anchors for each regular node have now been fully determined from the previous two phases, as described in Theorems 5 and 7.The next step of the algorithm attempts to quantify these errors in the inaccurate distance estimations between regular nodes and anchors.Let   (∀ ∈ {2, 3, 4}) as defined in (4) be the error in the estimated squared distances between a regular node and the anchors.The goal here is to minimize the sum of the squared errors: In ( 23),  is subjected to a quadratic equality constraint defined in ( 5) and a linear equality constraint defined in (11).So, to solve the optimization problem with constraints, Lagrangian multiplier method has been implemented in the algorithm.It is a mathematical method used to solve the optimization problem, which can convert the constraints to the seeking of extreme values with the help of Lagrangian multipliers.We can get the following Lagrangian multiplier form: where  1 ,  2 are the Lagrangian multipliers and  1 ,  2 are the functions of  2 ,  3 ,  4 , whose coefficients can be obtained in ( 5) and (11).By differentiating the Lagrangian  with respect to   ( = 2, 3, 4) and   ( = 1, 2) and equating the result to zero, five equations can be obtained.Solving these five algebraic equations numerically and discarding all the nonoptimal stationary-point solutions,  2 ,  3 ,  4 can be solved.Then the distances to the anchors for the regular node are refined.The below example demonstrates the steps in this phase.
The simplest scenario as depicted in Figure 2 is considered, where node r is the regular node that needs to be located.Node r can measure its distances to three anchors a 2 , a 3 , a 4 whose coordinates are (10, 10), (90, 10), and (50, 90), respectively.The noisy distance measurements acquired by node r are  02 = 56.3, 03 = 65.7, and  04 = 41.6.The distances between the neighbor node n and other nodes are estimated in the previous phase as  01 = 5,  12 = 56.6, 13 = 56.6, and  14 = 40.In this case, the goal is to obtain the estimation errors  2 ,  3 ,  4 and refine  02 ,  03 , and  04 .
Firstly, two equality constraints as described by ( 5) and (11) will be determined: To determine the optimal values for  2 ,  3 ,  4 , the following problem needs to be solved: By differentiating the Lagrangian  defined in (24), we obtain

𝜕𝐻 𝜕𝜀
Solving the above five algebraic equations above, we get, As shown in Figure 3, "." represents the regular node, "◻" represents the anchor, and the radius of the circle is the estimated distance between the regular node and the anchor.In Figure 3(b), the three circles intersect in one point, which proves that the refined distances satisfy the geometric constraints.
(D) Localization.So far, regular nodes have known the refined distances to the anchors according to (29).Based on the above refinement scheme, we know that the refined distances satisfy the geometric constraints.Localization can be carried out by the least square method.(, ) represents the regular node, (  ,   ) ( = 2, 3, 4) represent the locations of the anchors, and d02 , d03 , d04 represent the refined distances between the regular node and the anchors.The coordinate of the regular node can be estimated by where Figure 4 illustrates the localization of the computational example above with both noisy and refined distances." * " represents the calculated location.The localization errors in Figures 4(a

Communication Cost Analysis.
For energy cost of NCA-DL, the communication consumption is mainly considered in the distance estimation and refinement phases. represents the number of the sensors and   represents the number of the anchors.Then for the two flooding processes in the distance estimation phase, it gives a bound of (2×  ×) to the communication cost in this process.While in the refinement phase, each node needs to communicate with its neighbors so the communication cost is ().The total communication complexity is ( × (2 ×   + 1)).It is known that the communication complexity of DV-Hop is (2 ×   × ).Since the method proposed in [20] is just to refine distance estimations with additional calculation, its communication complexity is the same as DV-Hop.So the cost of NCA-DL is in the same order of magnitude as other algorithms while it can largely improve the localization performance.

Numerical Results
This section we will describe the implementation of the NCA-DL algorithm and evaluate its performance through extensive simulations.The results obtained from these simulations will focus on analysing the distance estimation errors and  localization errors and further compare results obtained by NCA-DL, DV-Hop, robust position, and the method proposed in [20] which have been mentioned above.

Simulation Configuration.
The basic network setup area is considered to be a 100 m × 100 m square field.The communication radius of the nodes is set to 10 m.In our simulations, sensor nodes are deployed using two models: (i) random placement and (ii) perturbed grid.In the random placement model, sensor nodes are randomly deployed in the network by dropping from an airplane or some other methods.In this case, the topology of the network is likely to be irregular.In the second model, nodes are deployed using perturbed grid where the nodes are perturbed with a random shift from grid.In this situation, nodes will tend to uniformly occupy the field avoiding large concentration of nodes, which also guarantee the regularity of the topology of the network.
In all cases, regular nodes have the ability of ranging and the results are averaged over 10 trails.The average localization error is defined as follows: where  is the number of the regular nodes, x  is the actual location of regular node , x  is the estimated location of regular node , and  is the communication radius.1, we can observe that the distance estimation error of both DV-Hop and NCA-DL under perturbed gird deployment is smaller than that of these two algorithms under random placement.With the increase of the number of nodes (avg.degree), both DV-Hop and NCA-DL can improve the ranging effectiveness.Moreover, DV-Hop suffers large ranging error when the average degree is low while NCA-DL has smaller errors for divers network scales.Now, it has been proved that the NCA-DL algorithm can significantly decrease the distance estimation errors with the help of a collaborating neighbor; both initial deployment model conditions were therefore simulated in order to graphically verify their respective localization performance.
Figure 5 exemplifies the distance estimation and localization error of NCA-DL against number of nodes in both deployment models.It is demonstrated that the distance estimation error in NCA-DL can be decreased with the increase of the number of nodes.As shown in Figure 5(b), the localization error decreases more obviously when the distance estimation error drops below a critical value (around 2 m).
Figure 6 exemplifies the localization performance of DV-Hop and NCA-DL."Δ" represents the anchors, ". " represents the true location, " * " represents the calculated location, and the line between them represents the localization error.In this set of simulations, the number of deployed nodes (avg.degree) is set to 403 (11.1) and the number of the anchors is set to 3. According to the definition of localization error in (32), in the random placement deployment, the average localization error resulting form DV-Hop is around 66% while the error goes down to around 46% in perturbed grid deployment, as shown in Figures 6(a Figure 7 illustrates the localization error in both random placement and perturbed grid models.Compared with the other algorithms, NCA-DL has much lower localization error.With the increase of number of nodes, the performance of

Figure 2 :
Figure 2: Anchors, a regular node, and its neighbor node.
Performance of refined distances

Figure 3 :
Figure 3: Locations of anchors and the regular node.
67.39,  * 3 = −545.76, * 4 = −314.59.(28)Correspondingly, the refined distances between regular node r and the three anchors are d02 Figure 4 illustrates the localization of the computational example above with both noisy and refined distances." * " represents the calculated location.The localization errors in Figures 4(a) and 4(b) are 0.67 m and 0.55 m, respectively.
Localization with refined distances

Figure 4 :
Figure 4: Localization effect of noisy distances and refined distances.

Figure 5 :
Figure 5: Distance estimation and localization error of NCA-DL.
NCA-DL in perturbed grid

Figure 6 :
Figure 6: Localization effect in both deployment models.

Figure 7 :
Figure 7: Localization error against number of nodes.
) and 6(c).In Figures 6(b) and 6(d), we can see that NCA-DL decreases the localization error to 38% and 23%, respectively, in the two deployment models.In general, NCA-DL can increase the localization precision about 40% compared with DV-Hop under such network environment.

Table 1 :
Average distance estimation error.At first, we focus on the distance estimation error between regular nodes and anchors.In this set of simulations, we varied the number of the nodes (avg.degree)from124(4.8) to 628 (14.2).The number of the anchors is set to 3. The average distance estimation errors obtained from these simulations are stated in Table1.As indicated in Table