Hard Decision-Based Cooperative Localization for Wireless Sensor Networks

Reliable and accurate localization of objects is essential for many applications in wireless networks. Especially for large-scale wireless sensor networks (WSNs), both low cost and high accuracy are targets of the localization technology. However, some range-free methods cannot be combined with a cooperative method, because these range-free methods are characterized by low accuracy of distance estimation. To solve this problem, we propose a hard decision-based cooperative localization method. For distance estimation, an exponential distance calibration formula is derived to estimate distance. In the cooperative phase, the cooperative method is optimized by outlier constraints from neighboring anchors. Simulations are conducted to verify the effectiveness of the proposed method. The results show that localization accuracy is improved in different scenarios, while high node density or anchor density contributes to the localization. For large-scale WSNs, the hard decision-based cooperative localization is proved to be effective.


Introduction
Location awareness is rapidly becoming an essential feature of many commercial, public service, and military wireless networks [1][2][3]. Most of the time, data recorded from a wireless sensor only make sense if correlated with a position. For example, the sensors in the wireless sensor network (WSN) for environment monitoring need to be accurately oriented or localized in order to sense, report, and process relevant environmental events [4,5]. Conventional techniques are not adequate for providing seamless and high-accuracy location awareness in harsh environments. For example, the global positioning system (GPS) does not operate well indoors or in urban canyons due to signal blockage [6][7][8]. Hence, new localization techniques are required to meet the increasing need for accurate localization in such harsh environments.
Inspired by their promising applications, researchers have developed many localization systems using different wireless measurements, which are categorized as range-based and range-free methods. The range-based methods, such as time of arrival (TOA) [9], time difference of arrival (TDOA) [10], angle of arrival (AOA) [11,12], and received signal strength index (RSSI), assume that a node is able to measure the distances or angles with respect to its neighbors. The range-free methods, such as Distance Vector-Hop (DV-HOP) [13], Approximate Point-in-Triangulation (APIT) [14], Centroid [15], and Localization Algorithm using Expected Hop Progress (LAEP) [16], assume that a node has no ability to measure the distances or angles with respect to its neighbors and uses connectivity or hop-count information to estimate the positions of the nodes. The range-based localization provides higher accuracy for distance measurement, but extra hardware required by the nodes increases its cost.
The range-free localization has a reduced cost, but its accuracy is also relatively decreased. In this paper, we explore a localization technology in large-scale networks characterized by a large node amount and a large node distribution area. Considering the cost requirement for large-scale WSNs, range-free methods are mainly considered in this paper.
Compared with range-based methods, the reason for the lower localization accuracy of range-free methods is the inaccurate estimation of node distance. To improve the localization accuracy, most research in the field is focused on the improvement of distance accuracy. Multi-hop distance estimation is one of the most popular ways to improve distance accuracy. In the field of multi-hop distance estimation, Ta et al. [17] provided an analytical recursive equation for the probability that any two sensors separated by a known distance x are k-hop neighbors for any positive integer k. Wang et al. [18] derived the expected hop progress from a network model for WSNs in terms of network parameters. Since distance estimation is a key issue in localization systems for WSNs, the proposed range-free LAEP achieves better performance and less communication overhead compared to other existing schemes. Vural et al. [19] proposed a greedy method of distance maximization and evaluated the distribution of the obtained multi-hop distance through analytical approximations and simulations. Zaidi et al. [20,21] considered that the per hop length (PHL) between different nodes might be greatly different in anisotropic WSNs, resulting in a large error in distance estimation. They proposed a novel range-free localization algorithm and derived its average location estimation error in closed form. Wang et al. [22] proposed an error compensation-based node distance estimation, which benefits from joint exploitation, at no cost, of the information provided by the adjacent areas and nodes. By exploring new ways to improve distance estimation, multi-hop methods have been applied to network localization with success. However, the information from anchors has not been fully used, since their characteristics do not accord statistical relationship.
Apart from node distance, the positions of the anchors are also essential to estimate a node position. Typical localization systems for wireless networks employ two types of nodes, i.e., anchors (infrastructures with known positions) and agents (devices with unknown positions). As the anchors and agents play different roles, the existing localization methods can be grouped in two broad categories that may be referred to as non-cooperative localization and cooperative localization. In a non-cooperative localization network, the agents do not receive the position information from other agents. Therefore, the working status of the agents will not affect the localization result. The related methods have been studied in [23][24][25][26][27]. In a cooperative localization network, the agents can obtain distance measurements from their neighboring agents. The localization method considers not only the measured positions of the anchors but also the virtual positions of the agents. Because the agent information is fully utilized in cooperative localization, its performance can be improved.
In the past decade, a plethora of cooperative localization algorithms based on different position-related signal metrics has been proposed. Wymeersch et al. [28] gave an overview of cooperative localization approaches and applied them to ultrawide bandwidth (UWB) wireless networks. They also presented a powerful localization algorithm by mapping a graphical model for statistical inference onto the network topology, which resulted in a net-factor graph, and by developing a suitable net-message passing schedule. Shen et al. [29] established the fundamental limits of wideband cooperative location-aware networks and provided a geometrical interpretation of equivalent Fisher information (EFI) for cooperative networks. This approach helps succinctly derive fundamental performance limits and their scaling behaviors and to treat anchors and agents in a unified way from the perspective of localization accuracy. Chen et al. [30] proposed a new type of power management strategies where each agent individually minimizes its square position error bound penalized by its power cost. The strategies operate as solutions to two power management games that are formulated knowing local information and global information, respectively. Cooperative localization is an emerging paradigm that circumvents the need for high-power, high-density anchor deployment and offers additional localization accuracy by enabling the agents to help each other in estimating their positions. However, most cooperative localization methods only apply to range-based situations, since range-based measurements provide higher accuracy. For range-free situations, the distance measurements have low accuracy, which directly decreases the localization accuracy. The agents with low localization accuracy do not contribute to improving the localization performance of the whole network but disrupt the whole localization system and may cause localization breakdown.
In this paper, we propose a cooperative localization model for wireless sensor networks in range-free situations. In the distance estimation phase, a multi-hop method is introduced to estimate the node distance. To improve the accuracy of distance estimation, a novel weight allocation way is proposed to offset the deviation from the multi-hop method based on the neighboring anchors. In the localization phase, a hard-decision cooperative method is proposed by analyzing the geometric relationship between agent position and distance. In this way, it is possible to eliminate unreasonable agents and avoid a large deviation by geometric constraints.
The rest of the paper is organized as follows. Section 2 presents the multi-hop distance estimation and the error compensation method. Section 3 studies the cooperative localization method with variational message passing (VMP) rules and derives the geometric constraints and iterative parameters. Numerical results are demonstrated in Section 4, and conclusions are given in Section 5.

