Vous êtes sur la page 1sur 6

2011 International Conference on Computer Control and Automation (ICCCA 2011)

An Improved Localization Algorithm Based on Simulated Annealing for Wireless Sensor Networks
Mohamadreza Shahrokhzadeh, Abolfazl T. Haghighat and Behrooz Shahrokhzadeh
Department of Electrical, IT and Computer Sciences Islamic Azad University, Qazvin Branch Qazvin, Iran Email: {m.shahrokhzadeh, haghighat, bshahrokhzadeh}@qiau.ac.ir
AbstractRandom topology of the wireless sensor networks has made localization problem as one of the most critical challenges faced in developing applications such kind of networks. Among the recent different solutions, heuristic algorithm which is based on Simulated Annealing technique has been considered as a better method because of its desirable results. Despite its high precision in high density networks, the main weakness of this algorithm is the increase of localizing processing time along with the increase in network size, at the same time in low density networks its precision also decreases considerably. This article aims to propose some solutions to upgrade the performance of this algorithm. In the proposed algorithm, instead of completely random initial estimation of SA, first Trilateration method is applied to proportionately estimate the location of sensor nodes, in this case, the rate of the calculations at the beginning of the algorithm decreases considerably and the final result can be achieved sooner. In addition, by changing the cost function in the first phase, the problem of flip ambiguity of the sensor nodes is mostly solved, so the algorithm errors decrease too. Evaluation result implies the double increase of speed means that is more tangible in high density networks. The increase of the speed happens while the proposed algorithm decreases the localization error by half. Keywords-Wireless Simulated Annealing. Sensor Networks; Localization;

I.

INTRODUCTION

The rapid development of wireless communications and technology growth in the field of electronics has facilitated the possibility of making more capable sensors to create a network to control and manage our homes and cities intelligently. For this reason, we have observed experts more and more attention to this technology and development of its application of this type of networks in the recent years. One of the main methods to deploy wireless sensor networks is to scatter the nodes throughout the interest environment. Therefore the unknown thing in this network after its deployment is the precise location of the sensor nodes while in most sensor network applications, the information gathered will be meaningless unless to know the

location of sensors. Therefore the solution to find the location of the wireless sensor nodes is a critical and unavoidable issue. There are many localization algorithms from different aspects but they can be categorized into two broad classes from location of procedure execution viewpoint: The first is centralized and the second is distributed algorithms. The centralized algorithms collect their required data in a central base station and by processing this data, they find the location of sensors and finally migration of the resulting locations back to respective nodes. The most important advantage of these algorithms is their high precision and elimination of redundant calculations in each node while in distributed algorithms, each sensor tries to find its location based on local data independently, so the communication cost of the network is lower. Simulated Annealing or SA, has been applied in one of the centralized algorithms. The idea of application of this technique in sensor localization problem for the first time was introduced in [1] and due to its desirable results in comparison with other techniques, this was more acceptable. While preferable to other algorithms, there are some disadvantages that experts in [2, 3, and 9] try to modify for better performance but it is still far from desirable. The most important disadvantage of this algorithm is the problem of time consuming calculations that grows with the size of network and consequently the procedure of localization takes more time as well. Another problem of this algorithm is decreasing precision of algorithm due to flip ambiguity, to solve this problem, another phase has been added to the algorithm that is costly in high density networks. The aim of this article is to present the achieved solutions for these two problems. We make some modifications to upgrade the performance of this algorithm considerably. There are three advantages for our proposed algorithm: The execution of algorithm has been accelerated to double speed. The precision of algorithm in all conditions especially in low density networks has been improved considerably.

978-1-4244-9767-6/11/$26.00 2011 IEEE

53

2011 International Conference on Computer Control and Automation (ICCCA 2011)

