The Performance Evaluation of Hybrid Localization Algorithm in Wireless Sensor Networks

As one of the key techniques in wireless sensor networks (WSN), localization algorithm has been a research hot topic and indispensable function in most wireless applications. In order to promote localization accuracy and efficiency, a lot of localization algorithms with different performances and computation complexities have been proposed. The paper discusses the drawbacks of some typical works on localization, and proposes a hybrid localization algorithm integrated with approximate point in triangle (APIT) and distance vector-hop (DV-HOP). To address the positioning accuracy and coverage rate, the objectives of this paper are three folds: firstly, adopting angle detection to determine the exact direction of unknown nodes. Then, the APIT algorithm is adopted over all unknown nodes within the triangle and its localization error is reduced from 14.7215 m in conventional APIT to 3.2348 m in the considered scenario. Finally, the DV-HOP algorithm is adopted with different weights for the nodes within the minimum hops, and localizes the rest unknown nodes in WSN with localization accuracy increased by 49%.


Introduction
As we all know, huge similar requirements of information sharing derive the development of the Internet of things (IoT) gradually. In IoT, the multi-functional wireless sensors are deployed in many applications. WSN is composed of a large number of cheap sensor nodes, and it has distributed processing ability with high accuracy, high fault tolerance, large covering area, and remote monitoring. The advantages of WSN make its broad applications in many fields.
For example, in military, detecting relevant information by deployment of WSN and collecting the data to the command center, and thus forming a map of battlefield scenario. Applying accurate positioning information in fire control and guidance system, to observe the enemies in an open way. In intelligent agriculture, spreading a large number of sensor nodes to the monitored regional and forming monitoring network. The sensor nodes collect information needed by the farmers to find out the diseases timely and locate the position of diseases accurately. In environmental detection scenario, sensor nodes are spread in the forest, collecting temperature information to prevent fire. Figure 1 presents a typical forecast system of forest fire, there are some specific applications, such as tracking animal, detecting water quality, and analyzing meteorological and geographical. In the field of health care, deploying wireless sensor nodes in the ward to monitor and detect the blood pressure, breathing, and heart rate of patients, and monitoring physiological indexes timely. In the family house, we can deploy sensors in each room and get the temperature to control air-conditioner intelligently. Furthermore, installing sensor nodes in furniture, doors, and windows can constitute a smart home. In addition, wireless sensors also have important applications in space exploration as well as emergency and temporary occasions.
Compared with traditional wired and cellular networks, wireless sensor network should be constructed without infrastructure support. Each sensor node may enter and leave the network at any time, and the whole network runs in a distributed way. As a hot research topic, there are a number of problems should be addressed in WSN, such as localization, energy management, network of self-organization and selfmanagement, topology control, positioning technology, data fusion, time synchronization, cross layer design, network security and so on.
The focused localization algorithm in this paper has been widely considered in previous works. The localization algorithms in WSN can be divided into two categories [1,2], according to whether the distance between the nodes is needed or not. The first class of localization algorithms are based on known exact distance information, such as Received Signal Strength Indication (RSSI), Time difference of Arrival (TDOA) [3], and Angle-of-Arrival (AOA) etc. The second class of localization algorithms are designed without distance-information, such as APIT, DV-HOP, Centriod, Amorphous etc. With the support of the distance information, the location accuracy of the first class is higher than the second. However, most algorithms in the first category have high requirements on the hardware of sensor nodes [4]. The algorithms in the second class usually estimate the distance among sensor nodes flexibly, which is more suitable for the practical situations. In this paper, the proposed work belongs to the second class. Recently, APIT algorithm was proposed with high accuracy in localization. However, there are no continuous reports about APIT. In order to reduce localization errors of APIT, reference [5] proposes backtracking algorithm and method of regional detection. However, its computation complexity is very high. Furthermore, reference [6] proposes to increase the density of anchor-nodes to improve the coverage rate of localization. Its simulation results show that the improvement in localization error is minor. Reference [7] proposes a new method that can localize the whole region by using the least number of sensors. However, it cannot realize the localization of node itself. In [8], considering the impact of the distance of nodes on localization error, it modifies the traditional centroid algorithm by using the RSSI distance as weighting coefficients, and the localization accuracy is greatly improved. The advantage of DV-HOP is that it uses the multi-hop information and its average distance to localize instead of the practical distance between the nodes. The method that determines the number of hops between the anchor-nodes and the unknown nodes is proposed in [9]. However, the number of hops between unknown nodes is not taken into account.
In [10], an improved algorithm by relying on RSSI, amending the hops and weighting average distance per hop, without considering the error affected by multilateral measurement. An improved particle swarm algorithm to find out the global optimal unknown node coordinates [11], introducing the adaptive inertia weight and difference change particle velocity to maintain diversity of the population, and the presearch speed and late-search accuracy to avoid falling into local optima are ensured. However, it is hard to extend this algorithm with APIT.
In this paper, we consider APIT and DV-HOP algorithms. The objectives of the paper are three folds: determining whether the unknown node in the triangle composed of anchor-nodes accurately or not, adopting APIT to the unknown nodes in the triangle , adopting DV-HOP weighted with the hops to the rest unknown nodes. All nodes are considered. Numerical results are presented to verify the proposed scheme.
The reminder of this paper is organized as follows. The brief review over APIT and DV-HOP algorithms is described in Section II. The improved algorithm is illustrated in Section III. Then the simulation results are presented in Section IV and Section V finally concludes the paper.

Brief review over APIT and DV-HOP algorithms
In this section, we will take a brief review over localization principle and typical localization algorithms, i.e., APIT and DV-HOP algorithms.

Trilateration
The method of Trilateration is a kind of localization algorithm based on set calculation, the specific localization principle of which is as shown in Fig. 2.
The coordinates of the three nodes (A, B, C)are known as (x a , y a ),(x b , y b ),(x c , y c ).The distances between the three nodes and the unknown node D are d a ,d b ,d c .The coordinate of the unknown node (x y ) can be listed as follows: Fig. 1 The structure of forecast system in forest fire According to (1), the coordinates of the unknown node can be derived as:

APIT algorithm
The detailed steps of APIT algorithm [12,13] are displayed in Table 1.
The basic idea of APIT is: node S is in the triangle if there are no adjacent nodes of S near or far from S at the same time, otherwise out of the triangle. In practice, the unknown nodes need to exchange information with the adjacent nodes firstly, and then according to signal strength between the anchor-nodes and the unknown nodes and the adjacent nodes of the unknown nodes to determine whether the unknown nodes are in the triangle or not. APIT is a kind of approximate algorithm, and the judgment error may happen for the limited direction. The experimental results show that the max probability of above judgment error is 14%. Figure 3 shows the simulation (Node-Amounts = 100, 150, 200 and 250) of APIT under the conditions for example: location area: 100m × 100m; the coordinates of all nodes: subjecting to random function; communication radius: 50m; the number of anchor-nodes: 30. The location errors are: 37.1644m, 37.5252m, 38.2141m and 39.2276m. Figure 4 shows the simulation results of error map under the same parameters with 100 times. From Fig. 5, the positioning errors gradually become lager and then to be steady with the increasing of the number of all nodes, when the anchor-nodes are in a certain situation. This is because it is inevitable to judge wrong with APIT. Besides, as long as the unknown node is judged in the triangle, its position will be instead of the centroid of the relative triangles, which causes the error increased under the relatively small number of unknown nodes and rather sparse distribution. But with the increase in the number of unknown nodes as well as the unknown nodes in triangle, the error will be stabilized comparatively.
Due to the nature of the method of control variable is the same, so in order to successfully carry out the following work, this paper chooses 15% of the total number as anchor-nodes for the experimental date, which has a certain rationality. That is to say, it will lead inaccurate location if the quantity of anchor-nodes is small. Too many will increase the overhead of the nodes. However, this is just the ideal analysis of the situation. In practice, it should also increase the number of anchor-nodes appropriately according to the natural situation to achieve the best overall benefit. e.g.30% in the Section 4.

DV-HOP algorithm
DV-HOP (Distance Vector-HOP) algorithm is proposed by Niculescu. The idea of Vector-HOP Distance (DV-HOP) algorithm is that the distances between the unknown nodes and the anchor-nodes are instead of the multiply of average jump distance and hops between them. The positioning mechanism consists of three different stages [14][15][16]: (1) Calculate the minimum hops between the unknown nodes and each anchor-node. (2) Calculate the distance between the unknown nodes and the anchor-nodes. According to the recorded information of other anchor-nodes with coordinate and hops, each anchor-node estimates the average jump distance by the following formula: Here, (x i , y i ), (x j , y j ) are the coordinates of anchor-node i , j. h ij is the hops between anchor-node i and j. It is as shown in Fig. 5.
L 1 , L 2 , L 3 is the anchor-nodes, A is the destination node. According to the anchor-nod L 1 ,the distance between L 2 and Fig. 2 The principle of trilateration Table 1 Steps of APIT algorithm (1) Collect information: unknown nodes collect the information of location, identification number and received signal strength of anchornodes around them, and neighbor nodes exchange and share their received information of beacon nodes.
(2) PIT test: store all triangles containing unknown node in the collection.
(4) Calculate the location of unknown nodes through the center of mass of overlapping area. L 3 ,and the corresponding minimum number of hops are hops 12 , hop 13 ,then the average hop distance of L 1 can. Be calculated as d 1 ¼ m þ l ð Þ= hops 12 þ hops 13 ð Þ ,so are the average hop distance of L 2 and L 3 . Assuming that the destination node A obtains the average hop distance from the anchor-node L 1 ,the distances between the destination node A and the three anchor-nodes can be calculated. In order to avoid to receive the average hop distance from the same anchornode repeatedly, the method of controllable flood routing can be used.
(3) Calculate the coordinates of the unknown nodes. It can calculate its own position according to the trilateral positioning or least squares method, when the unknown node receives three or more distances to the anchor-nodes.
Suppose that there are n anchor-nodes 1 , 2 , 3 , L , n, and the corresponding coordinates are expressed as (x 1 , y 1 ), (x 2 , y 2 ), (x 3 , y 3 ), ⋯ , (x n , y n ). The coordinate of the unknown node M is (x, y). According to the relation between the distance and the coordinate, the distances d 1 , d 2 , d 3 , ⋯ , d n between M and the anchor-nodes are: From (4), the first to the last but one equation minus the last equation, linear equation is obtained:AX = B. Here, The positioning error of basic DV-HOP algorithm is shown in Fig. 6, which shows the result under the same parameter with 100 times.

Improved algorithm
In the large scale wireless sensor networks, the method based on non-ranging has low positioning accuracy. The method based on ranging has high cost, so it cannot be applied with large scale. In order to solve this problem. The paper attempts to combine two existing algorithms. Firstly, to determine whether the unknown node is surrounded by the anchor nodes. If the unknown node is surrounded by the anchor nodes, the position of the triangle overlap region is estimated based on the APIT algorithm. If the unknown node is not in the area of the triangle, it can become a blind node, which cannot be located, so the coverage rate of localization is reduced. Thus, the unknown nodes in this situation are located based on the improved DV-HOP algorithm. The improved hybrid algorithm flow chart is shown in Fig. 7.
After initialization of the network, the triangles which are composed of anchor nodes are obtained firstly. Then, if the unknown node is in the triangle, the improved APIT algorithm is used, or the improved DV-HOP algorithm. Finally, calculate the location of all unknown nodes.

Improved APIT algorithm
Based on the former introduction of APIT, the proportion of PIT test error is 14%. So in order to improve judgment accuracy, this paper proposes a method of angle judgment. If the unknown node is in the triangle,the sum of the angle, consisted of the unknown node and the three anchor-nodes,must be 360°, otherwise not.
As shown in Fig. 8, assuming A , B , C as the anchor-nodes and D as the unknown node. According to the calculation, the angles of ∠ADB, ∠ADC and ∠BDC are 108.5918°, 109.7924°a nd 141.6158°. And the sum of above angle is 360°. So D must be in the triangle ΔABC. As shown in Fig. 9.
So D must be out of the triangle ΔABC. The rate of corrected judgment with this method is 100%, which makes a foundation for the future work. Tus, the accuracy of positioning the unknown nodes is improved to a large extent, while the computer needs to be equipped with high ability of calculation. Because the judgment of whether the objective node in the triangle consisted of the anchor-nodes is needed.

Improved DV-HOP algorithm
The basic idea of DV-HOP algorithm is the multiply of jump distance and hops between the unknown node and the anchor-   There are three causes of the error: firstly, the minimal hops, used in DV-HOP, are between the unknown node and the nearest anchor-node; Secondly, the average jump distance is based on the hops and distance between anchor-nodes; At last, the nearest anchor-node is determined by hops. That is to say, the closer the anchor-nodes are, the more accurate the distance between the unknown node and the anchor-node is. Naturally, the data of average jump distances of the anchornodes, with high hops from the unknown nodes, become redundant. In order to make full use of the redundant information, this paper proposes a new method of weighted DV-HOP algorithm, different distances with different jump distances, to reduce the former two causes of error and make the position more accurate. There are no redundant information of the noise and the error message are ignored. The detailed steps are given in Table 2.

