# Improved Grid-Scan Localization Algorithm for Wireless Sensor Networks

Authors: Raghava Srinivasa Nallanthighal; Veeranjaneyulu Chinta
Journal: Journal of Engineering
 (2014)

---

## Abstract

Localization is a fundamental and crucial service for various applications in wireless sensor networks (WSNs). In this paper an improved grid-scan localization algorithm has been proposed. In the proposed algorithm, information about 1-hop, 2-hop, and farther neighboring anchors has been collected that estimates the region using 1-hop anchors. Then, this estimated region is divided into a grid array, finding valid grids using 1-hop and 2-hop anchors information. In addition to that the farther anchor information further reduces the valid grids. The proposed algorithm achieves better location estimation accuracy than the existing grid-scan algorithm.


---

## Body

## 1. Introduction

A wireless sensor network (WSN) consists of a number of randomly arranged sensor nodes. Each sensor node is capable of sensing and communicating with another sensor node in the designed communication range. In WSNs some sensor nodes have prior knowledge about their location which can be obtained from hardware connected to such nodes. These nodes are known as anchor nodes. The hardware may also be a GPS system. The sensor nodes which do not have knowledge about their location are called normal nodes. Some of the applications of such WSNs are vehicle tracking, target tracking, wildlife habitat monitoring, and disaster management. These applications without the knowledge of the location are absurd.One of the methods to obtain the location of a normal node is to connect the hardware to it. The WSNs consist of several hundreds of sensor nodes. Hence, the overall cost of WSNs increases. In some places GPS system cannot be operated such as mines and indoor environment as there is a problem in communication. To overcome the above problems several localization algorithms were proposed. Localization algorithms are classified into two categories: range-based algorithms and range-free algorithms. The range-based algorithms estimate the coordinates of nodes from pairwise distances using special hardware. This hardware is used to measure angle of arrival (AOA) [1], time of arrival (TOA) [2], time of difference arrival (TDOA) [3], received signal strength indicator (RSSI) [4], and so forth. The calculation of distance or angle can be affected by multipath propagation and noise. Moreover, these algorithms need additional devices to measure the angle or distance between sensor nodes.In range-free algorithms, the localization between normal nodes is obtained through connectivity with the neighboring sensors which do not require any additional hardware. This significantly reduces the overall cost and energy consumption. Some of these algorithms are the area based approach (APIT) [5], centroid [6] DV based positioning (DV hop) [7], the convex position estimation (CPE) [8], and Monte Carlo localization (MCL) [9]. When in large scale, low-cost, low-power consumption is considered range-free algorithms which are superior to range-based algorithms. In localization, both CPE and APIT algorithms use only 1-hop anchors. Kim et al. [10] showed that the above range-free algorithms suffer from high message transmission cost for collecting connectivity information and high computational cost to estimate the positions of normal nodes. Moreover, these algorithms have shown a high estimate of localization error. To improve the localization accuracy distributed range-free localization scheme (DRLS) [11, 12] and grid-scan localization (GSL) [13] are introduced within 2-hop distance. But the former does not use 2-hop anchor nodes and the latter does not use the farther anchor nodes.In this paper, we proposed an algorithm which improves the performance of the GSL algorithm by using the information about 1-hop, 2-hop, and farther anchors. A 2-hop anchor is defined as the anchor node covering normal nodes in 2-hop range but not in 1-hop range. A farther anchor is defined as the anchor node that does not cover the normal node but covers the normal node’s estimated region in 2-hop range.


## 2. Proposed Algorithm

WSN consisting ofn sensor nodes and few m
(
m
<
n
) anchor nodes with unique identification is considered with the transmission range of r units. The proposed algorithm (Figure 1) is mainly divided into four phases: collection of anchor’s information, region estimation, a grid array (GA), and evaluation.Figure 1
The flow chart for proposed algorithm.


### 2.1. Anchor’s Information

In this phase, initially each anchor node collects information about the location and identification of the anchor nodes within the 2-hop distance. The information collected is known as anchor message through 2-hop flooding technique. Each normal node collects the information about the location and identification of 1-hop and 2-hop anchors and also collects anchor messages from the 1-hop anchors. Finally, each normal node has the 1-hop, 2-hop, and farther anchor’s information.


### 2.2. Estimative Region

