Scalable SOCP-based localization technique for wireless sensor network

Node localization is one of the essential requirements to most applications of wireless sensor networks. This paper presents a detailed implementation of a centralized localization technique for WSNs based on Second Order Cone Programming (SOCP). To allow scalability, it also proposes a clustered localization approach for WSNs based on that centralized SOCP technique. The cluster solves the SOCP problem as a global minimization problem to get positions of the cluster sensor nodes. To enhance localization accuracy, a cluster level reﬁnement step is implemented using Gauss-Newton optimization. The initial position for the Gauss-Newton optimization is the position drawn from the preprocessor SOCP localization. The proposed approach scales well for large networks and provides a considerable reduction in computation time while yielding good localization accuracy


Introduction
A wireless sensor network (WSN) is a group of a few to several hundreds or even thousands of sensor nodes deployed over a significant area.WSNs have a wide range of applications which include environmental monitoring, target tracking, home automation, military applications and others.To process sensor data in WSN, it is imperative to know where the data is coming from.So, knowledge of nodes locations is an essential requirement for many location-aware applications including aforementioned applications, location-based services (LBS) and location-based routing.Several surveys discussed localization strategies and attempted to classify different localization techniques like [1], [2], [3].Localization techniques could be classified according to all calculations being performed on a single node or distributed on all the network sensor nodes to centralized localization technique (e.g.MDS-MAP [4] and Semi-Definite programming (SDP) [5]) and distributed localization technique (e.g.APIT [6]).Another new approach in this classification is called locally centralized or cluster-based localization techniques which are distributed techniques that achieve a global goal by communicating with nodes in some neighbourhood only.According to the process of estimating node-tonode distances or angles, the localization techniques are classified to range-based and range-free localization techniques.Range-based localization techniques are based on distances measurements between the nodes using Time of Arrival (TOA), time difference of arrival (TDOA) and received signal strength (RSS) (e.g.Trilateration) or based on angles between the nodes like angle of arrival (AOA) (e.g.Triangulation) [7].Rangefree localization techniques depend on network connectivity (e.g.DV-HOP) [6] to indirectly obtain the distances between the nodes.Also, localization techniques can be classified to anchor-based or anchorfree localization techniques.Anchor-based localization techniques usually provide absolute positions for the nodes whereas anchor-free localization techniques provide relative positions.Biswas and Ye who proposed a semi-definite programming (SDP) relaxation of the localization problem which has various nice properties [5].SOCP-based localization technique was studied by Tseng [8] who provided a second order cone programming (SOCP) relaxation of localization problem, motivated by its simpler structure and its potential to be solved faster than SDP.This paper proposes a locally centralized technique for solving the sensor network localization problem.It is a Refined Clustered technique based on Second-Order Cone Programming (RC-SOCP).The proposed approach divides the large network into smaller sub networks.For each cluster, the cluster solves the SOCP problem as a global minimization problem to get initial positions of the cluster sensor nodes.To enhance localization accuracy, a cluster level refinement step is implemented using Gauss-Newton optimization.The initial position for the GaussNewton optimization is the position drawn from the preprocessor SOCP localization.Rest of the paper is organized as follows: Section 2 introduces the centralized SOCP localization technique.Proposed technique is presented in section 3. Simulation results and evaluations are presented in section 4 and we conclude in section 5.

Centralized SOCP localization technique
This section discuses a detailed description of SOCP problem formulation for Castalia wireless sensor networks simulator, providing the formulation algorithm and solver tools.It also investigates the results obtained.

Problem formulation
Second-order cone programming relaxation method for wireless sensor network localization was first studied by Tseng [8].In this method n is the total number of nodes in R d (d ≥ 1), m are the nodes whose locations x i ∈ R 2 , i =1,...,m are to be determined given n-m nodes called anchors with known locations and d ij which is the euclidean distance between nodes i and j where (i,j) ∈ A. A is the undirected neighbour set defined as A := {(i, j) : ||x i − x j || ≤ RadioRange}.The problem is formulated as the non-convex minimization equation Where || .|| denotes the euclidean norm.Then in order to yield a convex-problem, the equality constraints are relaxed to non-equality constraints, the problem becomes 2) can be rewritten as

