Mathematical Problems in Engineering

Volume 2018, Article ID 5456191, 11 pages

https://doi.org/10.1155/2018/5456191

## Localization Algorithm Based on Iterative Centroid Estimation for Wireless Sensor Networks

^{1}College of Telecommunications and Information Engineering, Nanjing University of Posts and Telecommunications, Nanjing, Jiangsu 210023, China^{2}College of Computer Science and Technology, Nanjing Forestry University, Nanjing, Jiangsu 210037, China

Correspondence should be addressed to Rui Jiang; nc.ude.tpujn@yar_j

Received 10 November 2017; Revised 17 February 2018; Accepted 14 March 2018; Published 8 October 2018

Academic Editor: Ivan Giorgio

Copyright © 2018 Rui Jiang et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

According to the application of range-free localization technology for wireless sensor networks (WSNs), an improved localization algorithm based on iterative centroid estimation is proposed in this paper. With this methodology, the centroid coordinate of the space enclosed by connected anchor nodes and the received signal strength indication (RSSI) between the unknown node and the centroid are calculated. Then, the centroid is used as a virtual anchor node. It is proven that there is at least one connected anchor node whose distance from the unknown node must be farther than the virtual anchor node. Hence, in order to reduce the space enclosed by connected anchor nodes and improve the location precision, the anchor node with the weakest RSSI is replaced by this virtual anchor node. By applying this procedure repeatedly, the localization algorithm can achieve a good accuracy. Observing from the simulation results, the proposed algorithm has strong robustness and can achieve an ideal performance of localization precision and coverage.

#### 1. Introduction

Wireless sensor network (WSNs) is comprised of multiple sensor nodes through self-organization. It is considered as an information acquisition system for Internet of Things (IoT). The sensor nodes in WSNs generally fall into two categories: the anchor nodes and the unknown nodes. The anchor node’s location is already known, whereas the unknown node’s location is not. However, the information collected by a sensor is usually nonsense without the sensor’s location information. Hence, an accurate node self-location is one of the fundamental and hot problems in the research of WSNs [1, 2]. A variety of algorithms exist for node self-location. Most of these algorithms can be divided into two categories. One is range-based measurement, which realizes self-location of an unknown node by computing the distance or direction between the unknown node and nearby anchor nodes like the received signal strength indication (RSSI) algorithm [3–5], the time of arrival (TOA) algorithm [6, 7], the time difference of arrival (TDOA) algorithm [8], and so forth [9, 10]. This class shows a very accurate location result but is generally very energy-consuming. Furthermore, the additional hardware is usually required. It also increases the overall cost of WSNs. The other one is range-free measurement, which utilizes the connectivity of WSNs to obtain the location information of an unknown node, such as the centroid localization algorithm [11], the approximate point-in-triangulation test (APIT) algorithm [12, 13], the distance vector-hop (DV-Hop) algorithm [14, 15], and so forth [16]. This class is energy-efficient and does not require any additional hardware. Therefore, the range-free measurement is suitable for WSNs and is widely used in practice for its efficient realization.

The number of connected anchor nodes is one of the key factors affecting the performance of localization algorithm, regardless of whether it is range-based measurement or range-free measurement. More connected anchor nodes allow greater location accuracy. However, the methods to improve the location accuracy by increasing the number of connected anchor nodes in WSNs are not available. In order to overcome such difficulty, an improved localization algorithm based on iterative centroid estimation is presented in this paper. Suppose that any two anchor nodes can only be connected by a straight line; the minimal space that can contain all connected anchor nodes is defined as the space enclosed by connected anchor nodes with this methodology. The centroid of this space is deemed as a virtual anchor node to achieve a more accurate localization. First, the centroid coordinate of the space enclosed by connected anchor nodes and the RSSI between the unknown node and the centroid are calculated. With the strict formula derivation, we prove that there exists at least one anchor node, which is further from the unknown node than the centroid. Then, the connected anchor node with the weakest RSSI is replaced with the centroid in order to reduce the space enclosed by the connected anchor nodes. Applying this procedure repeatedly, the localization algorithm can obtain good accuracy. We employ simulation experiments to verify the performance of our methods in terms of the localization precision, coverage, and robustness on RSSI error disturbance.