Distance Estimation
In this section, we describe an improved distance estimation method which expands the multi-hop estimation with an exponential distance calibration. The multi-hop estimation regards a localization scenario as a uniformly distributed network, where node density is fully utilized to estimate neighboring nodes' distance in an adjacent area. The sum of neighboring nodes' distances in the shortest path is the initial distance of two nodes in the far field and it is divided into even shortest paths and odd shortest paths, manipulated in different ways. Considering the high uncertainty and randomness of the multi-hop method, we propose a calibration method to improve localization accuracy. In the sensor network, a neighboring anchor is very important to locate agents. Here, we evaluate the error range of the multi-hop method and calibrate the distance estimation between two agents because agent to be located may share the same shortest path to other node. The calibration refers to all anchors within the communication range of the agent to be located. According to the estimated distance between anchors and agent, we propose that the anchors influence the agent in an exponential weight form.

Multi-Hop Method
Consider a wireless network consisting of M = N A + N a nodes, where there are N A anchors and N a agents. We denote the position of the m − th node as θ m [x m , y m ] T , m ∈ S ∪ A, where A = {1, · · · , N a } stands for the set of the indexes of agents, while S = {N a + 1, · · · , M} is the set of the indexes of anchors. These sensors are assumed to be uniformly distributed in an area. All anchor and sensor nodes are assumed to have the same range (i.e., transmission capability), denoted by R. Each node is then able to directly communicate with any other node located in the disc having that node as a center and R as a radius, while it communicates in a multi-hop fashion with the nodes located outside it.
We firstly explore the distance estimation between two nodes in a two-hop range. As shown in Figure 1, the red points are the two nodes to be located. They are beyond communication range but can communicate through another one node which is denoted by yellow points. F denotes the adjacent area of the two nodes' communication range. of the agent to be located. Once one of these nodes joins or quits the network, the associated device 146 list would be updated. Through the associated device list, sensors can obtain and record their 147 neighboring nodes information. After the ad hoc network is prepared, the agent to be located sends 148 its neighboring information to each node of its own associated device list and receives neighboring 149 information from other sensors. The sensor to be located compares its own neighboring information 150 to that of the neighboring nodes, so that the common nodes are counted. The number of common 151 nodes is N in the adjacent area F . The adjacent area can be expressed as Also, we can express the relationship between adjacent area and node distance as 153 where ij d denotes the distance between node i and j , and The node distance is obtained by solving the following equation: 155 and it is also a decreasing function with respect to 156 the adjacent area F . Because the node distance cannot have a closed-form solution in Equation (3), 157 the Secant method is introduced to solve the root-finding problem. It is based on 158 The node distance is updated by 159       The distance estimation above is for two nodes in a two-hop range. When the distance of two 162 nodes is beyond the two-hop range, it can be estimated by the shortest path. If the hops in the shortest 163 path are even, the distance is 164 As the nodes are assumed to be uniformly distributed, we estimate the area through the node density ρ. Because a wireless sensor network is a kind of ad hoc network, its sensors can be self-organized once all sensors are started in the network. For developed hardware, such as CC2530 or IRIS, each sensor in the network can obtain device information at all times and form an associated device list. This associated device list includes all nodes which are within the communication range of the agent to be located. Once one of these nodes joins or quits the network, the associated device list would be updated. Through the associated device list, sensors can obtain and record their neighboring nodes information. After the ad hoc network is prepared, the agent to be located sends its neighboring information to each node of its own associated device list and receives neighboring information from other sensors. The sensor to be located compares its own neighboring information to that of the neighboring nodes, so that the common nodes are counted. The number of common nodes is N in the adjacent area F. The adjacent area can be expressed as Also, we can express the relationship between adjacent area and node distance as where d ij denotes the distance between node i and j, and i, j = 1, · · · , M. The node distance is obtained by solving the following equation: where ψ F is the inverse function of φ d ij and it is also a decreasing function with respect to the adjacent areaF. Because the node distance cannot have a closed-form solution in Equation (3), the Secant method is introduced to solve the root-finding problem. It is based on The node distance is updated bŷ where p denotes the number of iterations. When the condition p = p max = inf p d p ij =d p+s ij , ∀s ∈ N * is met, the iteration stops. To obtaind The distance estimation above is for two nodes in a two-hop range. When the distance of two nodes is beyond the two-hop range, it can be estimated by the shortest path. If the hops in the shortest path are even, the distance isd If the hops in the shortest path are odd, the distance of the last hop needs to be further estimated as shown in Figure 2.

