Sie sind auf Seite 1von 5

FIREFLY ALGORITHM OPTIMIZATION BASED WSN

LOCALIZATION ALGORITHM
Bingnan Pei, Hao Zhang*, Tengda Pei,Hongyan Wang
Information Engineering College,Dalian University,Dalian,Liaoning 116622
Keywords Wireless sensor network(WSN), Firefly
algorithm, Node location, Location error.

Abstract
Regarding the relatively big errors with running the DV-Hop
localization algorithm in a network topology environment,
with which the nodes were randomly distributed, the firefly
algorithm(FA) was used to correct the position estimated by
DV-Hop, a firefly optimization localization algorithm based
on DV-Hop was proposed. The mathematical model was
built with the smallest error for all of unknown nodes, and
the firefly algorithm was used to obtain the optimal solution
of the model without additional devices and increasing the
traffic. The simulation results show that the average
localization error of the FDV-Hop algorithm is significantly
improved compared with the original algorithm.

1 Introduction
In Wireless Sensor Networks, location information is critical
for the monitoring activities of sensor networks, the monitor
messages without location information are usually
meaningless. Therefore, to determine the position the event
occurred or the location information of the sensor nodes is
one of the most basic functions of the sensor nodes, which
plays a crucial role in the sensor network application [1].
The sensor nodes are divided into beacon nodes and
unknown nodes depending on whether the node's position is
known or not. Beacon nodes share a very small proportion in
the network nodes and their exact location can be got
through GPS positioning equipment or other methods.
Beacon nodes are reference point for the location of the
unknown nodes. According to whether the positioning
process need to measure distance between nodes, the
localization algorithm [2] are divided into distance-based
and distance irrelevant. The distance-based ones estimate the
position through measuring the actual distance or the
azimuth between the neighboring nodes, which can obtain a
better positioning accuracy at the cost of external hardware
support, the other ones use the number of hops between
nodes to estimate the distance without external hardware
devices support, the cost is relatively lower comparing to the
distance-based ones. At the same time, since the algorithm is
simple, the distance-independent positioning algorithms are
getting more and more attention. Nowadays the most studied
algorithms include centroid algorithm [3], amorphous
algorithm [4], APIT algorithm [5] and DV-Hop algorithm
[6].

DV-Hop algorithm is the most widely used among


distance-independent localization algorithm, but it has a bad
positioning accuracy. Therefore, some researchers used
genetic algorithms(GA), simulated annealing algorithm
(SAA), Particle Swarm Optimization(PSA) to optimized the
DV-Hop algorithm for a better position accuracy [7-9]. In
this paper, the FA (Firefly algorithm) [10] is used to
optimize the results of DV-Hop localization algorithm.
Simulation results show that the improved algorithm can
improve the location accuracy of the sensor node without
increasing the hardware cost, low the positioning error at the
same time.

2 DV-Hop localization algorithm


The positioning process of DV-Hop algorithm is divided into
three phases as following:
Step1: computing the minimal hops between beacon
nodes and unknown nodes
Beacon nodes broadcast a packet including location
information and the number of hops Hopsi (initialized to 0)
to its neighbor nodes. Then the unknown nodes record the
minimum number of hops from each beacon node, while
ignoring the packet having a bigger hop-counts from the
same beacon node, then add one to the hop-counts and
forwarded it to the neighbor nodes.
Step2: calculating jump distance between unknown nodes
and beacon nodes
The recoded location information and hop-counts were
used to estimates the average per hop distance by Eq(1),

HopSizei

j zi

( xi  x j ) 2  ( y i  y j ) 2

(1)

j zi

Where ( x i , y i ) , ( x j , y j ) is the coordinates of beacon


nodes i, j h j is the hops-count between beacon i and
beacon j
ji. Then, the beacon node broadcasts the
packet including the average per hop distance with a lifetime
to the network, then the unknown node only record the
average per hop distance which was first received and
forward it to the neighbor nodes. After receiving the average
hop distance, unknown node use the hops obtained at the
first stage to calculate the jump distance from each beacon
node by Eq (2),
 d i Hopsizei u Hopsi   
Step3: least squares positioning
Suppose the coordinates of the ith beacon node is xiyi,

the coordinates of the unknown node k is (x, y), the distance


between node k and the ith beacon node is dki, then N times
measurement can obtain Eq (3) shown as follows:
( x1  x) 2  ( y1  y ) 2
( x2  x) 2  ( y 2  y ) 2