The problem of flip ambiguity positioning has been mitigated. The second section of this article deals with a literature review in this field, in the third section the proposed algorithm is described elaborately, in the fourth section the algorithm evaluation results have been presented and the fifth section concludes the article. II. THE CENTRALIZED LOCALIZATION ALGORITHMS Traffic control, environment monitoring, monitoring of patients in health sector, modern agriculture are some examples of wireless sensors network applications. In these applications, the gathered data from each sensor node is continuously collected and analyzed in the base station. In order to detect the location of each node in the above mentioned specifications, the optimal choice is the centralized algorithms [6]. In general, the common characteristics of all centralized algorithms are creating a cost function and applying an optimizing technique. In what follows, the main algorithms with the centralized structure will be introduced and their advantages and disadvantages will be represented briefly. The method of MDS-MAP [7] is the first efficient centralized method that could solve this problem precisely. The MDS technique works as the heart of this algorithm. In this algorithm, the shortest paths between all pair of sensor nodes are first computed which are used to construct a distance matrix then MDS is applied to the distance matrix and an approximate position of each node is obtained in 2 or 3 dimensional map. Of course there is the possibility of map rotation or incorrect scaling, for this reason by applying three anchors as sensors that are aware of their locations, a cost function is created and to be refined using a leastsquares minimization, finally a relatively map can be converted to a precise map. The requirement of low numbers of anchors is the principle advantage of this method in the localization procedure, but on the other hand global information of network and its heavy processing in each phase are the disadvantages of this method [5]. In [8] localization of sensors is formulated as convex optimization problem and solved with SDP algorithm. For this purpose, the localization problem is modeled as a quadratic equation then this equation is solved by SDP using the information of distances between sensors. This method also requires low number of anchors but the speed of convergence is not desirable compares to heuristic optimizing methods. Heuristic optimizing method is another solution to the localization problem. Among the solutions, the method based on Simulated Annealing, produced the more desirable result because this method is not trapped in local minima. At

first, a two-phase localization algorithm based on SA technique was presented in [1]. The SAL algorithm needs to the distances between one-hop neighboring nodes. First, an imaginary network is assumed in which the location of each sensor except anchors is randomly determined, then the
F B A C D G

A E Figure 1. Flip Ambiguity of 'A' sensor node [4]

Euclidean distance of each sensor to its neighbors is calculated. The cost function is defined based on sum of squares of distance difference between each sensor to its neighbors in real network and imaginary network. The assumption is that by applying SA technique and positioning of sensors of imaginary network in their real locations, the problem of localization is solved, but in most of the cases especially in low density networks, some sensor nodes may have been flip ambiguity problem. As it is shown in the Fig. 1, the node A that is neighbored to nodes B, C, D and E can be located in location A' with no change of distance to its neighbors that is called flip ambiguity. To distinguish and distinct ambiguous sensor nodes after applying the algorithm, the set of neighbors of each node in the estimated location must be compared to its real neighbors that are defined as the problem input, in the case of incompatibility between these two sets, that sensor is sent to the next phase otherwise it will be elevated to an anchor node. The second phase that is accomplished by altering the cost function to modify the location of the ambiguous sensors is a time consuming phase. There is a direct relationship between the performance of this method and network density in a way that the lower the density is, the lower the precision will be. However the algorithm based on SA technique compared to the improved algorithm based on SDP is performing more efficiently [6]. Moreover, the way of initializing parameters of this algorithm, and the defining cost function, both play an important role in its performance. In [2] while presenting a new formula to compute the temperature parameter (as one the most important parameter of SA method), the cost function is defined in other format that is applicable in a network containing a high number of anchor nodes. The authors of the article [3] are proposing a new formula to

54

2011 International Conference on Computer Control and Automation (ICCCA 2011)

lower the temperature parameter gradually in order to solve the localization problem more precisely. In [9] The SA method is combined with genetic algorithm to promote its performance. Hence the SAL will be more efficient when its computing time decreases and at the same time its precision increases. In the third section, the authors of the article introduce an algorithm based on SA with a high localization
Original Sensor Position Anchor Estimate of Sensor Position Link between Sensor and its Estimation

middle point between these two represents the estimated location of sensor in the imaginary network. In the case of one neighboring anchor, our proposal is to put location of sensor on that anchor location and finally for the sensors with no neighboring anchor we can consider a random location. With this idea, the volume of localizing computation decreases considerably thus performance will be increased. In the previous section it was mentioned that flip ambiguity resulted from this method imposes a second phase that is time consuming. In fact by decreasing or
Original Sensor Position Anchor Estimate of Sensor Position Link between Sensor and its Estimation

X-axis Figure 2. Completely random estimate of the coordinate sensor nodes

performance and a low flip ambiguity that in turn improves the level of precision greatly. III. IMPROVEMENT OF SA BASED LOCALIZATION As mentioned above, SA method is a heuristic optimization approach that moves randomly around the solutions space to find the best response. Despite the fact that SAL is performing better compared to other methods, it has some disadvantages. As is clear in fig. 2, in this method, first a completely random estimate of the coordinate sensor nodes is determined while using anchor nodes instead of random estimation yields a more accurate estimation of the sensor location that consequently decreases the time of computation. For this purpose, we propose applying Trilateration technique in base station before using SA algorithm. As indicated in Fig. 3 in the case of neighboring a sensor with three anchor nodes and by applying this technique we are able to compute the precise location of that sensor. If we have two neighboring anchors rather than three, we would have two answers that the