168
In the same way, Equation (2) provides a solution for the distance estimation for a single hop. 169 The adjacent area is estimated by the common node in their communication ranges. When the 170 shortest path is odd, the node distance is 171

Distance Calibration 172
Although the nodes are assumed to be uniformly distributed in the area, homogeneity is not 173 possible in practice. This assumption leads to the inaccurate estimation of the area, which decreases 174 the accuracy of distance measurement. Also, the nonlinear shortest path cannot reflect the linear 175 distance between two nodes, and considering it leads to an error in distance estimation. To alleviate 176 the effect of these assumptions, we extract path information from the neighboring anchors. The 177 relevance of agent and neighboring anchors in non-cooperative networks has been investigated in 178 [22]. For a cooperative network, we should find a better way to calibrate the distance error. 179 Distance calibration includes two scenarios: distance between agent and anchor, and distance 180 between agent and agent. For agent 1 A and anchor 4 S , the shortest path is shown in Figure 3.  ,, S S S may share the same path, the distance between 183 anchors could provide reference for distance calibration.

186
On this basis, we propose the distance calibration formula 187 In the same way, Equation (2) provides a solution for the distance estimation for a single hop. The adjacent area is estimated by the common node in their communication ranges. When the shortest path is odd, the node distance isd

Distance Calibration
Although the nodes are assumed to be uniformly distributed in the area, homogeneity is not possible in practice. This assumption leads to the inaccurate estimation of the area, which decreases the accuracy of distance measurement. Also, the nonlinear shortest path cannot reflect the linear distance between two nodes, and considering it leads to an error in distance estimation. To alleviate the effect of these assumptions, we extract path information from the neighboring anchors. The relevance of agent and neighboring anchors in non-cooperative networks has been investigated in [22]. For a cooperative network, we should find a better way to calibrate the distance error.
Distance calibration includes two scenarios: distance between agent and anchor, and distance between agent and agent. For agent A 1 and anchor S 4 , the shortest path is shown in Figure 3. Points S 1 , S 2 , S 3 are the neighboring anchors within communication range of agent A 1 . Because agent A 1 and its neighboring anchors S 1 , S 2 , S 3 may share the same path, the distance between anchors could provide reference for distance calibration.

168
In the same way, Equation (2) provides a solution for the distance estimation for a single hop. 169 The adjacent area is estimated by the common node in their communication ranges. When the 170 shortest path is odd, the node distance is 171

Distance Calibration 172
Although the nodes are assumed to be uniformly distributed in the area, homogeneity is not 173 possible in practice. This assumption leads to the inaccurate estimation of the area, which decreases 174 the accuracy of distance measurement. Also, the nonlinear shortest path cannot reflect the linear 175 distance between two nodes, and considering it leads to an error in distance estimation. To alleviate 176 the effect of these assumptions, we extract path information from the neighboring anchors. The 177 relevance of agent and neighboring anchors in non-cooperative networks has been investigated in 178 [22]. For a cooperative network, we should find a better way to calibrate the distance error. 179 Distance calibration includes two scenarios: distance between agent and anchor, and distance 180 between agent and agent. For agent 1 A and anchor 4 S , the shortest path is shown in Figure 3.  ,, S S S may share the same path, the distance between 183 anchors could provide reference for distance calibration.

186
On this basis, we propose the distance calibration formula 187 On this basis, we propose the distance calibration formula where Θ A 1 S 4 is the calibration value of agent A 1 and anchor S 4 , d S i S 4 is the true distance between anchors S i S 4 ,d S i S 4 is the distance estimated by the multi-hop method in Section 2.1, λ i is the weight of each distance, κ is the number of selected anchors, which depends on two factors, one of which is the neighboring anchors number of agent A 1 . If this number is small, all the neighboring anchors contribute to the distance calibration. If the number is large, only part of them contribute to the distance calibration. The larger the number of neighboring anchors, the larger their over-calibration on distance estimation. Another factor affecting the selection of anchors is the distance between agent A 1 and neighboring anchor. Usually, the anchor at a lower distance more probably shares the same shortest path. On this basis, the number κ as well as the weight λ i are determined. To characterize the distance information better, we propose an exponential weight allocation formula After calibration, the distance between agent and anchor is where η A 1 S 4 is the calibration coefficient, which is designed to avoid over-calibration. Usually, the calibration coefficient is set to 0 < η A 1 S 4 < 1.
For agent A 1 and agent A 2 , the shortest path is shown in Figure 4. Points S 1 , S 2 , S 3 are the neighboring anchors within communication range of agent A 1 . Points S 4 , S 5 , S 6 are the neighboring anchors within communication range of agent A 2 .
After calibration, the distance between agent and anchor is 199

