A RSSI-Based Distributed Weighted Search Localization Algorithm for WSNs

In order to solve the node localization problem in wireless sensor networks, we propose a novel distributed weighted search localization algorithm (WSLA) in this paper. The WSLA adopts a modified received signal strength indicator-based range model to estimate the distances between nodes, utilizes the results of a centroid localization algorithm as the search initial point, and employs a new weighted search method to compute the positions of nodes in a distributed and recursive manner. The key ideas of the WSLA include a node localization precision classification scheme, a processing scheme for special nodes, and weight-based searches. Compared with three state-of-art localization algorithms—namely, maximum likelihood estimation (MLE), edge-based second-order cone programming + nonconvex sequential greedy (ESOCP + NCSG), and particle swarm optimization (PSO)—the simulation results show that localization performance of the WSLA is superior to that of MLE, ESOCP + NCSG, and PSO.


Introduction
A wireless sensor network (WSN) is a wireless ad hoc network that consists of a large number of tiny batterypowered, randomly deployed sensor nodes with limited processing, storage, and communication capacity [1].Many WSN applications, for example, environmental monitoring, forest fire prevention, search and rescue, target detection, and tracking, require knowledge regarding sensor node positions [2].Therefore, sensor nodes should have ability to localize their positions in many WSN applications.
Today, sensor nodes mainly have two methods of obtaining position information.The first is that sensor nodes are equipped with dedicated localization hardware (e.g., GPS) [3] or are manually configured after deployment.This method is simple and accurate, but it requires higher hardware or deployment costs, which are not acceptable in large-scale WSNs.Therefore, only a few nodes, known as anchor nodes, employ this method.The other method is that sensor nodes localize their positions using software localization techniques.This method has low costs and low energy consumption, with worse localization accuracy than the first method, but it can meet the requirements of most applications.Therefore, the majority of nodes employ this method; these nodes are called normal or unknown nodes.
In general, localization algorithms can be divided into two categories: range-based localization and range-free localization.In range-based localization, nodes are able to measure the distances or angles to their neighbors using received signal strength indicator (RSSI), time-of-arrival, time difference of arrival, angle-of-arrival, and so on [4,5].In range-free localization, for example, centroid localization, APIT, DV-Hop, and LAEP [6][7][8][9][10], nodes have no ability to measure the distances or angles to their neighbors and instead use connectivity or hop information to compute the positions of the nodes.Range-based localization can provide higher localization accuracy than range-free localization, but the latter is simpler and does not require extra hardware for measurement.
Localization algorithms can also be classified as centralized localization and distributed localization [11].Centralized algorithms can process all range or connectivity information of the nodes from the global optimization angle.Therefore, their results are more accurate than those of distributed algorithms.However, they need to transmit a large amount of range or connectivity information to a fusion International Journal of Distributed Sensor Networks node (e.g., base station), which results in large energy communication and bandwidth consumption and shortens the lifespan of the entire network.Therefore, they are not suitable for large-scale resource-constrained WSNs.In contrast to centralized algorithms, distributed algorithms use only the local information available from its neighbors, and they are energy efficient and scalable to the size of a network.Therefore, distributed algorithms are more attractive for large-scale resource-constrained WSNs.
In this paper, we propose a distributed weighted search localization algorithm (WSLA) for node localization in WSNs.The WSLA adopts a modified RSSI-based range model to estimate the distances between nodes, and it employs a novel search method to compute node positions.To the best of knowledge, our contributions are as follows: (i) In order to make the simulation results more consistent with the measured results of RSSI-based range model, we point out that the variance of the Gaussian random variable in the log-normal distribution path loss model should be proportional to the real distance.
(ii) We propose a novel weighted search method, which has a heuristic search process, to solve the node localization problem in WSNs.
(iii) In order to further improve the localization accuracy of our method, we propose a FIFO-based localization precision classification scheme, a processing scheme for localizing the special nodes, and a simple scheme for detecting nodes with a large localization error.
(iv) We have evaluated the performance of the WSLA using extensive simulations, and the simulation results show that the localization performance of the WSLA is superior to that of three state-ofart localization algorithms, namely, maximum likelihood estimation (MLE), edge-based second-order cone programming + nonconvex sequential greedy (ESOCP + NCSG), and particle swarm optimization (PSO).
The remainder of this paper is organized as follows.In the next section, we review the related work about rangebased localization.The RSSI-based range model in this paper is discussed in Section 3. In Section 4, we propose the WSLA in detail.The simulation experiments appear in Section 5, and we conclude this paper in Section 6.