Centralized SOCP localization implementation
Given a wireless sensor network with size n sensors, m are sensors with unknown locations, n − m are sensors with known locations (anchors).To solve this localization problem, the centralized SOCP localization technique is performed in three phases.In the first phase, nodes estimate their distances with sensor and anchor neighbours which are within their communication ranges.The second phase involves wireless communication and routing between the nodes.In the third phase, the positions matrix and the lower triangle of the distances matrix are created with sizes 2×n, n×n respectively and filled with their relevant data received from the nodes.Distances Matrix where d ij is the euclidean distance between nodes i,j.

Positions Matrix
x 0 x 1 x 2 .. x n y 0 y 1 y 2 .. y n where x i ,y i are the x,y co-ordinates of an anchor node or 0,0 if the sensor node is not an anchor.Algorithm 1 shows the pseudo-code of formulating the SOCPlocalization problem according to equation (3).For a network of n total nodes and m non-positioned nodes, there are Ω(m) variables and Ω(m) inequality constraints using position and distance matrices [8].

Performance Evaluation
We evaluate the performance of the centralized SOCPbased localization by measuring localization accuracy, computation time and problem size.The mean error between the estimated and the true location of the non-anchor nodes in the network is adopted as the performance metric.It is defined as follows Where LE denotes a localization error, N denotes the number of nodes in a network whose location is estimated, x i is the true position of the node i in the network , xi is estimated location of the node i (solution of the location system).Computation time is defined as the time spent for formulating and solving the SOCP problem at the sink node and it is measured using C++ std.clock() function.
The time needed for computing the relative distances at the nodes and communication or message exchanges time is excluded.Problem size corresponds to number of variables and constraints for the SOCP-localization problem formulated at the sink node.We evaluate performance of the centralized SOCPbased localization technique by studying the effect of varying Network size (number of nodes), Anchors percentage, Communication radio range and Noise value added to distances measurements.
Anchors Anchors are chosen to form a convex hull distribution around the sensor nodes in the network.This distribution was chosen to assure good localization accuracy when non-anchor nodes are in the convex hull of the anchors [11].
Radio range Radio range is specified by replacing the path loss parameter P L(d) of the log-normal shadowing model in equation ( 4) with its equivalent Equation( 4) calculates the average path loss in the channel model in Castalia [13].Setting the random variable X σ to 0 for the case of no fading, thus simulating general environment conditions where stationary WSN is deployed in fairly static environments and fading is not very significant, thus it is ignored.η is substituted with 2.4 which is typical default value that will produce results similar to many outdoors (and sometimes indoors) environments.d is the path length allowing communications between two paired nodes, thus representing the radio range.So, the radio range can be specified by P Rx is inferred from ReceiverSensetivity value of the radio card chosen (radio model for CC2420 chip by Texas instrument) and is qual to -95 dBm.So the radio range is mainly controlled by the transmit power and the path loss at reference distance values specified according to RR = 10 P T x +95−P L(d 0 )/24 (6) The degree of connectivity is controlled by the radio range specified.It is calculated as the average connectivity of all the nodes which is equivalent to the average number of neighbours for all of the sensor nodes in the network for a specific radio range and environment area.

Noise to distance
We added normally distributed measurement noise to the true distance according to the equation Where ij is a normal random variable N(0, 1) representing measurement noise and nf d ∈ [0, 1] is the noise factor (standard deviation of the distance error in percentage) for the distance measurements [9].

Simulation Results
Simulations are conducted for a randomly generated 500 nodes uniformly distributed on the unit square area [-0.5, 0.5] 2 with noise factor (nf d)=0.05,radio range (rr)=0.17and Degree of Connectivity=38.Anchors are chosen to form a convex hull distribution around the sensor nodes in the network with percentage (p) of 15%.Simulations are averaged over 10 runs with confidence level of 95%.Simulations were carried out on a PC with 2.4 GHz Quad-Core processor and 4 GB RAM using Castalia simulator integrated with IBM CPLEX solver using C++ interface.Effect of Varying Network Size.Fig. 2 shows the CDF of localization errors (log scale) for different network sizes with the same radio range in the same area for a network with nf d=0.05, rr=0.11 and anchor percentage of 15%.Fig. 2 shows that when the network size increases in the same area, the degree of connectivity is increased and this leads to larger communications between nodes.Consequently, more distances are obtained between nodes which directly improves the localization accuracy.On the other hand, it must be noted that increasing node density and hence communications between nodes increases network overhead and energy consumption.
The mean localization errors (LEs), and their confidence intervals are listed in table 1 which shows a decrease in mean localization error when increasing the network size.Table 2 shows the number of variables, number of constraints, and the computation runtime spent for solving the networks in Fig. 2. Computation runtime grows with increasing network size, thus limits the scalability of the technique for large networks.shows that networks with lower radio range have higher localization error.This is due to less internode communications and hence distances information between nodes.It must be noted that for rr=0.08,97% of total nodes are localized (413 node) whereas 100% of total nodes are localized for rr=0.1, 0.15.However, increasing radio range increases power consumption and adds more communication overhead to the network.The mean localization errors (LEs) and their confidence intervals are listed in table 5.
Performance and computation runtime comparison is shown in table 6.