206
In the same way, the distance calibration formula for agents is 207  In the same way, the distance calibration formula for agents is where κ i denotes the selected anchors around agent A 1 , and κ j denotes the selected anchors around agent A 2 . Their weights are also allocated by distances. The exponential form of weight is After calibration, the distance between the agents is

Cooperative Localization
For range-free localization, a large deviation of distance estimation and position estimation may often happen, due to scarce information and difficult communication environment. These unwelcome estimations are called outliers. Especially in cooperative localization, outliers may lead to the failure of whole network. To alleviate the effect of the outliers, we propose a cooperative localization method with outlier constraints. Outlier constraints are divided into distance constraints and position constraints, which both rely on neighboring anchors. The estimated distance and position will not exceed the communication range of neighboring anchors for both distance constraints and position constraints. These constraints are represented by the parameters α and β, which condition the cooperative method. The cooperative method introduces message passing and updates the estimated position through the variational message passing rule. The final localization result depends on confidence of the agent to be located.

Outlier Constraints
For range-based localization, the estimated distances are relatively accurate, so that the localization of agents is quite precise. For range-free localization, in our paper, the accuracy fails to meet the requirement of cooperative localization for both node distance and node position. If the outlier distance and position are regarded as key information of a virtual anchor, this will cause a large derivation in the subsequent iteration, leading, finally, to disruption of the whole network and localization failure. To avoid this problem, we propose the outlier constraint method, which includes position constraint and distance constraint.
It is inevitable to have low accuracy of distance estimation with the multi-hop method. The outlier distance has a negative effect on cooperative localization, so it is better to exclude the outlier distances. The outlier distance is excluded by constraints from anchors, as shown in Figures 5 and 6. Figure 5 shows the distance between agent and anchor. Figure 6 shows the distance between agents. For the distance between agent and anchor, the outlier constraint is where d A 1 S is the estimated distance according to Section 2, S denotes the neighboring anchors within communication range of A 1 , d SS 1 denotes the true distance between anchor S 1 and any anchor in S. After calibration, the distance between the agents is 210 where 12  AA is the calibration coefficient, which is usually result depends on confidence of the agent to be located. 223

Outlier Constraints 224
For range-based localization, the estimated distances are relatively accurate, so that the 225 localization of agents is quite precise. For range-free localization, in our paper, the accuracy fails to 226 meet the requirement of cooperative localization for both node distance and node position. If the 227 outlier distance and position are regarded as key information of a virtual anchor, this will cause a 228 large derivation in the subsequent iteration, leading, finally, to disruption of the whole network and 229 localization failure. To avoid this problem, we propose the outlier constraint method, which includes 230 position constraint and distance constraint. 231 It is inevitable to have low accuracy of distance estimation with the multi-hop method. The 232 outlier distance has a negative effect on cooperative localization, so it is better to exclude the outlier 233 distances. The outlier distance is excluded by constraints from anchors, as shown in Figures 5 and 6. 234 Figure 5 shows the distance between agent and anchor. Figure 6 shows the distance between agents. 235 For the distance between agent and anchor, the outlier constraint is 236

241
Hence, we propose a constraint function as 242 In a cooperative network, the outlier position of the agent also has a negative effect on 250 cooperative localization. It is better to exclude these outlier positions through neighboring anchors. 251 In the network, agents can communicate with all nodes that are in their communication range. 252 Therefore, distance between the agent and its neighboring anchor is lower than the communication 253 range: 254  

Cooperative Localization 259
Thanks to the locally factorized structure of the joint likelihood function, the cooperative 260 localization problem can be addressed under the framework of factor graph. Inference and estimation 261 tasks are typically carried out on a factor graph by message passing between variable nodes and 262 factor nodes. Existing methods do not consider the outlier variable nodes and factor, which indicates 263 that cooperative localization is not suitable for a range-free situation. In the cooperative phase, we 264 explore a hard decision-based cooperative way for a range-free situation applying outlier constraints. 265 Hence, we propose a constraint function as For the distance between agents, the outlier constraint is where d A 1 A 2 is the estimated distance according to Section 2, S denotes the neighboring anchors within communication range of A 1 , S denotes the neighboring anchors within communication range of A 2 , d SS denotes the real distance between any anchor in S and any anchor in S . Hence, we propose the constraint function In a cooperative network, the outlier position of the agent also has a negative effect on cooperative localization. It is better to exclude these outlier positions through neighboring anchors. In the network, agents can communicate with all nodes that are in their communication range. Therefore, distance between the agent and its neighboring anchor is lower than the communication range: whereθ A 1 is the estimated position of agent A 1 , S denotes the neighboring anchors within communication range of A 1 , θ S denotes position of any anchor in S. Hence, we propose the constraint function where · is the Euclidean norm of estimated positionθ A 1 and true position θ S .