Related Work
Range-based localization is often modeled as an optimization problem with an objective function that depends on the distances and positions of nodes.In general, even in the absence of range errors, it is possible to have a nonconvex optimization problem with many local minima.Therefore, it is impossible to localize nodes at their true positions with noisy range.The solution to the localization problem can be roughly divided into two categories: one based on mathematical optimization theories and the other based on intelligent search methods.MLE is a simple method for computing the extreme values of math functions with limited computational complexity [12].MLE and its improvement versions have become the basic methods used for WSN localization.The performance of MLE-based localization is very good in the absence of range errors.However, its localization accuracy deteriorates rapidly with noisy range.Multidimensional scaling (MDS) is another kind of classic range-based algorithm, and a set of localization algorithms based on MDS is proposed in [13].In [14], Costa et al. proposed distributed weighted MDS for localization, which adopts a weighted cost function, an adaptive neighbor selection method, and a majorization method to achieve node localization.
Recently, a number of approaches that relax the original localization nonconvex problem to derive a convex problem have been proposed.After relaxation, the convex problem can be efficiently solved using the currently available optimization techniques, such as the interior point method.Two convex relaxation techniques are involved in these algorithms: semidefinite programming (SDP) relaxation in [15,16] and second-order cone programming (SOCP) relaxation in [11,17,18].Compared with SDP relaxation, SOCP relaxation, although weaker (and thus less accurate), has a simpler structure and allows for efficient distributed implementation.The drawback of the relaxation methods is that even when the original problem is uniquely localizable, the relaxed problem may not be [19].In addition, both SDP and SOCP rely on a sophisticated optimization package that cannot be easily implemented on a sensor node with limited resources.
Search-based localizations are another kind of WSN localization algorithm, and this kind of algorithm has the potential to achieve relatively high accuracy with relatively low complexity.Zhang et al. achieved localization with genetic algorithm (GA) in [20], which adopts two new genetic operators: single-vertex-neighborhood mutation and descend-based arithmetic crossover.Kulkarni and Venayagamoorthy proposed a distributed particle swarm optimization (PSO) approach for localization in [21].Shekofteh et al. proposed a localization algorithm based on tabu search (TS) and simulated annealing (SA) in [22], where TS is a dynamic neighbor search technique that drives the search by escaping from local optima and avoiding the cycling.Wang et al. proposed a sequence search (SS) based localization algorithm in [23] that can improve localization accuracy by optimizing the localization sequence.Manjarres et al. proposed a harmony search (HS) localization algorithm in [24] that mimics the improvisation process of musicians seeking the best harmony.The main drawback of these search-based algorithms is that the search points are generated randomly, which results in a very slow convergence process, and they cannot ensure convergence to the global optima.

