1. Introduction
Wireless sensor networks (WSNs) are an important infrastructure of the Internet of Things used for sensing the surrounding information, whose applications can be classified into monitoring and tracking in the fields of military and public [
1]. In these applications, spatial information is one of the most important contexts of the sensed data, and the location information can support the coverage, routing, and many other operations of a WSN. However, the sensor nodes of a WSN are usually deployed in an ad hoc manner without any prior knowledge of their locations, so it is essential to determine the node’s location, which is referred to as
localization.
A possible solution is to equip each sensor node with a global positioning system (GPS) device, but it is not suitable for large-scale deployment due to the constraints of cost and energy. Hence, only a part of sensor nodes (named
anchors) are equipped with GPS devices. These anchors serve as references to the other nodes (named
unknown nodes), which are to be localized. There exist well-organized overviews of sensor localization algorithms [
2,
3]. Localization consists of ranging and estimation phases. In the ranging phase, the nodes measure their distances from anchors using received signal strength, time of arrival, time difference of arrival, link quality indicator, or angle of arrival. In the estimation phase, the node’s position is estimated based on the ranging information.
A popular estimation approach is to formulate the localization problem as an optimization problem, and then use an optimization algorithm to solve the problem. Traditional optimization algorithms are widely used in localization [
4,
5,
6,
7], such as least square, maximum-likelihood, semi-determined programming, and second-order cone programming. Recently, soft computing algorithms have been widely applied to solve this problem [
8,
9], such as Cuckoo search algorithm [
10], artificial neural network [
11], bacterial foraging algorithm [
12], bat algorithm [
13], and biogeography-based optimization [
9,
14].
Particle swarm optimization (PSO) is also an important soft computing algorithm which models the behavior of a flock of birds. It utilizes a population of
particles to represent candidate solutions in a search space, and optimizes the problem by iteration to move these particles to the best solutions with regard to a given measure of quality. Compared with the above algorithms, the advantages of particle swarm optimization are the following [
15,
16,
17].
Recently, PSO has been used in many issues of WSNs [
17,
18]. This paper focuses on the PSO-based localization algorithms for static WSNs, where all sensors are static after deployment. Some PSO-based localization algorithms with different population topologies are compared in Cao et al. [
19]. However, they do not consider the recently-proposed PSO-based localization algorithms, nor do they give parameter selections. The existing PSO’s parameter selection guidelines [
16] are not based on the objective function in localization problem of WSN, so these parameters cannot achieve the optimal localization performance.
The main contributions of this paper are as follows.
It surveys the popular particle swarm optimization variants and particle swarm optimization-based localization algorithms for wireless sensor networks.
It presents parameter selection of nine particle swarm optimization variants and six types of swarm topologies by extensive simulations.
It comprehensively compares the performance of these algorithms.
The rest of the paper is organized as follows. The localization problem and PSO are introduced in
Section 2.
Section 3 surveys the PSO-based localization algorithms, and
Section 4 presents their parameter selections.
Section 5 compares the performance of PSO-based localization algorithms.
Section 6 concludes the paper and presents the future work.
2. Statements of Localization Problem and PSO
2.1. Localization Problem for Static WSNs
A WSN is a network of N sensor nodes, including anchors and unknown nodes, where . The WSN is deployed in a two-dimensional region of interest at random. The region is often assumed as a square of side-length L. Suppose all the sensor nodes have the same communication range, which is a circle of radius R. Two sensor nodes are called neighbors if one of them lays in the communication range of the other, and the distance between them can be measured. Obviously, an unknown node can be localized if it has at least three neighboring anchors.
Since , the localization of static WSNs is an iterative procedure. The unknown nodes with at least three neighboring anchors are localized first, and then the other unknown nodes are localized based on the information of neighboring anchors and localized unknown nodes iteratively. Both the anchors and localized unknown nodes are called reference nodes in this paper.
During localization, suppose an unknown node
(
has
n neighboring reference nodes. Let
be the measured distance between
and reference node
(
),
, and
be the estimated and actual positions of
, and
be the position of
. Then, the localization result should satisfy
The distances measured by any ranging method are inaccurate, so it is impossible to find an accurate solution to (
1). Let
be the right part of (
1), and be referred to as
estimated distance. Obviously,
because of the inaccurate measured distances. Then, the purpose of localization is to minimize the difference between
and
, which is
For most ranging techniques, the measurement error is related to the distance between the two sensor nodes, and larger distances cause larger error [
20]. Hence, weight
is introduced so that the nearer neighboring reference nodes a play greater role in localization, as shown in (
4).
where
is the weight of the neighboring reference node
of
, defined as
Besides, the following equations are also discussed in related literature:
which are, respectively, the average of
and
on number of neighboring reference nodes
n.
Equations (
3), (
4), (
6) and (
7) are called
objective functions.
2.2. Particle Swarm Optimization
The PSO-based localization algorithm uses PSO to solve one of the above objective functions. Because the WSN considered in this paper is in a two-dimensional region, the search space of the PSO is constrained to two-dimensions.
Let M be the number of particles of the PSO. Particle i occupies three two-dimensional vectors , , and , representing its current location, previous best position, and current velocity. Besides, denotes the position of the best particle so far. In each iteration, particle i updates its position and velocity according to the following equations.
where
and
are cognitive and social acceleration coefficients, respectively,
and
are random numbers uniformly distributed in
, and
ω is the inertia weight.
propels the particle towards the position where it had the best fitness, while
propels the particle towards the current best particle. The stochastic
may become too high to keep all particles in the search space. Hence,
is introduced [
16] to bound
within the range
.
ω is an important parameter. Linearly decreasing and simulated annealing types are the best ones of all adjustment methods [
21]. Due to the computational and memory constraints of sensor nodes, the linearly decreasing method is adopted in many PSO-based localization algorithms, which is
where
is the maximum number of allowable iterations,
and
are maximum and minimum weights, respectively, and
t is the current iteration.
As we can see, PSO needs each particle to communicate/connect with the other particles to obtain
. The connections among particles are called
topology. There are two kinds of topologies:
global-best and
local-best. The former allows each particle to access the information of all other particles, and the latter only allows each particle to access the information of its neighbors according to different local-best topology [
22,
23]. Because each particle has a different swarm of neighboring particles in its local-best topology, this topology ensures that the particles have full diversity. Local-best topology uses
instead of
to represent the best position of the neighboring particles of particle
i, and its update function is:
Here,
propels the particle towards the current best particle within the corresponding sub-swarm of this particle. The most popular local-best swarm topologies include:
Ring topology: Each particle is affected by its k immediate neighbors.
Star/Wheel topology: Only one particle is in the center of the swarm, and this particle is influenced by all other particles. However, each of the other particles can only access the information of the central particle.
Pyramid topology: The swarm of particles are divided into several levels, and there are particles in level l (), which form a mesh.
Von Neumann topology: All particles are connected as a toroidal, and each particle has four neighbors, which are above, below, left, and right particles.
Random topology: Each particle chooses neighbors randomly at each iteration. We utilize the second algorithm proposed in [
24] to generate the random topology.
2.3. Evaluation Criteria of PSO-Based Localization Algorithms
Localization error. The localization error of unknown node is defined as . The mean and standard deviation of localization error are denoted by and , respectively.
Number of iterations. This is the number of iterations of PSO to achieve the best fitness. The mean and standard deviation of the number of iterations are denoted by and , respectively.
In WSN applications, the localization error depends on ranging error, GPS error, localization error accumulation, and the localization algorithm. The ranging error results from the distance measurement technique, and the GPS error determines the errors of anchors’ positions. Both ranging and GPS errors are assumed to obey Gaussian distribution, and they are denoted by e. The accumulated localization error comes from the iterative localization procedure: some unknown nodes may utilize localized unknown nodes to localize themselves, while the positions of these localized unknown nodes already have localization error.
3. A Survey of PSO-Based Localization Algorithms
3.1. Basic Procedure of PSO-Based Localization Algorithms
After measuring the distance between sensor nodes, each unknown node estimates its location by Algorithm 1. In this algorithm, Line 1 determines the particles’ search space, which is the intersection region of the radio range of all neighboring reference nodes of this sensor node. After initialization in Line 2, it uses an iterative process to estimate the position (Lines 3 to 7). Note that the update process of Line 6 is different according to different PSO-based localization algorithms.
Algorithm 1 PSO-Based Localization Algorithm |
- 1:
Determine the particles’ search space. - 2:
Initialize a swarm of particles in the search space with random positions and velocities. - 3:
while stop criteria are not met do - 4:
Compute the fitness values of all particles. - 5:
Compute , , and/or . - 6:
Update each particle. - 7:
end while
|
3.2. PSO-Based Localization Algorithms
The basic PSO algorithm using (
8) is the most popular one among all PSO-based localization algorithms, and we use WPSO (weighted-PSO) to represent it for convenience.
The first WPSO-based localization algorithm was proposed in [
25], which uses (
6) as the objective function. WPSO is also applied to the localization problem of ultra-wide band sensor networks in [
26,
27]. In a static sensor network, some unknown nodes may not have enough neighbor anchors to localize themselves, so [
28] applies DV (Distance Vector)-Distance to make all unknown nodes have distances to at least three anchors, and then it uses WPSO to localize. In order to make WPSO’s convergence rate fast, [
29] introduces a threshold to constrain a change of fitness function. Due to the inaccurate distance measurements, flip ambiguity is popular during localization, but this problem is not considered by the aforementioned algorithms. In [
30], WPSO in conjunction with two types of constraints is used to cope with this problem. Besides two-dimensional sensor networks, WPSO is also applied to localize three-dimensional WSNs [
27,
31,
32] and underwater WSNs [
33]. Different from the above algorithms, a mobile anchor-assisted WPSO-based localization algorithm is proposed in [
20,
34], which only uses one mobile anchor to provide distance range to all unknown nodes while it traverses the sensor network. Besides localization, [
35] also applies WPSO to the real-time autonomous deployment of sensor nodes (including anchors and unknown nodes) from an unmanned aerial vehicle.
Besides WPSO, many variants of PSO algorithms have been proposed to improve the performance. The most representative algorithms are listed below.
Constricted PSO (CPSO). WPSO has the disadvantages of early convergence and swarm explosion, so CPSO [
36] introduces the constriction coefficient
χ to conquer these disadvantages:
where
,
. CPSO eliminates the
in WPSO. It performs better than WPSO in many problems [
36].
H-Best PSO (HPSO). Global- and local-best PSO algorithms have their own advantages and disadvantages. Combining these two algorithms, HPSO [
9,
14] divides the particles into several groups, and particle
i is updated based on
,
, and
, per the following equation:
Here,
is the same as
of (
10), and
is a random number uniformly distributed in
. HPSO provides fast convergence and swarm diversity, but it utilizes more parameters than WPSO.
PSO with particle permutation (PPSO). In order to speed up the convergence, PPSO [
37] sorts all particles such that
, if
, and replaces the positions of particles
to
M with positions close to
. The rule of replacement is:
where
is a random number uniformly distributed in (−0.5,0.5).
Extremum disturbed and simple PSO (EPSO). Sometimes, PSO easily fall into local extrema. EPSO [
38] uses two preset thresholds
and
to randomly churn
and
to overcome this shortcoming. The operators of extremal perturbation are:
Let
and
be evolutionary stagnation iterations of
and
, respectively. In (
14), if
(
),
(
) is 1; Otherwise,
(
) is a random number uniformly distributed in [0,1]. For particle
i, the update function of EPSO is
where
is used to control the movement direction of particle
i to make the algorithm convergence fast, which is defined as
Dynamic PSO (DPSO). Each particle in DPSO [
19] pays full attention to the historical information of all neighboring particles, instead of only focusing on the particle which gets the optimum position in the neighborhood. For particle
i, the update function of DPSO is
where
K is the number of neighboring particles of the
ith particle.
is the previous position of the
ith particle. Note that
,
, and
are just weights without physical meaning.
Binary PSO (BPSO). BPSO [
39] is used in binary discrete search space, which applies a sigmoid transformation to the speed attribute in update function, so its update function of particle
i is
where
is defined as
is a random number.
PSO with time variant ω, , and (TPSO). TPSO [
19] employs time-varying
,
, and
ω (see Equation (
9)) to achieve proper balance between global and local exploitation, where
where
,
,
, and
are
initial and
final values of
and
, respectively.
PSO with particle migration (MPSO) [
40]. MPSO enhances the diversity of particles and avoids premature convergence. MPSO randomly partitions particles into several sub-swarms, each of which evolves based on TPSO, and some particles migrate from one sub-swarm to another during evolution.
In one word, the above-mentioned PSO variants aim to overcome one or more drawbacks of WPSO, but they also introduce additional operations.
3.3. Comparison between PSO and Other Optimization Algorithms
The above-mentioned algorithms are also compared with the other algorithms in corresponding references, and
Table 1 summarizes the comparison results.
The bacterial foraging algorithm models the foraging behavior of bacteria that thrive to find nutrient-rich locations. Each bacterium moves using a combination of tumbling and swimming. Tumbling refers to a random change in the direction of movement, and swimming refers to moving in a straight line in a given direction.
The simulated annealing algorithm originated from the formation of crystals from liquids. Initially, the simulated annealing algorithm is in a high energy state. At each step, it considers some neighbouring state of the current state, and probabilistically decides between moving the system to one neighbouring state or staying in the current state. These probabilities ultimately lead the system to move to states of lower energy.
Artificial neural networks model the human brain in performing an intelligent task. It integrates computational units (neurons) in multi-layers, and these layers are connected by adjustable weights. Three traditional layers are input, hidden, and output.
The biogeography-based optimization algorithm is motivated by the science of biogeography, which investigates the species distribution and its dynamic properties from past to present spatially and temporally. In this algorithm, the candidate solutions and their features are considered as islands and species, respectively. Species migrate among islands, which is analogous to candidate solutions’ interaction.
4. Parameter Selections of PSO-Based Localization Algorithms
Given a problem to be solved, the performance of a PSO depends on its parameters. Although theoretical analysis can guide the parameter selection, this analysis can occupy large space, such as [
43], which exceeds the limit of this paper. On the other hand, extensive experimentation has been used widely in the parameter selection or performance analysis of PSO [
15,
21,
23]. Therefore, we try to choose the best parameter by experiments instead of theoretical analysis. Because some parameters of HPSO and PPSO have been calibrated in corresponding references, we only calibrate parameters of WPSO, CPSO, MPSO, TPSO, BPSO, EPSO, and DPSO, and
M and
of PPSO and HPSO.
4.1. Simulation Setup
The PSO-based localization algorithms are implemented in C language, and the results are analyzed by Matlab. Because our aim is to decide the best parameters, we only perform the localization procedure on one unknown node, denoted by
. Suppose the actual position of
is
, and
reference nodes are deployed within the communication range of
. Considering the error
e during distance measurements,
(
) is defined as
where
is the real distance between
and
,
α is a random number that follows a normal distribution with mean 0 and variance
.
The simulation setup is shown in
Table 2. For convenience, we use
a:
b:
c to represent the set of
in this paper. The parameter selection procedure is:
Using and to find out the best , , , and ω.
Using the best , , and ω to choose M.
Using the best , , , ω and M to choose .
Using the best , , , ω, M and to compare fitness functions.
We use
as the objective function of PSO to choose the best parameters, because it is the most popular fitness used in PSO-based localization algorithms. The stopping criteria is
which means the fitness value
achieves an allowable precision
or the number of iteration
t exceeds pre-defined threshold
.
We generate 100 tests with each combination of different e, R, and , and we utilize each algorithm to estimate the position of by 100 runs for each test case, under each group of PSO’s parameters. The results are the average of these runs. A localization algorithm should have the best performance regardless of , because is different to each unknown node in real applications of WSN. Hence, the impacts of on parameter selection are not analyzed.
4.2. Best Parameters of PSO-Based Localization Algorithms
Taking the selection of
and
of WPSO with global-best model as an example, the selection approach is introduced. We first calibrate
and
without considering the specific value of
e, because we may not know
e during localization. The results are the averages of all
e.
Figure 1a,b show that the impacts of
and
on localization errors are very little: the gap between the minimum and maximum
(
) is about
(
). On the contrary,
Figure 1c,d show that
and
reduce with the decrease of
and
. With different
and
, the difference between the maximum and minimum
(
) is about 31.03 (11.70). The best choices are
1.7–1.8 and
1.7–1.8, which occupy 96.2% optimal number of iterations for all cases. Further, we investigate the impacts of
and
on localization performance under each
e, and we find that
1.7–1.8 and
1.7–1.8 are still the best choice for each
e.
Similar approaches have been applied to other parameters and algorithms, and the resulting best parameters are shown in
Table 3. Because MPSO and HPSO already divide the swarm of particles into several sub-swarms which are similar with local-best models, we only analyze their global-best models.
4.3. Performance Comparison of Fitness Function
Figure 2a,b shows that
of
is [306.86, 326.41], which is about 89.65%–91.57% of those of
,
, and
.
Figure 2c,d shows that
is still the best. In detail,
and
has almost the same
, which is [0.035, 0.048]. However,
has the minimal
.
The performance of each fitness function using the other PSO algorithms with different swarm topologies also shows that outperforms the other functions in all cases.
5. Performance Comparisons of PSO-Based Localization Algorithms
5.1. Simulations Setup
The performance of all PSO algorithms is compared by simulations of a whole WSN. The parameters of each PSO variant are set based on
Section 4. During localization, we utilize iterative localization to localize as many unknown nodes as possible. We also demonstrate the impact of radio irregularity on the localization performance of different algorithms, because the actual transmission range of sensor nodes is not a perfect circle due to multi-path fading, shadowing, and noise. The radio model in [
44] is used to represent the degree of irregularity
D. Based on this model, there is an upper bound
R and a lower bound
of the communication range. The simulation setups are:
100 units,
100:100:500,
10:10:50,
25:10:45 units,
0:0.05:0.2,
0:0.1:0.5.
5.2. Comparisons of Different Swarm Topologies in Same PSO
There are 2250 test cases to simulate, and the best swarm topology should outperform the other ones in most test cases, instead of in several test cases. Therefore, we count the number of optimal values of each swarm topology of all test cases, and try to find the topology which achieves the optimal values in most test cases. The “optimal values” are the evaluation criteria mentioned in
Section 2.3. The results are shown in
Figure 3.
For WPSO, Von Neumann and ring topologies perform almost the same, and they outperform the other topologies. Ring topology can gain the optimal , , , and in more than 93.2%, 99.5%, 98.1%, and 99.5% of test cases, respectively, and Von Neumann topology can gain the optimal , , , and in more than 93.4%, 99.5%, 97.5%, and 99.5% of test cases, respectively.
It is hard to say which topology is the best for some algorithms, because none of these topologies performs the best in all four percentages. In this case, we give more importance to
than the other criteria. Taking PPSO as an example (
Figure 3d), its global-best and Von Neumann topologies are obviously better than the others, but Von Neumann outperforms global-best model in
, while global-best model is better than Von Neumann in the other three criteria. Since we put
as the first criterion to choose the best swarm topology, Von Neumann is the best one which achieves optimal
in more than 92.3% cases, while the percentage of global best model is 70.7%.
Using a similar idea, the best swarm topologies of all algorithms are: ring topology for WPSO, CPSO, and TPSO; Von Neumann topology for PPSO and DPSO; random topology for EPSO and BPSO.
Furthermore, we compare the performance of different swarm topologies used in the same PSO algorithm, with different , , R, D, e one by one, and we find these results are consistent with the aforementioned results.
5.3. Comparison of PSO-Based Localization Algorithms
Using the results introduced in
Section 4, the PSO-based localization algorithms are compared.
5.3.1. General Analysis
In general, as shown in
Figure 4, CPSO and PPSO needs fewer iterations than the other PSO-based localization algorithms. In fact, the average
of all test cases required by CPSO and PPSO are 220.16 and 222.29, respectively, while those of WPSO, TPSO, MPSO, HPSO, EPSO, DPSO, and BPSO are 312.88, 484.99, 268.84, 281.68, 310.26, 253.52, and 252.47, respectively.
of CPSO is also the smallest (6.67), while
of the other algorithms are larger than 10. On the other hand, CPSO and PPSO achieve the optimal
for more than 89.69% of test cases, and the optimal
for more than 60.84% of test cases. Furthermore, the average
and
of all test cases of CPSO and PPSO are the first two best ones among all algorithms. CPSO has the least operations during one iteration among all algorithms. Compared with CPSO, the other algorithms need more parameters and operations such, as
, particle sort, or migration.
In one word, CPSO is the best PSO-based localization algorithm.
5.3.2. Impacts of Network Parameters on Performance
In order to analyze the impacts of network setups on localization performance, CPSO is taken as an example, because we find that the other algorithms have the same trends as CPSO, except the variation range. As illustrated in
Figure 5, we cannot draw any rule of the impacts of
and
on
,
. However,
and
decrease as
increases, because the more anchors exist in a WSN, the less unknown nodes need iterative localization, as shown in
Figure 6.
Figure 6 shows that the number of unknown nodes localized by neighboring anchors instead of localized unknown nodes under
is about two times the number under
.
Table 4 denotes that the variations are very small except
.
and
are almost the same, but CPSO and PPSO have the smallest
.
From
Figure 7a,b, we can see that
D impacts the localization error very little, where
(
) only differs less than 0.003 (0.006) with the same
e and different
D. However,
e affects the localization error greatly: a larger
e leads to a larger localization error. As shown in
Figure 7c,
is minimal when
, and it increases significantly when both
D and
e are greater than 0. However, it keeps almost the same when
and
, which can also be proved from
Table 5. On the contrary,
reaches maximum when
, and it decreases when both
D and
e are greater than 0, as shown in
Figure 7d.
Table 5 shows that
and
of EPSO, DPSO, and BPSO are larger than the other algorithms, and
D and
e have little impacts on
, but
varies very much under different
D and
e.
Figure 8a,b denote that the larger
R has higher localization precision.
of EPSO, DPSO, and BPSO are larger than the other algorithms, while the other algorithms have almost the same
. Moreover,
of EPSO and DPSO decrease with increasing
R, while those of the other algorithms show little change.
has the same rule as
, as shown in
Figure 8b.
Figure 8c,d show that the impacts of
R on the number of iterations are very little, and CPSO and PPSO requires the fewest iterations, while TPSO needs the most iterations.
5.4. Comparison between CPSO and SOCP
Table 1 shows the comparison between PSO and the other optimization algorithms. We compare CPSO and second-order cone programming (SOCP) in this section, because SOCP is also a popular optimization algorithm used in localization problems [
4,
5], and CPSO has not been compared with SOCP. The SOCP algorithm is implemented in Matlab by CVX [
45].
As shown in
Figure 9, CPSO with global-best model outperforms SOCP under different
,
,
D, and
e.
and
of CPSO are 0.0085–0.0684 and 0.0526–0.1311, respectively, and those of SOCP are 0.2909–0.3549 and 0.2707–0.3, respectively. Further, SOCP takes much longer than CPSO. For example, there are 450 test cases when
, and SOCP uses 2 hours and 58 minutes to obtain the results, while CPSO only takes 12 minutes.