X-axis Figure 3. Relatively accurate estimate of the coordinate sensor nodes using the proposed method

omitting such a flip ambiguity, both the speed and precision of this method increase. Our proposal for decreasing this ambiguity is to apply formula (1) as a cost function in the first phase.
if ( dij < R)

f = else
f =

ianchor jNi

(dij dij )2 +

jNi

w (dij R ) 2 ) (1)

ianchor jNi

(dij dij ) 2

Where dij is the measured distance of sensor i from sensor j and dij is the estimated distance between these two

55

2011 International Conference on Computer Control and Automation (ICCCA 2011)

sensors in the imaginary network, R is the transmission range of each sensor, N i is the set of real neighbors and N i is the set of wrong neighbors of sensor i. w as the factor of second term at the beginning of the algorithm has the value greater than 1 that gradually decrease to 1. In this situation the perturbation is needed to get rid of wrong neighbors and then it is tried to set the location of sensors among neighbors. By applying formula (1), location of any sensor that is trapped in flip ambiguity, affects the cost of network therefore this formula helps to avoid this situation and to prevent such a cost during execution of the first phase of algorithm.
Procedure Modified_SALoc(T, Begin calculate f 0 ;

The proposed algorithm for the problem solving of wireless sensor network localization is as Fig. 5. At the beginning of the algorithm, the estimation of sensor localization is accomplished as mentioned before, then after a single execution of Modified_SALoc, the second phase begins. In the second phase that is a repetitive procedure, the sensors with wrong neighboring are identified and processed again. The point is that the repetition of second phase depends on the expected accuracy of the algorithm. IV. PERFORMANCE EVALUATION In order to evaluate the performance of our proposed algorithm, a program has been developed using C++.NET.
/* Phase 1 */ Generate a network with estimated location of sensors; /* Phase 2 */ Execute Modified_SALoc(T, d , iteration, w); /* Phase 3 */ While ( f f threshold ) Set unambiguous sensors to anchor; Execute Modified_SALoc (T, d , iteration, 1); End While
Figure 5. The proposed algorithm

d , iteration, w)

While (repetition is lower than iteration AND f is not small AND some sequential f > ) do For i = 1 to (q * N) do select a sensor randomly; Do j times move sensor by (Rand(0,1) * d ) in random direction; calculate f = f new f old ;
if Rand(0,1) <= else Reject movement; End Do End For Decrease T , d and w; End while End.

P (f )

Accept movement;

Figure 4. Pseudo code of modified SA based Localization

In the proposed algorithm, when modification of the cost function in some consecutive repetition is lower than , the algorithm is stopped in order to prevent useless algorithm repetition which increases the execution time. Fig. 4 shows how SA technique solves the localization problem. In this Figure, formula (2) is used to compute the function of P.
1 P= if f 0

The studied network consists of 80 sensors that are randomly distributed in 2 dimensional areas and 20% of them are assigned as anchor nodes. The Set of accomplished tests are categorized into 5 groups based on the connectivity among sensor nodes. The values of T and w are chosen as 1000 and 2 respectively. In each simulation, a network is processed by a reference algorithm and again the same network is processed by the proposed algorithm and the results are related to the time and the number of sensors trapped in flip ambiguity and the total errors are recorded. Formula (3) is the criterion to compute the error of network sensors localization estimation.

((x i x i )2 + ( y i y i )2 )
i =1

N R

100%

(3)

( f )
T

(2) else

In the proposed algorithm, T indicates the temperature parameter and d is the maximum value of perturbation of sensor in a single iteration. By assigning a great value to T, the possibility of accepting any changes increases and the exploratory nature of the algorithm upgrades, consequently this prevents the network to be trapped in local minima.

Where N is the number of network sensors, R is the transmission range of sensor, ( x i , y i ) is the measured location and ( x i , y i ) is the estimated location of sensor i. To increase the precision of assessment results, the best and the worst results have been omitted and the mean has been computed. The result of the simulations shows the difference between these two algorithms from localization estimation precision point of view. As it is clear in Fig. 6, the precision

56

2011 International Conference on Computer Control and Automation (ICCCA 2011)