Improved RSSI Range Model
The basic idea of the RSSI range model is to estimate the distance between the receiving and the transmitting nodes by measuring the transmitted loss rate of the radio signal, and its key is the path loss model of signal propagation.The most used path loss model in RSSI range is the lognormal distribution model [4], which is as follows: where  0 is the reference distance;  is the distance between the transmitting node and the receiving node;  , ( 0 ) is the path loss at  0 distance to the transmitting node;   is the path loss constant and usually equals 2∼6; and   is a Gaussian random variable with a mean of 0 and a variance of .According to (1), the distance  can be obtained as follows: In ( 2),   (dbm) is the power of the transmitting node, and   (dbm), measured by RSSI, is the power of the receiving node.In the traditional RSSI range model,   and  are assumed to be a constant value.Using this model, when   = 3, ( 0 ) = −30 dbm,   = 0dbm, and  = 2, the RSSI simulation data are as shown in Figure 1.We find that theoretical RSSI data and the simulated average RSSI data match very well.
The actual measured RSSI data in [25] are shown in Figure 2. We can see that there exists a visible difference between Figures 1 and 2, which shows that the traditional RSSI-based range model is too optimistic.
According to the results in [25][26][27], the features of the measured RSSI data in the open outdoor environment are as follows: (i) The actual measured RSSI value is close to the estimated value of (1) when the distance is small (e.g., shorter than 10 m) but fluctuates around the estimated value of (1) when the distance is far.(ii) The actual measured RSSI value is a normal distribution at the same point.(iii) Range error is proportional to distance, which means the error is small when the distance is short, and longer distances result in more errors.
Therefore, in our RSSI range model, we assume   = 3, ( 0 ) = −30 dbm, and   = 0 dbm, but we also assume that  =  × . is used to control the total noise level, and  indicates that the range error is proportional to the distance.Using this model, the simulated RSSI data are shown in Figure 3.We can see that Figure 3 is more consistent with Figure 2 compared with Figure 1.

Localization Problem in WSNs.
The WSN can be represented by an undirected graph G = (N, E), where N is the set of all sensors and E is the set of edges.The set N consists of a set of anchors, N A , a set of unknown nodes, N U , and N = N A ∪ N U .We denote xr  as the real coordinates of a node , and xr  is 2-dimension vector.An edge (, ) ∈ E if nodes ,  are neighbors; that is, they are in the communication range, , of each other:   = ‖xr  − xr  ‖ ≤ , where   is the real distance between nodes  and , and ‖ ⋅ ‖ denotes the 2-norm.We denote   as the estimated distance between nodes  and  and denote D as the set of all available noisy range: D = {  | (, ) ∈ E}.The estimated coordinates of a node , xe  , could be obtained in a distributed manner by solving (3), where N  is the neighbor set of a node : (3)

The Basic Search Scheme.
The proposed WSLA runs in a round manner to recursively localize the unknown nodes.
In each round, it mainly employs a novel heuristic search method to localize the nodes as follows, where xe ()   denotes the estimated coordinates of the node  at the kth round.Step 1. Determine the initial search point xe ()  ,0 .If a node  is not localized before, the WSLA uses the centroid of its neighbors, defined in (4), as the initial search point; otherwise, it uses xe (−1)  , the localization position of the last round, as the initial search point Step 2. Take  equal interval points from the circle whose center is xe () ,0 and radius is search step, which is shown in Figure 4.In our simulations,  is equal to 8, and the coordinates of these  search points are as follows: Step 3. Calculate the value of the objective function, defined in (6), at the above  + 1 search points (including the circle center).In (6), () is the weight of the node , which is defined in (7): In order to enhance the localization accuracy, the WSLA classifies nodes into four classes-N A (anchor nodes), N H (high-precision nodes), N  (low-precision nodes), and N U (unknown nodes)-and assign a different weight for the different type of nodes, as shown in (7), by extensive simulations.The design guideline is to assign a larger weight to more accurate nodes (e.g., anchor nodes) and to assign a smaller weight to less accurate nodes (e.g., low-precision nodes): Step 4. We assume that the point xe () ,min , defined in (8), is the minimum value in the current search iteration.Then, the WSLA updates xe ()  ,0 and search step according to ( 9) and (10) for the next search iteration: Step 5. Repeat Steps 2-4 until search step is less than stop th.Finally, the estimated coordinates of a node  are xe ()  ,0 at the last search iteration, which is called the best estimated point (BEP) of the node  in the current round.
Remark 1.In (10),  is the convergence factor, which can control the convergence speed and belongs to (0, 1) in theory; stop th is the search stopping threshold.The localization accuracy and complexity of the WSLA are mainly determined by  and stop th, and generally speaking, the smaller stop th is and the larger  is, the higher the localization accuracy and complexity will be.