Effect of Varying Noise Value Added to Distances
Measurements.Fig. 5 shows the effect of changing nf d on the localization accuracy.Fig. 5 shows that there is no

Implementing SOCP on cluster-head
At the end of the clustering phase, the network is divided into multiple independent clusters.Each cluster of size CN sensors, CM sensors with unknown locations and CN − CM sensors with known locations (anchors).Member nodes send their relevant distance information with their neighbours to their elected CHs.Each CH constructs the positions matrix and the lower triangle of the distance matrix of sizes 2×CN, CN×CN respectively as in centralized technique then formulates SOCP localization problem for its cluster member nodes according to algorithm 1 and uses CPLEX optimization solver to estimate the positions of the nodes.

Refinement phase
To enhance localization accuracy of clustered SOCP (C-SOCP), a cluster level refinement step is implemented.Each cluster head solves the network localization problem using Gauss-Newton (iterative least-squares) algorithm [11].The initial position guess for the Gauss-Newton optimization is the positions drawn from the preprocessor SOCP solver which is close to the global solution.Given m residual functions r = (r 1 , ..., r m ) of n variables X = (X 1 , ..., X n ), with m ≥ n, a non-linear least square problem is an unconstrained optimization problem of the form The Gauss-Newton algorithm iteratively finds the minimum of the sum of the squares in equation (7).
For implementing the Gauss-Newton method as a refinement step, where X refers to the position coordinates of the sensor node (x,y), and hence n is set to 2. m is the number of residuals, and is equal to the number of anchor neighbours to that sensor node.The residual function r i is defined as Where a represents the positions of the anchor node (a x , a y ) and d is the estimated distance between the sensor node and the non-positioned node.Starting with an initial guess X (0) for the minimum, the method proceeds by the iterations Where the symbol T denotes the matrix transpose.If r and X are column vectors, the entries of the Jacobian matrix are The derivative of the residual function to the first variable x is: r i (X (s) ) And the derivative of the residual function to the second variable y is: Let delta = matrix of size 2 × 1 of values for updating x,y coordinates of node i 13: for j = 0 to iters do 14: end for 24: delta ← ( ( ( ( J T J )J T ).inverse() )J T ) distanceN oise end for 28: end for Algorithm 2 shows the pseudo-code of the Gauss-Newton algorithm for refining the locations obtained from C-SOCP.

Performance evaluation of RC-SOCP
RC-SOCP performance is evaluated by measuring localization accuracy and computation time.The localization accuracy is calculated as defined in section 2.4.To calculate RC-SOCP computation time, we calculate C-SOCP runtime and Gauss-Newton refinement algorithm runtime on each CH.The computation time metric is measured as the maximum RC-SOCP computation time among CHs.C-SOCP runtime is the time spent for formulating and solving the SOCP problem on the CH using C++ std.clock() function.The time needed for computing the relative distances at the nodes and communication or message exchanges time is excluded.We evaluate the performance of RC-SOCP localization technique by studying the effect of varying: cluster size , anchor percentage, communication radio range, noise value added to distances measurements.

Simulation results
Simulations are conducted for a randomly generated 500 nodes uniformly distributed on the unit square area [-0.5, 0.5] 2 with noise factor(nf d) = 0.05, radio range(rr) = 0.17  8.
Fig. 7c shows that RC-SOCP and centralized-SOCP lead to improved results for localization error compared to C-SOCP.Table 8 shows that, in RC-SOCP, a high percentage of nodes ( 90%) have a small localization error (<0.006), while the corresponding percentage of nodes is 59.9% in C-SOCP.However, due to the increase in the localization error of some of boundary nodes (outliers) of the network in RC-SOCP, the maximum localization error for both C-SOCP and RC-SOCP is the same(<0.35).It is worthy noting that RC-SOCP and centralized-SOCP has almost the same localization accuracy for most of nodes (>90%) which is (<0.006).For less than 10% of the nodes, there is a slight improvement in accuracy for centralized-SOCP.RC-SOCP provides a considerable reduction in computation time compared to centralized-SOCP due to clustering while still yielding good localization accuracy and scalability.