of proposed algorithm in all aspects is better than the reference algorithm and this difference is more evident in lower degree of connectivity. Fig. 7 shows a considerable difference between times of proposed algorithm processing and the reference algorithm, especially when the connectivity of the network is higher. This figure is related to the process mean time of two algorithms in different group tests. To describe this figure, it should be mentioned that substitution of relatively accurate estimation instead of completely random estimation of the sensors location and detection of flip ambiguity in the first phase is the reason for this difference. Fig. 8 compares the percentage of sensors that are trapped in flip ambiguity after accomplishing each algorithm. Both algorithms in the networks with high degree of connectivity exhibit good results while in the low density network, the proposed algorithm show better results in solving this problem. V. CONCLUSION From location of procedure execution viewpoint, the presented methods can be classified into centralized and distributed groups. Among them, the method based on SA is one of the most efficient centralized methods in solving the problem of localization. The main disadvantage of this method is the increase of localization processing time along with the size of the network, yet in low density networks the precision of the algorithm decreases considerably. The main goal of the proposed algorithm is to increase both the speed and precision of the method. In the proposed algorithm instead of completely random initial estimation of sensors location, Trilateration method is applied to estimate a relatively appropriate sensors location. In turn, the cost of the network at the beginning of the algorithm execution decreases while its speed increases. As it was mentioned above, the results of evaluations indicate the increase of speed to double compared to the SAL. This
SAL - 20% anchor
9 8 7 6 5 4 3 2 1 0 8 11 14 18 21

result is more tangible especially in the high density networks. In addition, by changing the cost function in the first phase, it mitigates flip ambiguity. The accomplished evaluation also shows that the proposed algorithm decreased the localization error by half. However with these modifications, the performance of algorithm based on SA method is dependent on the network density and the number of anchor nodes. Tackling this problem can be the goal for the future studies. REFERENCES
[1] A. Kannan, G. Mao and B. Vucetic, Simulated Annealing based Wireless Sensor Network Localization, Journal of Computers, Vol. 1, No. 2, 2006, pp. 15-22. Y. Li, J. Xing, Q. Yang and H. Shi,"Localization Research based on Improved Simulated Annealing Algorithm in WSN", 5th Int. Conf of WICOM, China, 2009, pp. 1-4. Z. Su, F. Shang and R. Wang, "A Wireless Sensor Network Location Algorithm Based on Simulated Annealing", 2nd Int. Conf. of BMEI, China, 2009, pp. 1-5. A. Kannan, G. Mao and B. Vucetic,"Simulated Annealing based Wireless Sensor Network Localization with Flip Ambiguity Mitigation", 63rd Conf. of IEEE VTC, Australia, 2006, pp. 10221026,. A. Pal, Localization Algorithms in Wireless Sensor Networks: Current Approaches and Future Challenges, Journal of Network Protocols and Algorithms, Vol 2, Issue 1, 2010, pp. 45-73. G. Mao, F. Fidan and B. Anderson, Wireless sensor network localization techniques, Journal of Computer Networks, Volume 51, Issue 10, 2007, pp. 2529-2553. X. Ji and H. Zha, "Sensor Positioning in Wireless Ad-hoc Sensor Networks Using Multidimensional Scaling", 23th Conf. of IEEE INFOCOM, Vol 4, 2004, pp. 2652 2661. P. Biswas and Y. Ye, "Semidefinite Programming for Ad Hoc Wireless Sensor Network Localization", Third Int. Symposium of IPSN, 2004, pp. 46-54. Q. Zhang, J. Wang, C. Jin and Q. Zeng, "Localization Algorithm for Wireless Sensor Network Based on Genetic Simulated Annealing Algorithm", 4th Int. Conf. of WICOM, 2008, pp. 1-5.

[2]

[3]

[4]

[5]

[6]

[7]

[8]

[9]

Modified SAL - 20% anchor


7 6 5 4 3 2 1 0

SAL - 20% anchor


Processing Time

Modified SAL - 20% anchor

Error Location (%)

Connectivity
Figure 6. Location error of uniformly distributed sensor nodes

11

14

18

21

Connectivity
Figure 7. Required processing time for localization

57

2011 International Conference on Computer Control and Automation (ICCCA 2011)

SAL - 20% anchor


Trapped Sensors in Flip Ambiguity (%)
6 5 4 3 2 1 0 8 11

Modified SAL - 20% anchor

14

18

21

Connectivity
Figure 8. Percentage of sensor nodes placed at flip ambiguity trap

58

Vous aimerez peut-être aussi