In this phase, we intend to get four edges of the estimative region (ER) using 1-hop anchors. Each normal node consists ofN 1-hop anchors. A circumrectangle for each 1-hop anchor node whose center is anchor coordinates of length and breadth (
2
*
r
) is drawn. The length and breadth of the circumrectangle are parallel to x-axis and y-axis, respectively. The estimated point of normal node is located in the overlapping region of all circumrectangles. The coordinates of the estimative region (
x
min
⁡
,
x
max
⁡
,
y
min
⁡
,
y
max
⁡
) are found as follows:
(1)
x
min
⁡
=
min
⁡
i
=
1
N
{
x
i
-
r
}
,
x
max
⁡
=
max
⁡
i
=
1
N
{
x
i
+
r
}
,
y
min
⁡
=
min
⁡
i
=
1
N
{
y
i
-
r
}
,
y
max
⁡
=
max
⁡
i
=
1
N
{
y
i
+
r
}
,
where (x
i
,
y
i) are coordinates of 1-hop anchors.


### 2.3. Grid Array

In this phase, we find grid array (GA) using ER and grid scale (GS) parameter, where GS is the size of the grid. Grid array is found as follows:(2)
m
=
⌊
(
x
max
⁡
-
x
min
⁡
)
GS
⌋
,
n
=
⌊
(
y
max
⁡
-
y
min
⁡
)
GS
⌋
.If(
m
=
0 when (
x
max
⁡
-
x
min
⁡
)
<
GS
) or (n
=
0 when (
y
max
⁡
-
y
min
⁡
)
<
GS
) grid array size is zero. To avoid this situation, we reduce the GS as GS/2 until we obtain m
≠
0 and n
≠
0. The center of grid point represents the regional grid. G
m
×
n is an array of grid points found as follows:
(3)
G
i
j
=
{
x
min
⁡
+
(
i
-
1
2
)
×
GS
,
y
min
⁡
+
(
j
-
1
2
)
×
GS
}
,
where i
=
1 to m and j
=
1 to n.


### 2.4. Finding Valid Grids

In this phase, valid grid points and estimated location of normal node have been found. The validity of grid points is obtained by testing the distance between the grid point and 1-hop, 2-hop, and farther anchors, respectively. The validity of the grid is tested, if grid point is within 1-hop range, for all 1-hop anchors, and within 2-hop range, but not in 1-hop range, for all 2-hop anchors. In addition to the above, farther anchors information is used to further reduce the valid grids. If the considered anchor is a farther anchor, but not a 2-hop anchor, the grid points within 2-hop range were considered invalid. Otherwise, grid is invalid, if grid points do not satisfy the above conditions. After testing, we eliminate the invalid grids and find the estimated location of normal nodes as the average of all valid grids. Estimated location(
x
e
,
y
e
) is found as follows:
(4)
(
x
e
,
y
e
)
=
{
1
N
∑
1
N
x
i
,
1
N
∑
1
N
y
i
}
,
where N is the number of valid grids and (
x
i
,
y
i
) are a set of valid grid points.


## 2.1. Anchor’s Information

In this phase, initially each anchor node collects information about the location and identification of the anchor nodes within the 2-hop distance. The information collected is known as anchor message through 2-hop flooding technique. Each normal node collects the information about the location and identification of 1-hop and 2-hop anchors and also collects anchor messages from the 1-hop anchors. Finally, each normal node has the 1-hop, 2-hop, and farther anchor’s information.


## 2.2. Estimative Region

In this phase, we intend to get four edges of the estimative region (ER) using 1-hop anchors. Each normal node consists ofN 1-hop anchors. A circumrectangle for each 1-hop anchor node whose center is anchor coordinates of length and breadth (
2
*
r
) is drawn. The length and breadth of the circumrectangle are parallel to x-axis and y-axis, respectively. The estimated point of normal node is located in the overlapping region of all circumrectangles. The coordinates of the estimative region (
x
min
⁡
,
x
max
⁡
,
y
min
⁡
,
y
max
⁡
) are found as follows:
(1)
x
min
⁡
=
min
⁡
i
=
1
N
{
x
i
-
r
}
,
x
max
⁡
=
max
⁡
i
=
1
N
{
x
i
+
r
}
,
y
min
⁡
=
min
⁡
i
=
1
N
{
y
i
-
r
}
,
y
max
⁡
=
max
⁡
i
=
1
N
{
y
i
+
r
}
,
where (x
i
,
y
i) are coordinates of 1-hop anchors.