The Localization Scheme of Special Nodes.
In general, the BEP of a node  may be not unique if one of the following conditions is satisfied: (1) the number of its known neighbors is less than 3 or (2) its known neighbors are collinear or near collinear.This situation appears frequently in the initial several rounds of the WSLA or when the node is near to the boundary of network.From the angle of improving localization accuracy, the WSLA should ignore these nodes.However, if these nodes cannot be localized, the WSLA maybe cannot run because all nodes may not have three or more known neighbors in the first round.Therefore, to quickly realize higher localization coverage, we propose the following localization methods for these special nodes.
(1) A Node with One Known Neighbor.The first special case is that a node  has one known neighbor in the early rounds of the WSLA.In this case, any point on the circle whose center is its known neighbor and whose radius is the range distance between them can satisfy (3) or (8); the WSLA takes the position of its known neighbor as its localization position in the current round.We expect that the localization error of  will decrease with the running of the WSLA when more neighbors become known in the following rounds.
(2) A Node with Collinear or Near Collinear Neighbors.The second special case is that a node  has collinear or near collinear neighbors.A typical scene is shown in Figure 5, where node C has two neighbors, A and B, and hence the neighbors of node C are collinear.Both points P 1 and P 2 are the possible BEP because they both satisfy (3) or (8); P 1 is near node C, with a small localization error, and P 2 is far from node C, with a large localization error.Because we do not know whether the search result in Section 4.2 is P 1 or P 2 , we choose point D as the final BEP to avoid a large localization error.Similar to the first case, we also expect that the localization error of  will decrease with the running of the WSLA when more neighbors become known in the following rounds.
Point  can be obtained using the following steps: (a) Make a straight line , the connecting line of points  and .
(b) Make the vertical line of  from  1 or  2 .
(c) Take the intersection (point ) of the two lines as the final BEP of .
(ii) The distance from some element in Q  to the centroid of Ψ  is greater than the threshold   .
An example of node localization precision classification is shown in Figure 6.In Figure 6, we assume   =   = 5; that is to say, Q  is full.Because the distance from any element in Q  to the centroid of Ψ  is not greater than   in Figure 6(a), this node is classified into N H .In Figure 6(b), the distance from ( 3 ,  3 ) to the centroid is greater than   ; thus, this node is classified into N L .
In addition, we also observe that the node localization sequence has an obvious influence on the localization International Journal of Distributed Sensor Networks accuracy for some localization scenes, as described in [23].Specifically, in the initial several rounds of the WSLA, if a node with a large localization error takes part in the localization process of other nodes, its localization error may propagate due to the recursive localization method and thus results in a network localization accuracy decline.In order to avoid the emergence of this situation, in the initial several rounds (e.g., the first 30% rounds), the WSLA employs the following method to detect the node with a large localization error.
4.5.The Specific Flow of the WSLA.The specific steps of the WSLA in each round are as follows.
Step 1 (node broadcasting).All nodes except unknown nodes broadcast their messages, for example, transmitting power, ID, coordinates, and types, at the beginning of each round.
Step 2 (RSSI ranging).All nodes except anchor nodes receive messages from their neighbors and calculate the range distances according to (2).In our simulations, each node carries out 10 RSSI ranges in each round, and the final range distance is the average results.
Step 3 (node localization).If the number of known neighbors of node  is larger than 1, the WSLA employs the search method in Section 4.2 to search its BEP.
Step 4 (Special node processing).If node  is a special node, the WSLA employs the scheme in Section 4.3 to compute its new BEP.
Step 5 (node classification).The WSLA puts the BEP into queue Q  and determines the localization type of the current round based on the Rules 1-3 in Section 4.4.
In addition, when the position errors of anchor nodes is not zero, the WSLA degrades the anchor nodes into low precision nodes to refine their positions after running 15 rounds.

Simulation Experiments
To prove the localization accuracy of the WSLA, we have carried out extensive simulations using MATLAB software.