Cooperative Localization
Thanks to the locally factorized structure of the joint likelihood function, the cooperative localization problem can be addressed under the framework of factor graph. Inference and estimation tasks are typically carried out on a factor graph by message passing between variable nodes and factor nodes. Existing methods do not consider the outlier variable nodes and factor, which indicates that cooperative localization is not suitable for a range-free situation. In the cooperative phase, we explore a hard decision-based cooperative way for a range-free situation applying outlier constraints. We assume that the sensor node i acquires a noisy measurement d ij and that i, j ∈ S ∪ A, which is the estimated distance from the sensor node j ( j can be either an agent or an anchor). Then, we have (20) where e ij is the measurement noise. Without loss of generality, we assume that measurement noise obeys a Gaussian distribution, so e ij ∼ N e ij ; 0, σ 2 ij ; σ ij is the standard deviation. The probability density function of node distance is We define f ij p d ij θ i , θ j and assume that the relative positions are conditionally independent and only depend on the two nodes involved: where θ is defined as the position set θ {θ i : i ∈ S ∪ A} of all nodes, and D is defined as the distance set D d ij : i ∈ S ∪ A, j ∈ S ∪ A of all nodes. Among various message-passing algorithms, belief propagation (BP, also known as sum-product algorithm, SPA) and VMP are the most widely applied ones. Compared with BP, VMP can often lead to relatively simple message-passing rules, which roots from the fact that VMP enforces stronger constraint on the form of trail distributions. Considering the effect of the outliers, we propose a hard decision-based cooperative method and define a VMP rule with outlier constraints as where m f ia →θ i (θ i ), m f il →θ i (θ i ) are the messages from anchor factor f ia and agent factor f il , b(θ a ), b(θ l ) are the confidence result in the last iteration, α ia d ia , α il d il are the outlier constraints of the estimated distance, β i θ i is the outlier constraint of the estimated position. Their definition was presented in Section 3.1. When the estimated distance or position is identified as outlier, the messages are invalid. This ensures that the outliers do not disrupt the whole network. An approximation of the posterior distribution is where Z is a normalization coefficient. After some manipulation, the confidence of the agent position is where We expand the Euclidean norms in the equations with second-order Taylor expansion. The Euclidean norms F ia (θ i ) θ a − θ i and F il (θ i , θ l ) = θ l − θ i are respectively expanded aroundθ * i and θ * i ,θ * l . Then, equation (26) is transformed aŝ whereV i is defined as variance, andθ i is the expectation of the agent position. They are iteratively calculated bŷ where θ denotes the estimated position of the last iteration, ∇ F ia , ∇ 2 F ia are the first-order and second-order is the first-order partial derivative and Hessian matrix with respect to F il (θ i , θ l ) at θ * i ,θ * l . The network operates in a cooperative way through Equations (30) and (31) until pre-defined iteration count. The final values ofV i andθ i are the localization results.

Results and Discussion
Node locations and populations play a key role in determining the performance of a localization network due to their stochastic natures which lead to changes of network topology. In this section, we consider the general behaviors of a stochastic localization network where anchors and/or agents are randomly distributed in the two-dimensional space. On this basis, the performance of the proposed algorithm is evaluated through numerical simulations.

Localization Performance
We first investigate the localization performances of the proposed method and traditional method in a network with 40 anchors and 160 agents. The communication radius is assumed to be 30 m, and the distribution area is 100 m × 100 m. The node density is 0.02/m 2 . The number of iterations for algorithms is set to 10. The parameters η in Equations (10) and (13) are 0.5. Standard deviations of the estimated positions are σ ia = 2 for anchors and σ il = 4 for agents. For comparison, we select the least-squares (LS) method, cooperative localization without outlier constraints (CL), and cooperative localization with outlier constraints (CLOC). The localization results are depicted by cumulative distribution functions (CDFs), as shown in Figure 7.
As shown in Figure 7, CLOC outperforms LS and CL in accuracy. The mean-square error (MSE) of CLOC is 5.225 m, while the MSE of LS and CL are, respectively, 7.665 and 6.92 m. Compared with LS, CLOC improves the accuracy by about 30%. For CL and CLOC, the localization results are almost same when the localization error is small, while CLOC outperforms CL when the localization error is large. The reason for the better performance of CLOC is that the outlier constraints limited the possible distribution of the estimated position. If outliers are considered, outlier constraints will improve the localization of the whole network. Therefore, most localization errors in the CLOC method are less than 4 m. Actually, CL and CLOC are both cooperative methods. LS is a non-cooperative method.
In Figure 7, cooperative methods show better performance than non-cooperative methods. Because outliers may lead to the wrong direction of iterative adjustment, the advantage of the cooperative method is not obvious. As the outliers are considered in the CLOC method, the localization accuracy is largely improved. improve the localization of the whole network. Therefore, most localization errors in the CLOC 324 method are less than 4 m. Actually, CL and CLOC are both cooperative methods. LS is a non-325 cooperative method. In Figure 7, cooperative methods show better performance than non-326 cooperative methods. Because outliers may lead to the wrong direction of iterative adjustment, the 327 advantage of the cooperative method is not obvious. As the outliers are considered in the CLOC 328 method, the localization accuracy is largely improved. 329