d k12

dk 22

(3)

( x N  x) 2  ( y N  y ) 2 d kN 2
The N-th equation was subtracted by the previous (N-1)

equations

respectively.

Set

di

equations can be written as Ax=b,


2 x1  x N
,
2( y1  y N )

A
#
#

2( x N 1  x N ), 2( y N 1  y N )

xi2  yi2

,then

the

x
y

2
d12  d N2  d kN
 d k21

2
 d k22
d 22  d N2  d kN

b
.
#
2

2
2
2
d N 1  d N  d kN  d k ( N 1)
The result of Ax=b can be got according to Eq(3) as
x=(ATA)-1ATb.

3 Firefly algorithm optimization based Node


localization algorithm
The positioning problem of wireless sensor networks is to
find exact solutions of nonlinear equations, thus it has been
proved to be an NP-hard problem [11]. The error of DV-Hop
algorithm is mainly caused by the inaccurate average per
hop distance which was calculated through the actual
distance divides the hops, since the nodes are randomly
distributed in the network, the distance between nodes can
not be ensured to be linear distance, thus resulting in large
errors. The experimental results show that the firefly
algorithm is more effective, higher success rate than GA and
PSO in the aspect of finding global optimal solution, thus
having great potential in solving NP-hard problem [12,13].
Therefore, this paper uses FA to optimize the late stage of
positioning problem to get better positioning accuracy.

3.1 Firefly optimization algorithm


Firefly algorithm simulates the biological characteristics of
adult fireflies glowing in nature, which was proposed in
2009 by scholar Yang from the University of Cambridge. FA
has the advantages of high speed of capturing the pole range,
high capture efficiency and strong commonality.
Firefly optimization algorithm, which random initializes a
group of fireflies in the solution space, each firefly has the
same fluorescein values and their own decision domains
Rdi (0< Rdi <Rs). Firefly individuals fluorescein values are
relevant with the objective function which depends on their
position. The greater the fluorescein values are, the better
position the firefly have, namely the optimal objective
function value. Each firefly goes to its neighbors with a
certain probability. If firefly j wants to become neighbor of

firefly i, firefly j must meet that its fluorescein values is


larger than firefly i and it is in the decision domain of firefly
i. The size of the decision domain depends on the number of
individuals within the neighborhood radius. The decision
domain must be large enough for finding a sufficient number
of fireflies. Through constant motion of fireflies, more
fireflies will eventually gather at around the position with a
higher fitness value.
In FA, the iteration can be divided into the three phases:
1) Fluorescein update phase: each firefly updates their
fluorescein according to Eq (4),
li (t ) (1  U )li (t  1)  Jf ( xi (t ))
(4)
Where li(t) is the fluorescein value of ith firefly in tth
generation, J is the update rate of fluorescein values, U is
control parameter of fluorescein values, f(x) is the fitness
evaluation function.
2) Calculate the path selection probabilities: Firefly i select
firefly j within the scope of the neighborhood in a certain
probability and it moves toward to firefly j. The probability
selection formula is as Eq (5),
l j (t )  li (t )
(5)
Pij (t )
l k (t )  li (t )
kNi (t )

Where
the
neighborhood
i
Ni (t) { j : dij (t)  Rd (t);li (t)  l j (t)},0  Rdi (t) d Rs ,Rs is

set
the

perceived radius of firefly.


3) Location updates and decision domain update phases: the

next generation location of Firefly i is determined by Eq (6),


x j (t )  xi (t )
xi (t  1) xi (t )  s u (
)
(6)
|| x j (t )  xi (t ) ||
Where xi(t) is the position of tth generation of firefly i in
m-dimensional space, || x || is the standard Euclidian
distance operator, s(>0) represents the length of step. Finally,
update the decision-making domain radius according to
Eq(7),

Rdi (t 1) min{Rs , max{0, Rdi (t)  E (nt  | Ni (t) |)}}


(7)
Where E is a proportional constant, nt is the parameters
controlling the number of neighbor fireflies, |Ni(t)| is the
number of neighbor fireflies of firefly i.
3.2 FA optimization based localization algorithm
proposed

The location errors in wireless sensor network mainly


caused by the related ranging technology inevitably exist.
The location problem is to minimize the error. Optimizing
node position can be transformed into a positioning error

minimization problem. Assuming that ( x, y ) is the