The effect of varying cluster Size
To study the effect of varying cluster size on localization error and computation time, we set the number of consecutive hops (d) to 1, 2, 3 and 4. Fig. 8 shows CDF of localization errors (log scale) for C-SOCP and RC-SOCP with different d.Table 9 shows number of clusters, C-SOCP runtime, Gauss-Newton runtime and RC-SOCP runtime of networks.Fig. 8 shows that the refinement phase of RC-SOCP enhances the result of the preprocessor C-SOCP.C-SOCP is highly dependent on cluster size compared to RC-SOCP.As the cluster size increases, the localization accuracy is improved since more nodes distances information is obtained at the CH.These distances information directly affect and enhance the formulation of the sub problems and hence improve the result of the SOCP problem solver.However, increasing cluster size increases the problem size and computation time and communication overhead of the cluster.For RC-SOCP, the localization accuracy is increased when d is increased from 1 to 2. For d ≥ 2, there is not significant difference in localization accuracy for different cluster size (d), since refinement algorithm reaches the optimal solution for the estimate of locations of the nodes.So, adjusting cluster size using d = 2 which is approximated to number of clusters around 11 in this network size(500 nodes) as shown in table 9 yields good accepted localization accuracy.Table 9 shows that incrementing the cluster size d reduces the number of clusters approximately to the

The effect of varying anchors percentage
To investigate the effect of varying anchors percentage on localization error and computation time, we change number of anchor nodes to 10%, 20%, 30% and However, increasing number of anchors often imposes additional costs.Table 11 shows that the number of clusters and computation runtime time are increased with increasing the number of anchors.This happens due to the increase of the total number of nodes in the network.Table 12 shows a reduction in LE when increasing anchors percentages in both C-SOCP and RC-SOCP.

The effect of varying communication radio range
To study the effect of changing radio range on localization accuracy, we set rr to 0.08, 0.1, 0.15 and 0.17.Fig. 10 shows that for C-SOCP and RC-SOCP, higher radio range leads to higher degree of connectivity and hence results in higher localization accuracy.It is noticed in

Figure 2 .
Figure 2. CDF of localization errors (log scale) for different network sizes

Figure 3 .
Figure 3. CDF of localization errors (log scale) for different percentage of anchors

Figure 4 .
Figure 4. CDF of localization errors (log scale) for different radio ranges

Figure 5 .
Figure 5. CDF of localization errors (log scale) for different nf d performance by reducing computation time, energy consumption, and communication overhead resulting from numerous communications overhead between the nodes in centralized localization approach.Its architecture is divided into three phases as shown in Fig.6: clustering phase, localization phase and refinement phase.In the first phase, Min-Max d clustering algorithm is used to divide the network and select the CH according to the IDs of the nodes.In the second phase, each cluster implements SOCP-based localization technique to localize the member nodes including the CH itself.In the third phase, each cluster implements Gauss Newton local algorithm to refine the estimated locations obtained.

2 : 8 : 9 :
based localization technique for wireless sensor network Algorithm 2 : Gauss-Newton Algorithm 1: procedure GAUSSNEWTON(distanceMatrix, positions-Matrix) Let iters = number of iterations , neighbours = array of anchor neighbours 3: for all node i do 4: i x ← initial guess of x coordinate for node i 5: i y ← initial guess of y coordinate for node i 6: n ← number of neighbours of node i 7: neighbours ← getNeighboursOfNode(i) Let distanceEstimate = array of distances estimations with anchor neighbours of size n × 1 Let distanceNoise = array of distances noises between estimated distances and distances of initial guess n × 1 10: Let J = jaccobian matrix of size n × 2 11: Let J T = transpose Jacobian matrix of size 2 × n 12: , d = 3 and Degree of Connectivity = 37.Anchors are chosen to be uniformly distributed throughout the network with percentage(p) of 30%.Number of Gauss-Newton iterations is 25.Simulations are averaged over 10 runs with confidence level of 95%.Figs.(7a) and (7b) show a snapshot of the true sensor positions and the estimated positions of the C-SOCP and RC-SOCP respectively.True positions of the sensors are depicted in blue colored points and the estimated node positions are depicted in red colored points, solid lines indicate the error between the estimated and true sensor positions.An improvement in localization accuracy is observed for RC-SOCP compared to C-SOCP.It is also observed that the estimated positions become less accurate as we move towards the boundaries of the clusters in C-SOCP which is greatly refined in RC-SOCP.The mean localization error (LE) for the network in fig.7 using C-SOCP is 0.02 and standard deviation 0.04, and LE is 0.01 and standard deviation 0.04 for RC-SOCP.This clarifies that the mean error is reduced by 50% using RC-SOCP.Fig.7c shows a comparison between the Commulative distributive function (CDF) of localization errors resulting from centralized-SOCP localization implemented in section 2, C-SOCP and RC-SOCP.The detailed CDF of localization errors for the results in fig.7c are listed in table