Performance of Distance Estimation
Distance estimation is a key step in the localization of a WSN. In this subsection, we investigate the performance of distance estimation and the effect of the calibration coefficient. We consider a network where 40 anchors and 160 agents are uniformly distributed in a 100 m × 100 m area. The node density is 0.02/m 2 , and the communication radius is 30 m. The calibration coefficient varies from 0 to 1. When the calibration coefficient is 0, the distance calibration does not affect the distance estimation. We compare the distance estimation results in different scenarios, as shown below.
As shown in Figure 8, the estimated results present different performances with different calibration coefficients. The performance is the worst when the calibration coefficient is 0. This indicates that the traditional multi-hop method does not fully utilize the information from anchors, while its performance can be improved by neighboring anchors. Other curves show the results after distance calibration. Actually, the calibration coefficients have different effects on distance estimation. In Figure 8, the estimation results are better when the calibration coefficient is 0.5, while they are worse when the calibration coefficient is 1. This indicates that over-calibration is not always good for distance estimation. Although the error from anchors can provide a reference, it is not completely valid for the agent. If the calibration value is totally introduced in the distance estimation, it causes over-calibration that may increase the error in an opposite manner. In the scenario of this subsection, the most suitable value for the calibration coefficient is 0.5.
To further explore how to set the calibration coefficient, we design several simulations conducted in different scenarios. The first scenario (Scenario I) considers a network where 80 anchors and 320 agents are uniformly distributed in a 100 m × 100 m area. The node density is 0.04/m, and the communication radius is 30 m. Scenario II considers a network where 20 anchors and 180 agents are uniformly distributed in a 100 m × 100 m area. The node density is 0.02/m 2 , and the communication radius is 30 m. Scenario III considers a network where 40 anchors and 160 agents are uniformly distributed in a 100m × 100m area. The node density is 0.02/m 2 , and the communication radius is 20 m. Scenario IV considers a network where 40 anchors and 160 agents are uniformly distributed in a 100 m × 100 m area. The node density is 0.02/m 2 , and the communication radius is 50 m. For these scenarios, we also select five calibration coefficient values to compare the localization performance. These values are 0, 0.2, 0.5, 0.8, and 1. The values with the best localization accuracy are shown in Table 1.
the performance of distance estimation and the effect of the calibration coefficient. We consider a 332 network where 40 anchors and 160 agents are uniformly distributed in a 100 m × 100 m area. The 333 node density is 0.02/m 2 , and the communication radius is 30 m. The calibration coefficient varies from 334 0 to 1. When the calibration coefficient is 0, the distance calibration does not affect the distance 335 estimation. We compare the distance estimation results in different scenarios, as shown below.    Table 1 shows that the optimum calibration coefficient is 0.2 for Scenario IV, whereas it is 0.5 for all the other scenarios. This indicates in most cases, the localization performance is better when the calibration coefficient is 0.5. The reason for a different optimum value in Scenario IV is the large ratio between communication radius and distribution area. When the communication radius is 50 m and the side of distribution area is 100 m, most sensors have at most three hops to reach other nodes in the shortest path. Therefore, the theory of sharing the same path can rarely be used in the localization method. This leads to a small calibration coefficient in the distance calibration phase. In practical engineering, the calibration coefficient is usually set as 0.5, except in special cases similar to Scenario IV.