Experiment Parameters.
The default simulation parameters are as follows: the number of total nodes is 108, including 8 anchor nodes and 100 unknown nodes; the positions of the anchor nodes are fixed and their coordinates are [0.1, 0.1], [0.1, 0.5], [0.1, 0.9], [0.5, 0.1], [0.5, 0.9], [0.9, 0.1], [0.9, 0.5], and [0.9, 0.9]; the unknown nodes are uniformly distributed in a square region of 1 × 1; the communication range  = 0.22, leading to an average connectivity of the nodes of about 13; and  = 0.3, initial step = 0.75 × , max round = 60,   = 0.01R, and stop th = 0.01 × ; in addition, we set err th = 0.005 + 0.1 × , and  is the maximum position errors of the anchor nodes; that is, ‖xe  − xr  ‖ ≤ ,  ∈ N A , where xr  and xe  are the real coordinates and the localized coordinates of the node  and the default value of  is 0.2.The experimental results are the averaged results of 30 experiments, and the range error   and localization error   , defined in ( 14) and ( 15 In ( 14),   and   are the range distances and the real distances between nodes  and ;  is the total range time.

The Performance of the WSLA
(1) The Convergence Process of the WSLA.We first examine the convergence performance of the WSLA in the ideal range condition, that is,  = 0, leading to   =   .In this experiment, we reset the following parameters: stop th = 0.001 × ,   = 0.001, max round = 120,  = 0, and  = 0.The convergence process of the WSLA is presented in Figure 7.
From Figure 7, we can observe the following.(1) The WSLA is convergent, and the localization error in the initial several rounds is relatively large because the number of known neighbors of each node is relatively small.(2) Even in ideal conditions, the WSLA cannot converge to 0. In our 30 experiments, the best scene and the worst scene converge to about 0.001R and 0.021R, respectively, and all scenes converge to about 0.006R on average.The reason that the WSLA cannot converge to 0 is because stop th is not equal to zero, and sometimes the WSLA may fall into the local optima.(3) The convergence process is not strictly monotonic.After the WSLA runs about 60 rounds, the average localization error is near 0.01R, and it decreases only 0.004R during the last 60 rounds.Therefore, in the following experiments, we set that max round = 60.
(2) The Relationship between   and stop th.Second, we examine the relationship between   and stop th in the ideal range condition.In this experiment, nf = 0, na = 0, and the other parameters are set to their default values.The relationship between   and stop th of the WSLA is presented in Figure 8. From Figure 8, we can see that the correlation between   and stop th is significant.Specifically, the smaller stop th is, the lower the localization error will be.However, a small stop th means more search points and thus the time complexity of the WSLA will increase.In addition, when stop th equals R, the WSLA will degrade into a centroid localization algorithm because it cannot search any points.In order to achieve the tradeoff between localization error and complexity, in the following experiments, we set stop th to 0.01R, which means that the WSLA searches 7 iterations and a total of 57 points in each round.Figure 8 also shows that the WSLA makes a vast improvement compared to the centroid localization algorithm when stop th = 0.01R.
(3) The Relationship between   and nf or na.Third, we show the localization performance of the WSLA with the variation of nf or na, and the results are presented in Figure 9.
From Figure 9, we can see the following.(1) Both range errors and localization errors increase with the growth of nf, but range errors increase faster than localization errors.(2) The WSLA is more sensitive to na than nf.Specifically, the change of   is up to about 0.1R when na varies from 0 to 0.5R, and by comparison, the change of   is only about 0.007R when nf varies from 0 to 0.5.
(4) The Relationship between   and the Node Connectivity.In this experiment, we set nf = 0.3 and na = 0.2R, and vary the node connectivity by changing the number of unknown nodes.The relationship between   and the connectivity is shown in Figure 10, and we find that (1)   decreases with the growth of the connectivity, and (2) after the average connectivity of the nodes reaches 22, the change of   is very small.
(5) The Localization Results of a Typical Scene.Finally, we give the straightforward localization results of one typical scene.In this experiment, all parameters are default values.The reason we choose this scene is that its localization error is slightly larger than the average localization error.In Figure 11 Figures 11(a)-11(c), we can obviously see that the localization error becomes gradually smaller, and from Figure 11(d), we can see that the   of 88% nodes is less than 0.15R.Therefore, the localization performance of the WSLA is good.

Performance Comparison with MLE, PSO, and ESOCP + NCSG.
In this section, we have compared the localization error of the WSLA with that of MLE [12], ESOCP + NCSG [11], and PSO [21], which are three representatives of state-ofart localization algorithms.Specifically, MLE is representative of a simple localization algorithm, PSO is representative of a search-based localization algorithm, and ESOCP + NCSG is representative of a complex relaxation-based localization algorithm.In this experiment, we use the range model in [11], as shown in (16); the other parameters are the same as the default parameters.The parameters of PSO are set as follows: population = 30, iterations = 60; acceleration constants  1 =  2 = 2.0; inertial weight is decreased linearly from 0.9 in the first iteration to 0.4 in the last iteration.In addition, to better demonstrate the performance of the WSLA, we also show the performance of the basic search localization algorithm (SLA), which does not employ a localization precision classification scheme, a processing scheme for special nodes, and a simple scheme for detecting nodes with large localization errors.The experimental results are shown in Figure 12: where   and   are the range distance and real distance, respectively; nf also represents the error level; rand n is the random variable subjected to standard normal distribution N (0, 1).
From Figure 12, we can see the following: (1) The localization performance of the WSLA is the best of these five algorithms.(2) MLE and ESOCP + NCSG are more sensitive to range errors than PSO, SLA, and the WSLA.
(3) All the algorithms are sensitive to the position errors of anchor nodes.The explanations for the high performance of the WSLA are as follows.(1) Compared with PSO, the WSLA has a heuristic search process and can significantly reduce the number of search points, for example, it searches 57 points per node, while PSO searches 1800 points per node in each round.(2) Compared with ESOCP + NCSG, the WSLA does not carry out its objective function in any form of relaxation.
(3) Compared with MLE, the WSLA has better fault tolerance to range errors and the distribution of neighbors.(4) More importantly, the WSLA has integrated three schemes, namely, a FIFO-based localization precision classification scheme, a processing scheme for localizing the special nodes, and a simple scheme for detecting nodes with large localization errors, to further improve its localization accuracy.

Conclusion
The localization technique is one of the key techniques in practical WSN application.On the basis of analyzing the error distribution features of the traditional RSSI-based range model and the measured RSSI data, we improve the RSSIbased range model.We also propose a novel WSLA, which is a range-based heuristic distributed localization algorithm for WSNs.The innovative ideas of the WSLA include a FIFO-based localization precision classification scheme, a processing scheme for special nodes, and a weight-based search.The performance of the WSLA is evaluated by comparing it with three state-of-art localization algorithms, namely, MLE, ESOCP + NCSG, and PSO.The experimental results show that the localization performance of the WSLA is superior to that of MLE, ESOCP + NCSG, and PSO.The features of our algorithm are distributed, low complexity with () ( is the number of one-hop neighbor nodes), easy  International Journal of Distributed Sensor Networks implementation, and high localization accuracy.Therefore, it has good reference value in engineering practice.Our future works will study the adaptive parameter settings of the WSLA and evaluate its localization performance in real WSNs.

Figure 4 :
Figure 4: The proposed heuristic search scheme.

Figure 6 :
Figure 6: An example of node localization precision classification.

Figure 7 :
Figure 7: The convergence process of the WSLA.

Figure 8 :
Figure 8: The relationship between   and stop th.

Figure 9 :Figure 10 :
Figure 9: The relationship of between   and nf or na.

Figure 11 : 1 Figure 12 :
Figure 11: The localization results of one typical scene.

10
is full, namely,   =   .(ii)The distance from any element in Q  to the centroid of Ψ  is not greater than a threshold   .
4 4.4.Node Localization Precision Classification Scheme.We define a FIFO queue Q  with a size of   for each node , and we denote   as the quantity of the elements in Q  .After each round, we put the BEP of node  into queue Q  and calculate the centroid of polygon Ψ  which is formed by all elements in queue Q  .Rule 2. The WSLA classifies node  into N L if any of the following conditions are satisfied: