Paper—Research on Localization of Unknown Nodes in Wireless Sensor Network based on Centroid Ite... Research on Localization of Unknown Nodes in Wireless Sensor Network based on Centroid Iteration

This paper proposes the localization of unknown nodes based on the centroid iteration algorithm. It uses the range-free localization method and proposes the iteration stopping criterion for centroid iteration algorithm and node localization flow chart according to the location of the unknown nodes based on the plane enclosed by N beacon nodes and those where the received signals of the unknown node are gradually weakened, and finally achieves the accurate localization of unknown communication nodes. Simulation results show that with the proportion of beacon nodes increasing, the relative error of calculation is gradually reduced; when the proportion of beacon nodes remains the same, with the radio range of the node increasing, the relative error of localization gradually decreases. When the radio range is small (R=15m, R=20m), with the proportion of beacon nodes increasing, the relative error of localization increases instead of decreasing. Compared with other three traditional centroid localization algorithms, the algorithm proposed in this paper can achieve the minimum relative localization error at different radio ranges. Under this algorithm, the localization is accurate and highly resistant to RSSI errors. Calculation results show that the optimal radio range R = 30m. Keywords—wireless sensor network; centroid iteration algorithm; node localization; range-free localization.


Introduction
The wireless sensor network has been widely used in military reconnaissance, harsh environment exploration, disaster relief and other fields. To the wireless sensor network technology, the precise localization of nodes is extremely important -it is the premise for applications like positioning and tracking of monitoring targets and also a basic subject and hot spot in current wireless sensor network researches [1][2][3].
Wireless sensor network nodes can be divided into beacon nodes and unknown nodes, depending on whether the node has the GPS positioning function. Node localization is a technology by which an unknown node locates itself according to the known locations of beacon nodes around it [4][5]. Existing researches have mainly classified the wireless sensor network node localization algorithms into two categories -range-based localization algorithm and range-free localization algorithm [6][7].
The range-based localization algorithm locates a node mainly by calculating the distances between the unknown node and the surrounding beacon nodes, mainly including range-based localization by received signal strength, signal propagation time and time difference of arrival of signals [8]. The range-based localization algorithm is generally highly accurate, but it has high demands for network hardware equipment and requires complex computation -in other words, the communication costs are high [9]. The range-free localization algorithm mainly uses information like network connectivity or inter-node hop count to locate a node. It includes the centroid localization algorithm and Monte Carlo localization algorithm [9][10][11]. The range-free localization algorithm does not need to accurately calculate the distances between the unknown node and beacons nodes, reducing the network computation amount and communication costs [12].
Centroid algorithm is a classic range-free node localization algorithm. The traditional centroid localization algorithm estimates the coordinate of the unknown node by averaging the coordinates of the known nodes around it. However, the computation accuracy is low because the distance between the unknown node and the beacon nodes is not taken into account. Later, researchers improved the traditional centroid algorithm and achieved many research results [13][14][15][16].
This paper proposes the localization of unknown nodes based on the centroid iteration algorithm. It uses the range-free localization method and proposes the iteration stopping criterion for centroid iteration algorithm and node localization flow chart according to the location of the unknown nodes based on the plane enclosed by N beacon nodes and those where the received signals of the unknown node are gradually weakened, and finally achieves the accurate localization of unknown communication nodes. The research results can be used as theoretical reference for the localization of wireless sensor network nodes.

2
Localization of Unknown Nodes based on Centroid Iteration Algorithm

Principle for node localization algorithm
Let there be an unknown node M(x, y) on a 2D plane, and the node connects with N beacon nodes F 1 , F 2 , … F n . Let the coordinate of F n be (x n , y n ), and then the distance d Mn between F n and M can be expressed as follows: Let the centroid of the 2D plane enclosed by F 1 , F 2 , … F n be M 1 (x M1 , y M1 ), and then the coordinate of centroid M 1 can be expressed as follows: The distance d MM1 between M 1 and the unknown node M can be expressed as follows: Based on the above formulas, we can see that when the coordinates of F 1 , F 2 , …F n and the distances between them and the unknown node are known, we can obtain the coordinate of centroid in the area enclosed by the beacon nodes and the distance between this centroid and the unknown node using Formula (1)-(3). We substitute Formula (2) into (3) and make a number of simplifications and then: Let the two terms on the right side of the equation (4) be G 1 and G 2 , which are simplified into: d ij is the distance between two random beacon nodes F i and F j . Let's suppose the distances between N beacon nodes and the unknown node M satisfies the following inequality (6): According to (6), we can figure out that G 1 <(d mn ) 2 and G 2 >0. According to (1)-(6), we can get to know that d MM1 <d Mn , i.e., there is at least one node F n among the beacon nodes, whose distance to the unknown node M is definitely greater than the distance d MM1 between the centroid M 1 of the space formed by beacon nodes and M. We substitute M 1 for the beacon nodes F n , which is the farthest away from the unknown node M, so the new 2D plane is formed by F 1 , F 2 , … F n-1 and M 1 , and the distance between the centroid of the new 2D plane and M is definitely shorter than d MM1 . By using the above method, we keep doing iterations and finally get the accurate location of the unknown node.
Though this method can help us get a precise node location, it will also increase communication costs and computation amount. Therefore, in this paper, we substitute the received signal strength indicator (RSSI) for the distance between the unknown node and the beacon node to simplify the iterative algorithm. Let the received signal strength between the unknown node M and F n be S n . Then based on the signal freespace propagation theory, we get: ! is the correlation parameter. Let !=3. 2-4.5. Then the RSSI P MM1 between the unknown node and the centroid M 1 is: The expression for A is A=-10lgP 1 , with the optimal value range being 45-50. According to Formula (2) and (8), we can continuously narrow the range of the plane where the unknown node is located through multiple iterations without calculating the distances between beacon nodes and the unknown node to increase the node localization accuracy.

Conditions to terminate the centroid iteration algorithm
The number of iterations is an important part of centroid iteration localization algorithm. Too few iterations cannot make the computation reach a high accuracy while too many iterations will increase computation amount and also can easily put the algorithm in an infinite loop. According to the preceding section, we can get to know that when the number of iterations is n+1, the distance d MMn+1 between the centroid M n+1 of the 2D plane formed by F 1 , F 2 ,…F n-1 and M n and the unknown node should satisfy the following equation: d iMMn is the distance between the i-th beacon node F i and the centroid of the 2D plane obtained after n iterations. The centroid distance after 2 iterations is: Let the two terms on the right side of the equation be G 3 and G 4 . Then we can easily figure out that G 3 >0 and G 4 <0. After making a number of transformations to (10), we get: From (11), we can see that with the number of iterations increasing, the area of the plane formed by various nodes will gradually decrease, but when the number of iterations reaches a certain value, the accuracy of the unknown node localization after n+1 iterations may not necessary be higher than that after n iterations.
In order to cover all circumstances, we consider the location of the unknown node M in two scenarios: (1) The unknown node has always been in the 2D plane formed by the beacon nodes. Then the condition to terminate the algorithm is when the RSSI between the centroid obtained after iterations and the unknown node M is greater than the set threshold value " 1 , i.e.: 1 MMn P ! > (12) (2) The unknown node is outside the 2D plane formed by the beacon nodes. Then we choose any beacon node as the fixed end point and construct 1/2(N-1)(N-2) triangles. And the condition to terminate the algorithm is when the rate of change in the estimation accuracy of the localization algorithm is less than a certain threshold value " 2, i.e.

Iteration algorithm flow
According to the above method, we obtain the iteration termination condition for the centroid iteration algorithm proposed in this paper and the node localization flow chart, as shown in Fig. 1 and 2. From Fig. 1, we can see that before determining the iteration termination condition for the centroid iteration algorithm, first we need to set one beacon node between which and the unknown node the RSSI is the weakest as the fixed endpoint and get 1/2(N-1)(N-2) triangles with the remaining beacon nodes after a number of transformations, and then determine the location relationship between the unknown node M and the n-th triangle. If M is inside the triangle, then the algorithm will perform multiple iterations and regard Formula (12) as the iteration termination condition; if M is outside the triangle, Formula (13) will be used as the iteration termination condition.
Obtain the RSSI between unknown node and beacon nodes From the flow chart of the centroid iteration algorithm, we can see that during the localization of the unknown nodes, the algorithm first determines the iteration termination condition for the unknown node per Fig. 1, and after multiple iterations, it determines whether the iteration result meets the termination condition. If it does, the algorithm will regard the current coordinate as the location of the unknown node; otherwise, it will choose the beacon node with the weakest RSSI from the unknown node as the new triangle endpoint and use the algorithm proposed in this paper to determine the relation between M and the new triangle. Afterwards, it determines the iteration algorithm per Fig. 1 and carry out node localization.