## 2.3. Grid Array

In this phase, we find grid array (GA) using ER and grid scale (GS) parameter, where GS is the size of the grid. Grid array is found as follows:(2)
m
=
⌊
(
x
max
⁡
-
x
min
⁡
)
GS
⌋
,
n
=
⌊
(
y
max
⁡
-
y
min
⁡
)
GS
⌋
.If(
m
=
0 when (
x
max
⁡
-
x
min
⁡
)
<
GS
) or (n
=
0 when (
y
max
⁡
-
y
min
⁡
)
<
GS
) grid array size is zero. To avoid this situation, we reduce the GS as GS/2 until we obtain m
≠
0 and n
≠
0. The center of grid point represents the regional grid. G
m
×
n is an array of grid points found as follows:
(3)
G
i
j
=
{
x
min
⁡
+
(
i
-
1
2
)
×
GS
,
y
min
⁡
+
(
j
-
1
2
)
×
GS
}
,
where i
=
1 to m and j
=
1 to n.


## 2.4. Finding Valid Grids

In this phase, valid grid points and estimated location of normal node have been found. The validity of grid points is obtained by testing the distance between the grid point and 1-hop, 2-hop, and farther anchors, respectively. The validity of the grid is tested, if grid point is within 1-hop range, for all 1-hop anchors, and within 2-hop range, but not in 1-hop range, for all 2-hop anchors. In addition to the above, farther anchors information is used to further reduce the valid grids. If the considered anchor is a farther anchor, but not a 2-hop anchor, the grid points within 2-hop range were considered invalid. Otherwise, grid is invalid, if grid points do not satisfy the above conditions. After testing, we eliminate the invalid grids and find the estimated location of normal nodes as the average of all valid grids. Estimated location(
x
e
,
y
e
) is found as follows:
(4)
(
x
e
,
y
e
)
=
{
1
N
∑
1
N
x
i
,
1
N
∑
1
N
y
i
}
,
where N is the number of valid grids and (
x
i
,
y
i
) are a set of valid grid points.


## 3. Simulation Results

In this section, the proposed algorithm is simulated to evaluate the performance and to compare it with GSL [13]. We simulated proposed algorithm in Matlab, with 200 sensor nodes, which are randomly distributed in 100
×
100 unit rectangular regions and each sensor node is assigned with unique identification. We fixed a range (
r
) of sensor node as 20 units and grid size as 0.1
*
r.In our simulation we compared the error and accuracy of estimated location.Estimation error is found as follows:(5)
Δ
e
=
(
x
r
-
x
e
)
2
+
(
y
r
-
y
e
)
2
,
Average
Error
Δ
E
=
1
n
∑
i
=
m
+
1
n
Δ
e
i
,
Estimation accuracy:
ρ
=
(
1
-
Δ
E
r
)
×
100
%
,
Anchor
ratio
=
m
(
m
+
n
)
,
where m is the number of anchor nodes,n is the total number of sensor nodes, (
x
r
,
y
r
) is real position, and (
x
e
,
y
e
) are estimated position.


### 3.1. Comparison of Estimation Error

In this section, we have shown the estimation error of the proposed algorithm and its comparison with GSL algorithm. In both algorithms, number of anchor nodes is 20.Figure2 shows the plot of normal node versus location estimation error. For each normal node, the location estimation error found by the proposed algorithm is less than or equal to the existing GSL algorithm. The reason for a higher accuracy is that the proposed algorithm uses 1-hop, 2-hop, and farther anchor information in finding location estimation error, whereas GSL algorithm uses only 1-hop and 2-hop anchors.Figure 2
Normal node versus estimation error.


### 3.2. Normalized Error

This section compares the normalized error of the proposed algorithm with that of the GSL algorithm. In both algorithms anchor nodes ratio changed between 0.05% and 0.45%.Figure3 shows the plot of anchor ratio versus normalized error. It is evident from Figure 2 that the normalized error decreases with the increase of anchor ratio. When the anchor ratio is very low (0.05), the proposed algorithm shows nearly 50% less normalized error than GSL algorithm. When the anchor ratio has increased to 0.1, the normalized error by proposed algorithm is 0.4, and by GSL algorithm it is 0.7. When the anchor ratio varies between 0.3 and 0.45, the proposed algorithm shows around 0.2 and GSL algorithm shows around 0.4 normalized error. The above discussion shows that the normalized error is less in a proposed algorithm when compared to the existing GSL algorithm.Figure 3
Normalized error.