#### 2. Localization Algorithm Based on Iterative Centroid Estimation

##### 2.1. Virtual Anchor Nodes

Suppose that there are one unknown node and anchor nodes which are connected with . For an arbitrary anchor node in , it is assumed that the coordinate of is and the coordinate of is . Therefore the distance between and is

We denote by the centroid of the space enclosed by . Assume that the coordinate of is . Then, we haveThe distance between and can be calculated asUsing (2), can be expressed as

With , we haveFrom (5), (4) can be simplified asAccording to (2) and (6), it is clear that the coordinate of and the distance between and can be calculated relying only on the known parameters of connected anchor nodes. Now, the centroid has the common features of all the connected anchor nodes. Hence, it can be considered as a virtual anchor node.

##### 2.2. The Convergence Performance of Iterative Centroid Estimation

We denote the distance between and as

Then, (4) can be further simplified by rewriting (6) as

In general, it is assumed that . It is easy to show that

From (8)-(9), we can draw the conclusion that . Obviously, there exists at least one connected anchor node whose distance from must be farther than . Therefore, the space enclosed by and must be smaller than the original space enclosed by . In the proposed algorithm, the centroid is deemed as a virtual anchor node. The farthest anchor node would be replaced by the virtual anchor node in order to reduce the enclosed space and improve the location precision. The algorithm can achieve a more accurate localization by repeating the described replacement procedure.

##### 2.3. The Energy Consumption in Localization Algorithm

Based on the fact that each node in WSNs has only limited energy, it is crucial to control energy consumption in localization algorithm to extend the WSNs lifetime. However, the calculation of will greatly increase the node energy consumption. To solve this problem, RSSI is used directly to represent distance information in proposed localization algorithm. Based on the propagation theory, the relationship between distance and RSSI is mentioned in [17]:

Here, refers to RSSI between and . is a factor of distance attenuation. The value of is determined according to the working environment of WSNs. A large amount of experimental data evidences that the optimal range of the empirical attenuation factor is 3.24~4.5. In practical application, the value of can be further determined by the RSSI and the distance between anchor nodes. Let ; (10) can be rewritten after taking logarithm:where

The parameter represents the RSSI when the distance to the node is one meter. As well as parameter , the value of is determined according to the working environment of WSNs. After parameter is determined, the value of can also be further calculated by the RSSI and the distance between anchor nodes. In some practical application such as ZigBee, the optimum is given empirically from 45 to 49. From (8) and (11), we can derive that RSSI between the virtual anchor node and is

The weaker RSSI is, the farther the distance will be. Using (13), the energy consumption in proposed localization algorithm can be reduced effectively via avoiding the procedure of distance calculation. To improve the location precision, the centroid is used as a virtual anchor node to replace the connected anchor node with the weakest RSSI. Besides, it is noteworthy that the two-dimensional node localization can be viewed as special three-dimensional node localization with the same height across all the nodes. Hence, the proposed algorithm can also be applied to two-dimensional node localization.

##### 2.4. The Stopping Criterion of the Localization Algorithm

During the th iteration, suppose that the connected anchor nodes are . The distance between the centroid and the unknown node can be determined according to (8), which satisfieswhere is the distance between anchor node and unknown node defined in (1). is the distance between anchor node and defined in (7). In general, it is assumed that . Similarly, the distance between the centroid and the unknown node during the iteration should satisfy the following equation:where is the distance between anchor node and the centroid derived from the th iteration. From (8) and (11), we havehere,

According to (9), we can easily get the conclusion that . When the coordinate of is , can be expressed aswhere

Then, can be further simplified as

Similarly,

From (20)-(21), can be simplified ashere, is the distance between anchor node and the centroid derived from the th iteration. With (16)–(22), we have

Obviously, we cannot guarantee the location accuracy of the iteration to be higher than that of the th iteration. Take two-dimensional node localization as an example; we assume the simplest situation, that is, when the number of connected anchor nodes to give a more intuitive description of this problem. The relationship of the position between and original anchor nodes is shown in Figure 1.