Simulation test
We perform simulation and analysis of the proposed centroid iteration algorithm. The design range of the wireless sensor network is 200m!200m, and the radio range of the beacon nodes is 100m. Let's suppose there are B beacon nodes in the test area and U unknown nodes. Unknown nodes are randomly distributed in the sensing area, while beacon nodes are evenly distributed in the entire test area. We define the relative error of the centroid iteration algorithm in node localization as: R is the communication radius of the node; (x,y) is the real coordinate of the unknown node; and (x c ,y c ) is the coordinate obtained by the centroid iteration localization algorithm. Fig. 3 shows the relative location error of the centroid iteration algorithm under different proportions of beacon nodes around the unknown node when R=15m, 20m, 25m, 30m and 40m. From the figure we can see that, on the whole, with the increase in the proportion of beacon nodes, the relative error is on gradual decrease; with the same proportion of beacon nodes, when the communication radius of the node is increased, the relative location error is gradually decreased. We can also see from the figure that when the communication radius is small (R=15m or R=20m), with the increase in the proportion of beacon nodes, the relative location error is increased. That is because when the communication radius is small, there is a greater chance that the unknown node will appear in the 2D plane formed by beacon nodes. So the location accuracy of the algorithm experiences irregular fluctuations. Fig. 4 shows the relative location errors of the proposed centroid iteration node localization, traditional centroid localization, APIT algorithm and Monte Carlo localization (MCL) under different proportions of beacon nodes. From the figure we can see that, on the whole, when the communication radius is increased, the relative location errors of 4 algorithms are on the decrease. This is because when the communication radius and the density of beacon nodes are increased, the unknown node can connect to more beacon nodes, meaning that beacon nodes can form more triangles to help the algorithm make decisions and eliminate the negative impact from the situation where the unknown node is outside the triangle area. Compared with other three traditional centroid localization algorithms, the algorithm proposed in this paper has the smallest relative location error under each communication radius, indicating that this algorithm has high localization accuracy and is highly resistant to RSSI errors.   figure, we can see that then when the communication radius remains unchanged, the more beacon nodes there are, the smaller the average location error will be; we can also see that, under any of the 5 numbers of beacon nodes, when the communication radius is 0-30m, there is not much change in the location error; when the communication radius is greater than 30m, the error is significantly increased. So based on all the analysis, we conclude that the optimal communication radius R=30m.

Conclusions
This paper proposes the localization of unknown nodes based on the centroid iteration algorithm. It uses the range-free localization method and achieves the accurate localization of unknown communication nodes through the plane enclosed by N beacon nodes and those where the received signals of the unknown node are gradually weakened. The conclusions of this research are as follows: (1) According to the location of the unknown nodes, it proposes the iterationstopping criterion for centroid iteration algorithm and node localization flow chart. According to RSSI, it takes the beacon node where the RSSI of the unknown node is the weakest as the fixed end point and uses it as the new endpoint of the triangle and improves the node localization accuracy through multi-iterations.
(2) Simulation results show that with the proportion of beacon nodes increasing, the relative error of calculation is gradually reduced; when the proportion of beacon nodes remains the same, with the radio range of the node increasing, the relative error of localization gradually decreases. When the radio range is small (R=15m, R=20m), with the proportion of beacon nodes increasing, the relative error of localization increases instead of decreasing. Compared with other three traditional centroid localization algorithms, the algorithm proposed in this paper can achieve the minimum relative localization error at different radio ranges. Under this algorithm, the localization is accurate and highly resistant to RSSI errors. Calculation results show that the optimal radio range R = 30m.