Figure 8 .
Figure 8. CDF reaults of localization errors (log scale) for different cluster sizes half.As a result of increasing cluster sizes, C-SOCP and RC-SOCP run times are increased while Gauss-Newton runtime has no significant change.Table 10

Figure 9 .
Figure 9. CDF results of localization errors(log scale) for different anchors percentage 40% of the number of non-positioned nodes while maintaining the number of non-positioned nodes the same (500 non-positioned nodes), rr = 0.11 , d = 2 and nf d = 0.05 for C-SOCP and RC-SOCP.Fig.9shows that increasing anchors percentage considerably increases the localization accuracy for both C-SOCP and RC-SOCP; and RC-SOCP has good localization accuracy compared to C-SOCP.Appropriate percentage of anchors ensures that each cluster has an acceptable number of anchors to perform the localization problem.However, increasing number of anchors often imposes additional costs.Table11shows that the number of clusters and computation runtime time are increased with increasing the number of anchors.This happens due to the increase of the total number of nodes in the network.Table12shows a reduction in LE when increasing anchors percentages in both C-SOCP and RC-SOCP.
Our simulation study is carried out using version 3.2 of Castalia which build upon version 4.1 of OMNet++.The implementation of our SOCP-based localization technique uses IBM ILOG CPLEX.IBM LOG Concert Technology (modelling layer) C++ Interface Of OPL was used to integrate our problem model in Castalia with the CPLEX solver[15].

Table 1 .
Mean localization errors for different network sizes Effect of Varying Anchors Percentage.Fig.3shows the effect of changing anchor percentage on the localization accuracy for a network of 500 nodes, rr=0.17 and nf d=0.05.We changed number of anchor nodes while maintaining number of non-positioned nodes the

Table 2 .
Performance and computation runtime comparison of different network sizes.

Table 3 .
Mean localization errors for different anchor percentages total complexity of the computations.This is shown in table4.Effect of Varying Communication RadioRange.To study the effect of changing radio range on localization 5 and Intelligent Systems 09 2015 -01 2016 | Volume 3 | Issue 6 | e5 EAI Endorsed Transactions on Industrial Networks EAI European Alliance for Innovation Scalable SOCP-based localization technique for wireless sensor network

Table 4 .
Performance and computation runtime comparison of different anchor percentages.

Table 6 .
Performance and computation runtime comparison of different radio ranges.

Table 7 .
Mean localization errors for different nf d RC-SOCP is a refined clustered SOCP localization technique to allow scalability of the centralized SOCPlocalization technique for large dense networks with thousands of nodes.This technique achieves better6 and Intelligent Systems 09 2015 -01 2016 | Volume 3 | Issue 6 | e5 EAI Endorsed Transactions on Industrial Networks EAI European Alliance for Innovation Sh.Eman, M. Randa

Table 8 .
CDF results of localization errors

Table 9 .
Performance and computation runtime comparison of different cluster sizes.

Table 10 .
Mean localization errors for different cluster sizes for C-SOCP and RC-SOCP increasing the cluster size reduces LE in C-SOCP significantly for all d whereas it leads to slightly improved LE in RC-SOCP for d ≥ 2.

Table 11 .
Performance and computation runtime comparison of different anchors percentages.
table 14 that for the network with rr =0.08, C-SOCP has a better localization accuracy for 50% of the nodes (LE =0.032) than in RC-SOCP (LE=0.038).This refers to low degree of connectivity for rr=0.08 and less distances information for C-SOCP resulting in bad initial guess 10 and Intelligent Systems 09 2015 -01 2016 | Volume 3 | Issue 6 | e5 EAI Endorsed Transactions on Industrial Networks EAI European Alliance for Innovation