Simulation results
In order to verify the reliability of the proposed hybrid algorithm, this paper shows the simulation results by MATLAB. Consider the following simulation parameters in Table 3.
First of all, there are 55 unknown nodes in the triangle and 15 unknown nodes out of the triangle accurately according to the method of angle judgment. Figure 10 shows comparison of location of unknown node in the triangle. The deviation between the nature location of unknown node and the estimated one is also depicted in Fig. 11. In order to see the advantage of the new APIT algorithm more obvious, the error of each unknown node is plot in Fig. 11. The average location error is 3.2348(m) of the improved APIT. There are two main reasons that the average positioning error of APIT in Fig. 11 is lower than the former traditional APIT simulated in Fig. 3: (1) an increasing number of anchor-nodes; (2) a smaller range of location.
The positioning accuracy of the new APIT algorithm is approved by 78% compared with the traditional one, the average location error of which is 14.7215 m. Thus, the simulation results show the effectiveness.
Similarly, the location error of unknown node out of the triangle with the improved DV-HOP algorithm is shown in the Fig. 12 Because the number of unknown nodes out of the triangle is far less than the number in the triangle, this paper only gives the results of positioning error from 24.1678 m to 12.3507 m. The positioning accuracy of the new DV-HOP algorithm is approved by 49% compared with the traditional one. Above all, this  Table 2 The detailed steps of the proposed algorithm (1) Obtain the information of the minimum hops n between all nodes by broadcasting of nodes. (2) Obtain the average jump distance hop m , according to n and the distances between each node. (3) Obtain the information of minimum hops n m between the unknown node and all anchor-nodes N from (1), and then calculate average hops n.The weighting coefficient ξ m ¼ nm n of distance between the unknown node and anchor-nodes is defined. (4) Calculate average hops hop m , considering ζ m , then, hop m ¼ ξ m hop m , so as to reduce the error caused by the minimal hops and the unimproved average jump distance.
(5) Lastly, calculate the distance between the unknown node and anchornodes with average jump distance and hop m and then estimate the location of the unknown node with OLS. Communication radius 50m Fig. 10 Comparison of location errors of unknown node in the triangle paper adopts the improved APIT algorithm to locate the unknown nodes in the triangle and the improved DV-HOP algorithm to the unknown nodes out of the triangle. So all the unknown nodes can be detected and enhanced the coverage. Through the observation of the above analysis, the proportion of the unknown nodes out of the triangle will reduce if the area is large and the anchor-nodes are distributed reasonably. So, the following part mainly examines the effect of different communication radius to the location of unknown nodes in the triangle. The simulation result is shown in the Fig. 12. At each communication radius, the average result is achieved by 100 times of simulation. Figure 13 shows that the location error is large when the communication radius is smaller than 25 m. This is because the connectivity of anchor-nodes is affected by the communication radius directly, so is the location error. With the increase of communication radius, the location error drops gradually, but become stable when the communication radius tends to more than 50 m. The distribution of nodes、the span of the sensors, the transmission power and the environment may also cause the above result. Figure 14 shows the time complexity of three localization algorithm with different amount of anchor-nodes under the condition: sensor nodes: 200; communication radius: 60m;the time of simulation: 1000. Simulation result shows that the time complexity of the proposed algorithm reduced by 10.045% compared to APIT algorithm, as well as increased by11.65% compared to the DV-HOP algorithm. Because the proposed algorithm needs to judge whether the unknown node in the triangle, which increasing the time complexity of the algorithm.

Conclusion
In order to improve localization accuracy and coverage rate of sensor nodes in WSN, a hybrid algorithm integrating APIT and DV-HOP has been proposed in this paper. According to the method of angle detection, all the unknown nodes are divided into parts by the boundary of triangle. The unknown nodes in the triangle will adopt APIT algorithm, and the rest nodes will adopt improved DV-HOP with weighting of hops. First of all, the accurate judgment the location of the unknown nodes is a preparation for the localization of later APIT algorithm, which improves the localization accuracy of the unknown nodes in the triangle. The rest unknown nodes adopt   improved DV-HOP algorithm that optimizes the hops by making full use of redundant information in the process of calculation. In the simulation, one can see that the hybrid algorithm has lower localization error compared with the traditional APIT and DV-HOP algorithms.