### 3.3. Accuracy

In this section, we have shown the accuracy percentage of the proposed algorithm and its comparison with GSL algorithm. In both algorithms anchor nodes ratio changed between 0.05% and 0.45%.Figure4 shows the plot of anchor ratio versus percentage of accuracy. It is evident from Figure 3 that the accuracy percentage increases when the anchor ratio increases. When the anchor ratio is very low (0.05), the accuracy percentage by proposed algorithm is around 60%, and by GSL algorithm it is around 25%. When the anchor ratio is increased to 0.1 the accuracy percentage by proposed algorithm is 70% and by GSL algorithm it is 50%. When the anchor ratio varies between 0.3 and 0.45, the proposed algorithm shows around 85% and GSL algorithm shows 70%. The above discussion shows that the location estimation accuracy is better in a proposed algorithm when compared to the existing GSL algorithm.Figure 4
Anchor ratio versus accuracy (%).


## 3.1. Comparison of Estimation Error

In this section, we have shown the estimation error of the proposed algorithm and its comparison with GSL algorithm. In both algorithms, number of anchor nodes is 20.Figure2 shows the plot of normal node versus location estimation error. For each normal node, the location estimation error found by the proposed algorithm is less than or equal to the existing GSL algorithm. The reason for a higher accuracy is that the proposed algorithm uses 1-hop, 2-hop, and farther anchor information in finding location estimation error, whereas GSL algorithm uses only 1-hop and 2-hop anchors.Figure 2
Normal node versus estimation error.


## 3.2. Normalized Error

This section compares the normalized error of the proposed algorithm with that of the GSL algorithm. In both algorithms anchor nodes ratio changed between 0.05% and 0.45%.Figure3 shows the plot of anchor ratio versus normalized error. It is evident from Figure 2 that the normalized error decreases with the increase of anchor ratio. When the anchor ratio is very low (0.05), the proposed algorithm shows nearly 50% less normalized error than GSL algorithm. When the anchor ratio has increased to 0.1, the normalized error by proposed algorithm is 0.4, and by GSL algorithm it is 0.7. When the anchor ratio varies between 0.3 and 0.45, the proposed algorithm shows around 0.2 and GSL algorithm shows around 0.4 normalized error. The above discussion shows that the normalized error is less in a proposed algorithm when compared to the existing GSL algorithm.Figure 3
Normalized error.


## 3.3. Accuracy

In this section, we have shown the accuracy percentage of the proposed algorithm and its comparison with GSL algorithm. In both algorithms anchor nodes ratio changed between 0.05% and 0.45%.Figure4 shows the plot of anchor ratio versus percentage of accuracy. It is evident from Figure 3 that the accuracy percentage increases when the anchor ratio increases. When the anchor ratio is very low (0.05), the accuracy percentage by proposed algorithm is around 60%, and by GSL algorithm it is around 25%. When the anchor ratio is increased to 0.1 the accuracy percentage by proposed algorithm is 70% and by GSL algorithm it is 50%. When the anchor ratio varies between 0.3 and 0.45, the proposed algorithm shows around 85% and GSL algorithm shows 70%. The above discussion shows that the location estimation accuracy is better in a proposed algorithm when compared to the existing GSL algorithm.Figure 4
Anchor ratio versus accuracy (%).


## 4. Conclusion

In the wireless sensor networks, the sensor node localization is essential for many applications. The grid-scan algorithm (GSL) does not use the farther anchor’s information. Hence, in our proposed algorithm we use the farther anchor’s information besides 1-hop and 2-hop anchors. Initially, the normal node collects the information of 1-hop, 2-hop, and further anchor information. Secondly, proposed algorithm uses 1-hop anchors to determine the estimated region (ER) which is further divided into grid array according to the grid scale. Then, we use 1-hop and 2-hop anchors information to find the valid grids. In addition, for further improvement of location accuracy, we use farter anchor information. Finally, estimated location is the average of all valid grids. Simulation results have shown that the proposed algorithm achieves better location estimation accuracy than the existing GSL algorithm.



---

*Source: 628161-2014-09-10.xml*