estimated position of the node to be located, (xi,yi) is the
actual position of ith beacon node, the distance between the
unknown nodes and ith beacon node can be obtained by
Eq(8),

di

( xi  x ) 2  ( y i  y ) 2

Then the fitness function can be represent as Eq(9),

(8)

Fitness( x, y )

(d i  d i )

(9)

Where di is the measured distance between unknown


nodes and ith beacon node. The smaller the fitness function,
the better the result. Therefore, the positioning problem of
unknown nodes can be transformed to the problem of
minimizing the fitness function.
The procedure of FA optimization based positioning is as
follows:
Step1: initialize firefly group. Assume that the maximum
positioning error of unknown nodes obtained by the least
squares method is , then uses the estimate coordinates of
the unknown node as the center of a circle, as the radius of
the circle to draw a circle that is the initial solution space of
firefly algorithms. Randomly selects N points in the solution
space as the initial firefly group. Then initializes the control
parameters RSRdQDQGV, the initial value of
fluorescein is l0.
Step2: calculate fitness value of each individual in the
initial population according to Eq(9), and update the
fluorescein value according to Eq(4), then each individual
adds the individual which fluorescein value is less than its in
the decision domain radius to its neighborhood set Ni (t).
Then the moving probability for the individual in the
neighborhood set according to individual Fluorescein values
is computed.
Step3: individual chooses the direction of highest moving
probability as its moving direction, s as its step to move.
Step4: update fireflies position according to Eq(6), then
use Eq(7) to update decisions radius.
Step5: return Step2 to conduct loop iteration, until the
fitness value is good enough or the maximum number of
iterations has been reached, termination the iteration.

Table 2:control parameter

nt

l0

0.4

0.6

0.08

20m

position is ( xi , yi ) , the number of unknown nodes is n, the


communication radius is R, then the average position error
normalized can be represented as Eq(10),
n

( xi  x ) 2  ( y i  y i ) 2

NOR _ AVE _ ERROR

i 1

Run

the number of beacon nodes


simulation times
the number of individuals N
The maximum iterations times

(10)

Setting communication radius of nodes in networks are 30m,


the total number of nodes are 100, 20 percent are beacon
node among them. Fig.1 and Fig.2 represent the node
localization error distribution of DV-Hop algorithm and
FDV-Hop algorithm respectively. Wherein the circles
represent the actual position of the unknown node, the
triangles represent the estimated position.

Fig1.the location error distribution of DV-Hop

Table 1simulation parameter

communication radius R

u 100 %

4.2 Simulation Analysis

4.1 simulation conditions

parameter
location region
the number of nodes

2m

The average location error normalized for radius is used


to evaluate the location accuracy. Assuming the actual
position of the unknown node i is (xi,yi), the estimated

4 Simulations and Analysis

In this section, we assess the effectiveness of the proposed


algorithm as compared to the original DV-Hop algorithm.
The network topology structure is provided as follows:
nodes are randomly distributed in the network region. The
simulation results are the average value of 50 trials.
Parameter settings are shown in Tables 1.

values
100mh100m
100
20m25m30m
4,8,12,16,20,24
100
50
20
Fig2.the location error distribution of FDV-Hop

Fig.1 and Fig.2 shows that using the firefly algorithm to


optimize the positioning result is effectively, FDV-Hop
algorithm can get better positioning accuracy.
This paper also does simulation experiment in the case of
different ratio of beacon nodes and different communication
radius. It can be seen from the results that in the case of the
same network environment, the average location error of
FDV-Hop algorithm is significantly reduced than the
original DV-Hop algorithm with the increase of the
proportion of beacon nodes and communication radius
respectively.
1) The relationship between the number of anchor nodes
and the average location error
The location area is set to a square area of 100m u 100m,
the total number of nodes is 100, the communication radius
is 30m, the average location error obtained by DV-Hop
algorithm and FDV-Hop algorithm in the case of the number
of beacon nodes is 4,8,12,16,20,24 is shown in Fig.3. Fig.3
shows that when the total number of nodes is fixed, the
average location error of DV-Hop and FDV-Hop algorithm
gradually decreases with the number of beacons increasing,
but it can clearly be seen that, the average location error of
FDV-Hop algorithm is significantly lower than the DV-Hop
ones when the number of beacon nodes is the same. When
the number of beacon nodes is 8, the average location error
of FDV-Hop algorithm is about 35%, in order to achieve the
same accuracy with FDV-Hop algorithm, the number of
beacon nodes in DV-Hop algorithm is 24. In other words,
the proposed algorithm can get better positioning accuracy at
the case of lower proportion beacon nodes.