Effect of Network Distribution Setting
For range-free methods, network distribution parameters, such as node density, anchor proportion, and communication radius, have a big influence on the localization results. In this subsection, we investigate the effect of these network distribution parameters.
Node density is firstly investigated, with these nodes uniformly distributed in a 100 m × 100 m area. The communication radius is 20 m, and the anchor proportion is 20%. The number of iterations for algorithms is set to 10. The parameters η in Equations (10) and (13) are 0.5. The standard deviations of the estimated positions are, respectively, σ ia = 2 for anchors and σ il = 4 for agents. The total node number varies from 200 to 500, so the node density varies from 0.02/m 2 to 0.05/m 2 . The localization results are shown in Figure 9. Figure 9 shows the comparison of the performance of LS, CL, and CLOC. Due to the outliers, the accuracy of CL without outlier constraints is close to that of with LS, and both CL and LS underperform compared with CLOC. The accuracy of the three methods increases with increasing node density. There are two reasons for their good performance. One is that a high node density helps estimate the distance, because the nodes are more uniform, and the area range is easier to differentiate. Another reason is that more anchors and agents can provide more references. Therefore, CLOC outperforms in localization accuracy, and a high node density contributes to the improvement. Sensors 2019, 19, x FOR PEER REVIEW 13 of 17 382 Figure 9. Comparison of the localization performance with respect to node density.
383 Figure 9 shows the comparison of the performance of LS, CL, and CLOC. Due to the outliers, the 384 accuracy of CL without outlier constraints is close to that of with LS, and both CL and LS 385 underperform compared with CLOC. The accuracy of the three methods increases with increasing 386 node density. There are two reasons for their good performance. One is that a high node density helps 387 estimate the distance, because the nodes are more uniform, and the area range is easier to 388 differentiate. Another reason is that more anchors and agents can provide more references. Therefore, 389 CLOC outperforms in localization accuracy, and a high node density contributes to the improvement. 390 Anchor proportion also has an effect on the localization performance. To investigate this effect, 391 200 nodes are uniformly distributed in a 100 m × 100 m area. The node density is 0.02/m 2 , and the 392 communication radius is 20 m. The number of iterations for algorithms is set to 10. The parameters 393  in Equations (10) and (13)  CL. This indicates a good improvement produced by the proposed method, without the addition of 400 excessive computation. Meanwhile, the accuracy of the three methods increases with an increasing 401 anchor proportion. This is because the anchors' positions are more accurately determined, and the 402 anchors are the reference to localize the agents. Therefore, a high anchor proportion can effectively 403 decrease the localization error. 404 We also investigate the effect of the communication radius on the localization performance. 405 Here  (10) and (13) are 0.5. The standard deviations of the estimated positions are σ ia = 2 for anchors and σ il = 4 for agents. The anchor proportion varies from 20% to 50%. The localization results are shown in Figure 10.
382 Figure 9. Comparison of the localization performance with respect to node density. 383 Figure 9 shows the comparison of the performance of LS, CL, and CLOC. Due to the outliers, the 384 accuracy of CL without outlier constraints is close to that of with LS, and both CL and LS 385 underperform compared with CLOC. The accuracy of the three methods increases with increasing 386 node density. There are two reasons for their good performance. One is that a high node density helps 387 estimate the distance, because the nodes are more uniform, and the area range is easier to 388 differentiate. Another reason is that more anchors and agents can provide more references. Therefore, 389 CLOC outperforms in localization accuracy, and a high node density contributes to the improvement. 390 Anchor proportion also has an effect on the localization performance. To investigate this effect, 391 200 nodes are uniformly distributed in a 100 m × 100 m area. The node density is 0.02/m 2 , and the 392 communication radius is 20 m. The number of iterations for algorithms is set to 10. The parameters 393  in Equations (10) and (13)  CL. This indicates a good improvement produced by the proposed method, without the addition of 400 excessive computation. Meanwhile, the accuracy of the three methods increases with an increasing 401 anchor proportion. This is because the anchors' positions are more accurately determined, and the 402 anchors are the reference to localize the agents. Therefore, a high anchor proportion can effectively 403 decrease the localization error. 404 We also investigate the effect of the communication radius on the localization performance. 405 Here As shown in Figure 10, CLOC outperforms in accuracy for all scenarios compared with LS and CL. This indicates a good improvement produced by the proposed method, without the addition of excessive computation. Meanwhile, the accuracy of the three methods increases with an increasing anchor proportion. This is because the anchors' positions are more accurately determined, and the anchors are the reference to localize the agents. Therefore, a high anchor proportion can effectively decrease the localization error.
We also investigate the effect of the communication radius on the localization performance. Here, 160 agents and 40 anchors are uniformly distributed in a 100 m × 100 m area. The node density is 0.02/m 2 . The number of iterations for algorithms is set to 10. The parameters η in Equations (10) and (13) are 0.5. The standard deviations of the estimated positions are σ ia = 2 for anchors and σ il = 4 for agents. The communication radius varies from 20 to 50 m. The localization results are shown in Figure 11. Figure 11 shows that CLOC outperforms for any communication radius compared with LS and CL. However, the localization performance has no relationship with the communication radius. The trend of localization accuracy does not change with respect to the communication radius. The reasons for this are as following. Although a larger communication radius can consist of more nodes, the number of nodes to differentiate the area of distribution is not higher. In the distance estimation phase, a larger communication radius does not improve the distance accuracy. In the localization phase, more agents are included to realize cooperative localization when the communication increases. However, these agents are unable to provide a precise reference, while the availability of outlier constraints is weakened. Therefore, the communication radius has little effect on the localization results. for this are as following. Although a larger communication radius can consist of more nodes, the 416 number of nodes to differentiate the area of distribution is not higher. In the distance estimation 417 phase, a larger communication radius does not improve the distance accuracy. In the localization 418 phase, more agents are included to realize cooperative localization when the communication 419 increases. However, these agents are unable to provide a precise reference, while the availability of 420 outlier constraints is weakened. Therefore, the communication radius has little effect on the 421 localization results. 422 The proposed method is verified in a simulation environment, using a simple model of wireless 423 sensor network, which may not reflect real-world scenarios. To simulate a practical network, 424 additional experiments are performed to demonstrate the advantages of the method for non-425 homogeneous distributions of nodes. We consider a network distribution with holes or obstacles, as 426 shown in Figure 12. In the network, 160 agents and 40 anchors are uniformly distributed in a 427 100 m × 100 m area, excluding holes and obstacles. The communication radius is 30 m. The number 428 of iterations for algorithms is set to 10. The parameters  in Equations (10) and (13)  The proposed method is verified in a simulation environment, using a simple model of wireless sensor network, which may not reflect real-world scenarios. To simulate a practical network, additional experiments are performed to demonstrate the advantages of the method for non-homogeneous distributions of nodes. We consider a network distribution with holes or obstacles, as shown in Figure 12. In the network, 160 agents and 40 anchors are uniformly distributed in a 100 m × 100 m area, excluding holes and obstacles. The communication radius is 30 m. The number of iterations for algorithms is set to 10. The parameters η in Equations (10) and (13) are 0.5. The standard deviations of the estimated positions are σ ia = 2 for anchors and σ il = 4 for agents. The hole or obstacle is assumed to be a square with its side varying from 30 to 60 m. the localization results are shown in Figure 13. for this are as following. Although a larger communication radius can consist of more nodes, the 416 number of nodes to differentiate the area of distribution is not higher. In the distance estimation 417 phase, a larger communication radius does not improve the distance accuracy. In the localization 418 phase, more agents are included to realize cooperative localization when the communication 419 increases. However, these agents are unable to provide a precise reference, while the availability of 420 outlier constraints is weakened. Therefore, the communication radius has little effect on the 421 localization results. 422 The proposed method is verified in a simulation environment, using a simple model of wireless 423 sensor network, which may not reflect real-world scenarios. To simulate a practical network, 424 additional experiments are performed to demonstrate the advantages of the method for non-425 homogeneous distributions of nodes. We consider a network distribution with holes or obstacles, as 426 shown in Figure 12 Figure 13 shows the localization results with respect to the side length of holes or obstacles. Compared with a homogeneous network, LS, CL, and CLOC decrease the localization accuracy. As the side length of holes or obstacles increases, the localization error increases. Therefore, in a non-homogeneous situation, the localization performance decreases. However, the effect of a non-homogeneous distribution is different for LS, CL, and CLOC. As shown in Figure 13, the effect on LS is the largest. Because holes or obstacles directly cause a large distance estimation error, and no measures have been taken to alleviate it, LS localization is seriously affected. Compared with LS, CL and CLOC are both calibrated in the distance estimation phase. Although the shortest path is nonlinear as a result of holes or obstacles, it is eliminated by neighboring anchors' calibration. In this condition, CL and CLOC are less sensitive to variations of the side length of holes or obstacles compared with LS. Because outlier constraints are used to improve cooperative localization, CLOC outperforms in localization accuracy compared with CL. 437 Figure 13 shows the localization results with respect to the side length of holes or obstacles. 438 Compared with a homogeneous network, LS, CL, and CLOC decrease the localization accuracy. As 439 the side length of holes or obstacles increases, the localization error increases. Therefore, in a non-440 homogeneous situation, the localization performance decreases. However, the effect of a non-441 homogeneous distribution is different for LS, CL, and CLOC. As shown in Figure 13, the effect on LS 442 is the largest. Because holes or obstacles directly cause a large distance estimation error, and no 443 measures have been taken to alleviate it, LS localization is seriously affected. Compared with LS, CL 444 and CLOC are both calibrated in the distance estimation phase. Although the shortest path is 445 nonlinear as a result of holes or obstacles, it is eliminated by neighboring anchors' calibration. In this 446 condition, CL and CLOC are less sensitive to variations of the side length of holes or obstacles 447 compared with LS. Because outlier constraints are used to improve cooperative localization, CLOC 448 outperforms in localization accuracy compared with CL. 449

