2018 2nd International Conference on Modeling, Simulation and Optimization Technologies and Applications (MSOTA 2018) ISBN: 978-1-60595-594-0
Improved DV-Hop Algorithm Based on Ant Colony Algorithm and
Particle Swarm Optimization for Wireless Sensor Network
Location Problem
Hai YANG
School of Information Science and Electrical Engineering, Shandong Jiaotong University, Jinan, Shandong, China
Keywords: DV-Hop, Ant colony algorithm, Particle swarm optimization, Wireless sensor network, Location algorithm.
Abstract. Wireless sensor network location problem is one of hot focus in the academic community recently and DV-Hop algorithm is commonly used to solve the typical location algorithms in wireless sensor Network. In order to improve the efficiency of the DV-Hop algorithm, ant colony algorithm and particle swarm optimization have been brought into DV-Hop algorithm for optimizing globally. The AP-DV-Hop algorithm makes use of the advantages of ACA and PSO so as to guarantee the globality of optimal solutions which avoids trapping in local optimum with the help of the particle nature of ant agents and initialized random solutions. Finally, the simulation experiment results have shown that AP-DV-Hop algorithm has smaller average location error than DV-Hop algorithm and genetic algorithm.
Introduction
Wireless sensor network (WSN) is a monitoring system composed of lots of sensor nodes in a self organizing way, which is applied widely to monitor and record the real-time conditions of the target area, such as temperature, decibel, humidity, ultraviolet light, PM2.5 and so on [1]. In the wireless sensor network, the sensor nodes without exact locations are called unknown sensor nodes. The information recorded by unknown sensor nodes is unusable because of the absence of exact locations information. So in the wireless sensor network, the sensor node location algorithm plays an important role which has become the hot focus in the academic community recently.
All of the sensor node location algorithms could be classified into two categories: Range-based location algorithm and Range-free location algorithm. Range-based location algorithm which has higher precision level, needs to configure additional hardware devices on sensor nodes to measure the distance between any pair of nodes. So as to the cost and energy consumption of WSN are also much more. In contrast, it is easy for Range-free location algorithm with no need for additional hardware devices to estimate the location of unknown sensor nodes [2]. But the low precision level of results is the mainly disadvantage of Range-free location algorithm.
It is universally acknowledged that the DV-Hop algorithm which estimate the distance between the anchor node and unknown node according to hops is one of the most effective Range-free location algorithms. To improve the efficiency of the DV-Hop algorithm, ant colony algorithm and particle swarm optimization usually are usually used for optimizing globally.
Description of Wireless Sensor Network Location Problem
Assume that the number of anchor node is M, and the number of unknown node is N in the wireless sensor network. Suppose the vector [p1,p2,,pmn] denotes the initial position of sensor nodes, where pi [xi,yi]T . The position coordinates of M anchor nodes are
) , ( , ), , ( ), ,
(x1 y1 x2 y2 xm ym . Then the objective of wireless sensor network location problem is to calculate the position vector v[vx,vy] of each unknown node according to the position coordinates of M anchor nodes, where vx [xM1,xM2,,xN] , vy [yM1,yM2,,yN] . Because of the existence of distance measurement error, the error between one unknown node and anchor node i could be described as follows:
2 2
) ( )
(x x y y d
errori i i i (1) Where (x,y) denotes the estimated position of unknown node. (xi,yi)(i1,2,,m) denotes the actual position of anchor node i. di denotes the measuring distance between the unknown node and the anchor node i. (xi x)2 (yi y)2 denotes the estimated distance between the unknown node and the anchor node i.
One of the primary evaluation standards is average location error which can be described as follows:
% ) ( ) ( 100
1
2 2
N
i
i
i x y y
x R
N
error (2) Where N denotes the number of unknown nodes, and R denotes the radio range of anchor nodes.
DV-Hop Location Algorithm
In wireless sensor network, a hop is one portion of the path between source node and destination node. Data packets pass through bridges, routers and gateways as they travel between source node and destination node. Each time packets are passed to the next network device, a hop occurs. The hop count refers to the number of intermediate devices through which data must pass between source node and destination node [3]. Since record and forward and other latencies are incurred through each hop, a large number of hops between source node and destination node implies lower real-time performance.
DV-Hop algorithm is one of sensor node location algorithm for wireless sensor network which could calculate the position coordinates of unknown nodes according to the distance between the unknown node and anchor ones. DV-Hop algorithm can be divided into three steps: firstly, the number of hops from one unknown node to each anchor node can be gathered. Secondly, the distance between unknown nodes and anchor nodes can be estimated according to hops and the length of each hop. Thirdly, the position coordinates of unknown nodes could be calculated according to the results gathered from step one and step two.
Let's take an example as figure 1. Suppose d12 is the distance between node L1 and node L2, the number of hops is 2. d23 is the distance between node L2 and node L3, the number of hops is 4. d13 is the distance between node L1 and node L3, the minimal number of hops is 5. Then the average distance of each hop which is named L in this network could calculated as follows:
) 5 4 2 /( )
( 12 23 13
d d d
Figure 1. The location diagram of DV-Hop algorithm.
From figure 1 we can see the numbers of hops between the unknown node A and anchor nodes L1, L2, L3 are 2,3 and 3 respectively. So the estimated distance between node A and the three anchor nodes are 2L, 3L and 3L respectively. Finally, the position coordinate of node A can be calculated according to the three estimated distance and the three position coordinates of anchor nodes L1, L2 and L3.
Lots of reseaches have certified that the DV-Hop algorithm has higher requirements for connectivity of wireless sensor network. Furthermore, the proportion of anchor nodes is no less than 10 percent.
Suppose the estimated distance from one unknown node o(x,y) to all anchor nodes ) , ( , ), , ( ), ,
( 1 1 2 2 2
1 x y A x y An xn yn
A are d1,d2,,dn , the distance measurement error are n
e e
e1, 2,, . Then the estimated coordinate of this unknown node should satisfy following inequation: 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 1 2 1 2 1 2 1 2 1 ) ( ) ( ) ( ) ( ) ( ) ( n n n n n
n e x x y y d e
d e d y y x x e d e d y y x x e d
(4)
Thus the location problem is to solve the coordinate o(x,y) which could minimize the function value of f(x,y) in famula (5).
M i i ii y y d
x x y x f 1 2 2 | ) ( ) ( | ) ,
( (5) Where M is the number of anchor nodes.
Improved DV-Hop Algorithm Based on Ant Colony Algorithm and Particle Swarm Optimization (AP-DV-Hop)
In the DV-Hop algorithm, the distance measurement error of unknown nodes which have much more hops to anchor nodes is much more bigger. Thus the unknown nodes usually only receive the information from the specific anchor nodes in the area not far. In this paper, ant colony algorithm and particle swarm optimization have been brought into DV-Hop algorithm to calculate the position coordinates of unknown nodes, which is named AP-DV-Hop algorithm.
Improved DV-Hop Algorithm Part
Calculating the Minimal Hops Between One Unknown Node and Each Anchor Node. Each of anchor node broadcast the data package to its neighbour nodes. The data package usually includes the information of position coordinate and the value of hops. The value of hops is initialized as 0 usually. Meanwhile every anchor node also receives the information of minimal hops from other anchor nodes, and ignores the information of maximal hops from the same anchor node. After completing the above steps, every anchor node sets the value of hops inreasing by 1 and then broadcast the results to its neighbour nodes.
Calculating the Average Distance per Hop. Once one anchor node has received the information from all of other anchor nodes, this anchor node will calculate the average distance per hop which is denoted as HopLength in formula (6). Then the value of HopLength can be used by each unknown node to estimate the euclidean distance from one unknown node to each anchor one.
j i j n j i j i j i num y y x x HopLength 2 2 ) ( ) ( (6)Where both (xi,yi) and (xj,yj) are the position coordinates of anchor node i and j. numj is the number of hops between anchor node i and anchor node j (i j).
Location of Unknown Nodes. If one unknown node has received the values of HopLength and hop numbers from three or more anchor nodes, the position coordinate of this unknown node could be calculated by using trilateration or maximum likelihood method. Suppose there is an unknown node q in the given wireless sensor network. If all of the estimated distance from node p to each anchor node is known, the position coordinate of node p could be calculated according to the formula (7) as follows:
1 21 2
2 2 1 1 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 2 2 1 1 2 2 1 ) ( 2 ) ( 2 ) ( 2 ) ( 2 ) ( 2 ) ( 2 n n n n n n n n n n n n n n n n n n n n d d y y y y y x x x x x d d y y y y y x x x x x d d y y y y y x x x x x
(7)
The linear equation of formula (7) can be described as follows: B
AX (8) Where A, X and B are as follows:
) 2( )
( 2 ) ( 2 ) ( 2 1 1 1 1 n n n n n n y y x x y y x x
A (9)
21
2 2 2 1 2 2 1 2 1 2 2 2 1 2 2 1 n n n n n n n n n d d y y x x d d y y x x
B (10)
y x
b A A A
X ( T )1 T (12)
The Hybrid Algorithm of Ant Colony Algorithm and Particle Swarm Optimization
Although the ant colony algorithm have several disadvantages such as easily trapping in local optimum and longer iteration time, but the ant colony algorithm is adept at solving discrete optimization problems. Meanwhile particle swarm optimization is adept at solving continuous optimization problems. So that the hybrid algorithm which is named AP algorithm, combines ant colony algorithm (ACA) and particle swarm optimization (PSO) to make use of the advantages of each. Ant colony algorithm can be used for searching and the particle swarm optimization can be used for adjusting the parameters , , and qof ant colony algorithm [4]. The hybrid algorithm can guarantee the globality of optimal solutions which avoids trapping in local optimum with the help of the particle nature of ant agents and initialized random solutions [5].
The strategy of the AP algorithm can be described as following three steps:
Step 1: Initialize all the parameters of particle swarm optimization.
Step 2: Let parameter n denote the number of nodes. Select n particles, and set each parameter a random value in its value range. [1,5],[1,5],[0,1],q[0,1].
Step 3: For i=1 to iterationmax, PSO do.
Initialize all the parameters and the pheromone on each edge (i,j) of ant colony algorithm.
Put n ant agents on the n nodes randomly and calculate the value of fitness function of each ant agent.
For NC=1 to NCmax, ACA do; For K=1 to 4 do
Every ant agent selects the next node according to the probability. After moving pass by the edge (i,j), the pheromone of edge (i,j) is updated locally. Finally the result of each ant agent is recorded.
End For
Update the pheromone of the optimal path globally. End For
For each ant agent, set the shortest length of optimal path as the fitness function value of corresponding particles. Then the velocity and position of each particle are updated by using PSO algorithm.
End For
The Description of AP-DV-Hop Algorithm
In the AP-DV-Hop algorithm proposed in this paper, the fitness function is defined as follows:
M
i i i
fitness x y f x y
f
1 2 2
) , ( )
,
( (13) Where i is the weight value of the accuracy of distance measurement between one unknown node and anchor node i. This weight value is in inverse proportion to the number of hops between this unknown node and every one of anchor nodes. The position coordinate of this unknown node could be estimated by minimizing the value of the fitness function demonstrated in formula (13).
The algorithm flow of AP-DV-Hop algorithm is given as following three steps:
Step 1: Initialize the distance of each pair of nodes and the number of hops. For i=1 to N (N is the number of nodes)
For j=1 to N
Calculate all the distance of each pair of nodes Initialize the hops matrix
End For
Step 2: Generate the random topology of WSN
Step 3: Calculate the estimated position of each unknown node according to position information of anchor nodes by using the AP-DV-Hop algorithm.
For i=1 to N
For j=1 to B (B is the number of beacon node) Calculate error by using formula (1)
Calculate fitness function value by using formula (13) Minimize the fitness function value by using AP algorithm [x,y]argmin(ffitness(x,y))
End For End For
Simulation Experiment
The simulation experiments are carried out by using the improved DV-Hop algorithm based on ant colony algorithm and particle swarm optimization (AP-DV-Hop), DV-Hop algorithm and genetic algorithm (GA) separately. The scale of experimental area is 200*200 including 400 nodes. The number of anchor nodes M=80, communication distance R=25, distance-measuring error e=0.2. The experimental results can be consulted in figure 2 to figure 4.
[image:6.595.177.418.371.505.2]The location error of each algorithm under different anchor node densities are shown in figure 2.
Figure 2. The location error of each algorithm under different anchor node densities.
The location error of each algorithm under different number of unknown nodes are shown in figure 3.
Figure 3. The location error of each algorithm under different number of unknown nodes.
[image:6.595.182.415.559.697.2]Figure 4. The location error of each algorithm under different communication range.
From the three figures above, we can reach a conclusion that the AP-DV-Hop algorithm proposed in this paper is superior to DV-Hop and GA. So AP-DV-Hop algorithm has higher efficiency for node location in wireless sensor network.
Conclusion
This paper proposes an improved DV-Hop algorithm based on ant colony algorithm and particle swarm optimization which is named AP-DV-Hop algorithm. The AP-DV-Hop algorithm makes use of the advantages of ACA and PSO so as to guarantee the globality of optimal solutions which avoids trapping in local optimum with the help of the particle nature of ant agents and initialized random solutions. The results of simulation experiment have shown that AP-DV-Hop algorithm has higher efficiency for node location in wireless sensor network.
References
[1] Pal A. Localization algorithms in wireless sensor networks: current approaches and future challenges[J]. Network Protocols and Algorithms, 2010, 2(1): 45-73.
[2] Tilak S, Abu-Ghazaleh NB. Taxonomy of wireless micro-sensor Network models. Mobile Computing and Communications Review, 2002, 1(2): 1-8.
[3] Simon S P, Padhy N P, Anand R S. An ant colony system approach for unit commitment problem[J]. Electrical Power and Energy Systems, 2006, (28): 315-323.
[4] Marco Dorigo. Ant colonies for the traveling salesman problem [J]. Biosystems, 1997, 43:73-81.