the increase of the communication radius leads to the


increase of the network connectivity, which can reduce the

distance estimation error, thereby reducing the error of


position estimation.
Fig 4. The variation of ALE by FDV-Hop algorithm with the
ratio of beacon nodes increasing in the case of the communication
radius is 20m, 25m and 30m

5 Conclusions
This paper proposed a firefly algorithm optimization based
DV-Hop algorithm(FDV-Hop) for wireless sensor network,
established a mathematical model of minimal the sum of
location error of all unknown nodes and used firefly
algorithm to get the optimal solution of the models to get the
best position estimate of the unknown nodes. Simulation
results show that the proposed algorithm is effective and the
ALE of FDV-Hop algorithm is less than DV-Hop algorithm.
The improved algorithm does not add any extra hardware
cost and traffic. At the same time, it has a good adaptability
for a variety of wireless sensor network. If necessary, better
location accuracy can be got when the proposed algorithm is
combined with other algorithms.

References

Fig.3 The variation of the average location error with the number
of anchor nodes for comparison of

FDV-hop and DV-hop.

2) The relationship between the communication radius and


the average location error
The variation of ALE by FDV-Hop algorithm with the
ratio of beacon nodes increasing in the case of the
communication radius is 20m, 25m and 30m is shown in
Fig.4. As can be seen from Fig.4, the ALE of FDV-Hop
algorithm increases with the communication radius
increasing in the case of the percentage of beacon nodes is
fixed. The ALE is minimized when R=30. This is because

[1] Liu Y H, Yang Z, Wang X P, et al. Location,localization,


and localizability[J]. J of Computer Science and
Technology, 2010, 25(2): 274-297.
[2] Amitangshu Pal. Localization algorithms in wireless
sensor networks: Current approaches and future
challenges[J]. J of Network Protocols and Algorithms,
2010, 2(1): 45-74.
[3] Bulusu N, Heidemann J, and Estrin D. GPS-less low cost
outdoor localization for very small devices[J]. IEEE
Personal communications Magazine, 2000,7(5):28-34.
[4] Nagpal R. Organizing a global coordinate system from
local
information
on
an
amorphous
computer[J].Tech.Report.A.I. Memo 1666, MIT A.I.
Laboratory,Aug.1999.

[5] He T,Huang C,and Blum B M,et al. Range-free


localization schemes in large scale sensor networks[C].
Proc. of the 9th Annual International Conference On
Mobile Computing And Networking(MOBICOM), San
Diego,California,USA,2003:81-95.
[6] Niculescu D and Nath B. Ad-hoc positioning
system(APS)[C]. Proc. of the IEEE GIOBECOM, San
Antonio,2001(5):2926-2931.
[7] ZHANG Lei,DUAN Li-li,QIAN Zi-juan,HUANG
Guang-ming. WSN Node Localization Technology
Based
on
Genetic
Algorithm [J]. Computer
Engineering2010,36(10):85-87.
[8] Zhao Shijun,Sun Meiling,Tang Yifang. GASA-Based
Location Algorithm For Wireless Sensor Networks[J].
Computer Applications and Software2009,26(10)
189-192.
[9] WANG Yu-feng, WANG Yan.Integrated algorithm
based on vectors in node localization for wireless
sensor networks[J] Journal on Communications
2009,29(1):309-311.

[10] KRISHNANAND K N, GHOSE D. Glowworm swarm


optimization: a new method for optimizing
multi-modal functions[J].International Journal of
Computational Intelligence Studies,2009,1(1):93-119.
[11] Aspnes J, Goldenberg D, Richard Yang Y. On the
computational complexity of sensor network
localization[C]//Proceedings of First International
Workshop on Algorithmic Aspects of Wireless Sensor
Networks,Turku,Finland,July16,2004.
[12] YANG Xin-she. Firefly algorithms for multimodal
optimization[C].Proc of the 5th International
Conference on Stochastic Algorithms: Foundations and
Applications. Berlin: Springer-Verlag, 2009: 169-178.
[13] YANG Xin-she. Biology-derived algorithms in
engineering optimization[M]. OLARIUS S, ZOMAYA
A. Handbook of Bioinspired Algorithms and
Applications.[S.l.]: Chapman &Hau / C R C, 2005:
589-600.

Das könnte Ihnen auch gefallen