Communication Overhead 450
For localization technology in large-scale WSNs, the method is expected to be highly efficient, 451 and thus it requires a low communication overhead. In this section, CLOC is compared with LS and 452 CL with respect to the communication overhead. The communication overhead of the three methods 453 is shown in Table 2. 454

Communication Overhead
For localization technology in large-scale WSNs, the method is expected to be highly efficient, and thus it requires a low communication overhead. In this section, CLOC is compared with LS and CL with respect to the communication overhead. The communication overhead of the three methods is shown in Table 2.   Table 2 shows the approximate packages for the localization, where N A denotes the number of anchors, N a denotes the number of agents, and T denotes the iteration. Among the three methods, LS has the lightest communication load. CL and CLOC have the same communication load. The difference between LS and the cooperative methods is regards the iterated localization process and depends on the iteration counts. For CLOC, the constraints process does not increase the communication load. Considering the improvement of localization accuracy, the communication overhead of the proposed method is acceptable.

Conclusions
In this paper, we established a hard decision-based cooperative localization method for wireless sensor networks. In the distance estimation phase, a novel calibration formula was defined to improve the accuracy of the multi-hop method, where the exponential form of weight can better characterize the distance relationship among nodes. In the cooperative localization phase, a hard decision-based method with outlier constraints was proposed to solve the problem for range-free estimation. It effectively avoids large errors in node localization. Simulations were conducted to investigate localization performance, effect of algorithm parameters, and effect of network distribution. In these scenarios, the proposed method showed a good performance for localization accuracy and communication overhead, which promotes the development of low-cost WSN. Further study will focus on the localization capacity in complex environments.