Inertia Weight Adaption in Particle Swarm Optimization Algorithm

Inertia Weight Adaption in Particle Swarm
Optimization Algorithm*
Zheng Zhou1 and Yuhui Shi2
1
Dept. of Computer Scienceand Software Engineering,
Xi’an Jiaotong-Liverpool University, Suzhou 215123, China
[email protected]
2
Dept. of Electrical and Electronic Engineering,
Xi’an Jiaotong-Liverpool University, Suzhou 215123, China
Abstract. In Particle Swarm Optimization (PSO), setting the inertia weight w is
one of the most important topics. The inertia weight was introduced into PSO to
balance between its global and local search abilities. In this paper, first, we propose a method to adaptively adjust the inertia weight based on particle’s velocity information. Second, we utilize both position and velocity information to
adaptively adjust the inertia weight. The proposed methods are then tested on
benchmark functions. The simulation results illustrate the effectiveness and
efficiency of the proposed algorithm by comparing it with other existing PSOs.
Keywords: PSO, inertia weight, velocity information, adaption.
1 Introduction
Particle Swarm Optimization (PSO) was first introduced by Kennedy and Eberhart in
1995[1][2]. PSO uses a simple mechanism that simulates swarm behavior in birds
flocking to search for globally optimal solution. PSO has been rapidly developed in
recent years due to its simplicity in concept and easiness in implementation.
In PSO, a population of particles represents a group of candidate solutions to the
problem to be solved. Each particle is associated with two vectors, the position
, where D means
, ,…,
and the velocity vector
, ,…,
tor
that the solution space is a D-dimensional space. The basic equations are usually
given as follows: [1] [2]:
vid = w * vid + c1 * r1d * ( pBest id − x id ) + c 2 * r2 d * ( gBest id − x id )
xid = xid + vid
(1)
(2)
In equation (1), w is known as inertia weight [3]; c1, c2 are acceleration coefficients;
r1d and r2d are two random values in the range[0, 1].
*
This work is supported by National Natural Science Foundation of China under Grant
No.60975080, and Suzhou Science and Technology Project under Grant No. SYJG0919.
Y. Tan et al. (Eds.): ICSI 2011, Part I, LNCS 6728, pp. 71–79, 2011.
© Springer-Verlag Berlin Heidelberg 2011
72
Z. Zhou and Y. Shi
The inertia weight w was first introduced to linearly decrease [3] over generations
as shown in equation (3).
w = wmax − ( wmax − wmin )
gen
GENERATION
(3)
where gen is the current generation number and GENERATION is the maximum
number of generations. The range of inertia weight w is [0.4, 0.9] which can adjust the
local and global search ability [3] [4].
Another improvement is the introduction of constriction factor to PSO by M. Clerc
[5]. The constriction factor replaces the equation (1) with equation (4) and (5).
vid = K [ w * vid + c1 * r1d * ( pBestid − xid ) + c2 * r2d * ( gBestid − xid )]
K=
2
2 − ϕ − ϕ 2 − 4ϕ
, whereϕ = c1 + c 2 , ϕ > 4
(4)
(5)
Where K is set to 0.729 and c1,c2are both 2.05.
Adaptive PSO (APSO) was proposed by Z. Zhan and J. Zhang in 2009 [6]. In APSO, the inertia weight, acceleration coefficients is controlled automatically. Furthermore, an elitist learning strategy (ELS) is applied in convergence state to avoid being
stuck into local optimal. The APSO utilized only the particles’ position information.
As we knew, PSO is different from other evolutionary algorithms in that each individual (particle) is also associated with a velocity in addition to the position. Therefore, it is natural to believe that an adaptive PSO, which utilize both position and
velocity information, maybe can improve PSO’ performance further.
In this paper, first, we will introduce a method which borrows the idea in APSO
except that the inertia weight will be adaptively adjusted based on velocity information instead of position information in APSO. The purpose of doing so is to verify
whether velocity information alone can also be utilized to improve PSO’s performance. Then we will utilize both position and velocity information to adaptively adjust PSO’s inertia weight. The remaining paper is organized as follows, methods to
adaptively control the inertia weight will be proposed in Section 2. In Section3, the
PSO proposed will be tested and compared with other representative PSOs. Finally,
conclusions are summarized in Section 4.
2 Adaptive Control of Inertia Weight
2.1 Methods in APSO
As we borrowed the idea from APSO, we first present the process of APSO as follows [6]:
Step 1: Initialize the particles’ position and velocity as in traditional PSOs.
Step 2: For each particle i, calculate the mean distance to all the other particles by the
equation (6) as below:
Inertia Weight Adaption in Particle Swarm Optimization Algorithm
N
D
1
( xik − x jk ) 2
∑
∑
N − 1 j =1, j ≠ i k =1
Where N is the number of particles and D is the number of dimension.
di =
73
(6)
Step 3: Set the global best particle’s mean distance to all the other particles as dg.
Compare all di’s, find the maximum and minimum distances dmax and dmin.
Then determine an “evolutionary factor” f as:
f =
d g − d min
d max − d min
(7)
Step 4: Classify the value of f into four sets which represent the states of exploration,
exploitation, convergence and jumping out.
Step 5: Adjust the inertia weight by the equation (8), and adjust acceleration Coefficients in different state by the rules in table1.
w( f ) =
1
∈ [0.4,0,9]
1 + 1.5e −2.6 f
(8)
Step 6: In the Convergence state, ELS approach is applied.
Table 1. Strategies for control c1 and c2
State
Exploration
Exploitation
Convergence
Jumping-out
C1
Increase
Increase slightly
Increase slightly
Decrease
C2
Decrease
Decrease slightly
Increase slightly
Increase
The APSO is proved to enhance the performance of PSO in convergence speed and
global optimality [6]. In APSO, the inertia weight is adjusted based on the position
information. In the following section, a velocity-based adaptive inertia weight will be
introduced to verify the usefulness of velocity information.
2.2 Adaption of Inertia Weight Based on Velocity
The new method uses velocity information instead of the position information used in
APSO. The mean velocity difference between each particle and all other particles can
be calculated as in equation (9) which is similar to equation (6) in APSO.
di =
N
1
∑
N − 1 j =1, j ≠i
D
∑ (v
ik
− v jk ) 2
(9)
k =1
Where N is the population size and D is the number of dimension.
Then define a velocity-based evolutionary factor and inertia weight adaption by the
equation (7) (8) used in APSO. For convenience, they are given as follows:
74
Z. Zhou and Y. Shi
f =
w( f ) =
d g − d min
d max − d min
(10)
1
∈ [0.4,0,9]
1 + 1.5e −2.6 f
In this paper, the w is kept in the range [0.4, 0.9] during the PSO process.
2.3 Adaptive Inertia Weight Based on Both Position and Velocity Information
As mentioned above, we expect that by using both position and velocity information
to adjust the inertia weight can make the PSO perform better. A method implements
this goal is described as follows:
Firstly, denote the position-based evolution factor in equation (8) and the velocitybased evolution factor in equation (10) as fp and fv, respectively.
Then define a new hybrid evolutionary factor by set two weights wp and wv to fp
and fv as in the following equation (11):
f = wp* fp+ wv* fv
(11)
Adjust the inertia weight by the same equation as (8) as below:
w( f ) =
1
∈ [0.4,0,9]
1 + 1.5e −2.6 f
The wp and wv can be set with different values. In our test, the wp and wv are both set to
be 0.5, which means that the position and velocity information have the same influence on the inertia weight.
3 Experiments and Comparison
3.1 Benchmark Functions and Variants of PSOs
Six benchmark functions are used for the test, which are listed in Table2. These functions are widely used to test the evolutionary functions [7]. Among these functions, f1,
f2, f3 are unimodal functions and f4, f5, f6 are multimodal functions.
For comparison, variants of PSOs are used in this paper. The GPSO is the one with
linearly decreasing inertia weight from 0.9 to 0.4 proposed in [3]. The CFPSO is a
PSO with constriction factor = 0.729 proposed in [5]. The APSO is proposed by Z.
Zhan which was reviewed in Section 2 [6]. The last two PSOs are the adaptive inertia
weight based on velocity information alone and based on both position & velocity
information introduced in this paper, referred to as AIPSO (Adaptive velocity Inertia
weight PSO) and AHPSO (Adaptive hybrid Inertia Weight PSO) respectively.
For fairness of the test, the PSOs are with the population size of 20, dimensions of
30 and the same number of 2 10 FEs is used for the test functions. In order to
reduce statistical errors, each function will be tested for 30 times under each PSO
algorithm, and the mean results will be used for the purpose of comparisons.
Inertia Weight Adaption in Particle Swarm Optimization Algorithm
75
Table 2.Test Functions used in this paper
Test functions
ଶ
݂ଵ ሺ‫ݔ‬ሻ ൌ σ஽
௜ୀଵ ‫ݔ‬௜
஽
݂ଶ ሺ‫ݔ‬ሻ ൌ σ௜ୀଵ ȁ‫ݔ‬௜ ȁ ൅ ς஽
௜ୀଵ ȁ‫ݔ‬௜ ȁ
௜
ଶ
݂ଷ ሺ‫ݔ‬ሻ ൌ σ஽
௜ୀଵሺσ௝ୀଵ ‫ݔ‬௝ ሻ
஽ିଵ
݂ସ ሺ‫ݔ‬ሻ ൌ σ௜ୀଵ ሾͳͲͲ൫‫ݔ‬௜ାଵ െ ‫ݔ‬௜ଶ ൯
൅ሺ‫ݔ‬௜ െ ͳሻଶ ሿ
݂ହ ሺ‫ݔ‬ሻ ൌ σ஽
௜ୀଵ െ‫ݔ‬௜ •‹ሺඥ‫ݔ‬௜ ሻ
݂଺ ሺ‫ݔ‬ሻ
ଵ
σ஽ ‫ ݔ‬ଶ െ
ൌ
ସ଴଴଴ ௜ୀଵ ௜
െ ς஽
௜ୀଵ …‘•൫‫ݔ‬௜ Τξ݅൯
Search Space
[-100,100]D
[-10,10]D
fmin
0
0
Acceptance
0.01
0.01
Function name
Sphere
Schwefel’s
P2.22
Quadric
Rosenbrock
[-100,100]D
[-10.10]D
0
0
100
100
[-500,500]D
-12569.5
-10000
Schwefel
[-600,600]D
0
0.01
Griewank
൅ͳ
3.2 Comparison and Discussion
The solutions obtained by each PSO for different test functions are listed in
Table 3.The boldface indicates the best results among the algorithms. The experiment
results show that among GPSO, CFPSO, APSO and AIPSO, AIPSO can obtain the
best solution on unimodal function f1,f2,f3, but on multimodal functions f4, f5, f6,
AIPSO does not perform the best.
Table 3. Search result comparison for variants PSOs
Function
f1
Mean
f2
Mean
f3
Mean
f4
Mean
f5
Mean
f6
Mean
GPSO
1.20e-53
7.93e-34
4.13e-2
34.61
-9719.71
1.56e-2
CFPSO
4.47e-140
7.15e-30
3.85e-10
.
-7038.52
5.81e-2
APSO
1.45e-150
5.13e-84
1.61e-10
3.49
-12596.5
1.66e-2
AIPSO
1.16e-159
7.07e-89
4.45e-11
11.64
-7326.27
1.56e-2
AHPSO
2.67e-159
2.19e-86
9.67e-11
9.14
-7348.93
1.21e-2
The results on uninodal functions indicate that the method proposed in this paper
can improve the performance of PSO. In particular, the AIPSO perform best on unimodal functions f1,f2,f3, and the standard deviation of the solutions is the lowest while
AHPSO outperforms the APSO but lose to AIPSO by a small difference. For multimodal functions, the AHPSO can obtain the best solution on f6but both AHPSO and
AIPSO drop into local optimal on f4 and f5.
For the comparison of the algorithms’ search speed, Table 4 lists the mean number
of FEs (function evaluations) to obtain an acceptable solution. The CPU runtime is
utilized to measure the computational process, because the PSOs used in this paper
are different and some of them have extra calculations to increase the runtime.
It can be seen that AHPSO cost the least runtime onunimodal functionsf1, f2and
AHPSO is the fastest. On multimodal functionsf4,f5,f6, APSO cost the least CPU runtime and AHPSO ranked second on f4andf6. It should be noticed that the AIPSO and
AHPSO did not reach the acceptable solution on f5and fall into local optimal.
76
Z. Zhou and Y. Shi
Table 4. Number of FEs and mean run time needed to reach acceptable solution
Function
f1
Mean FEs
time(sec)
f2
Mean FEs
time(sec)
f3
Mean FEs
time(sec)
f4
Mean FEs
time(sec)
f5
Mean FEs
time(sec)
f6
Mean FEs
time(sec)
GPSO
106191
0.97
103225
1.02
135797
2.02
101533
0.91
90548
1.81
116235
1.39
CFPSO
199998
0.12
199981
0.22
199909
2.32
199995
0.99
----11432
0.23
APSO
7099
0.11
7925
0.17
21164
0.98
5334
0.09
5159
0.12
7568
0.16
AIPSO
7063
0.11
7921
0.13
22172
0.99
8150
0.11
----8081
0.17
AHPSO
6937
0.09
7343
0.11
22061
0.99
5360
0.09
----7938
0.13
The comparison of FEs is much more interesting than CPU runtime. For instance,
test on f1 tell us that the mean number of FEs of 106191, 199998, 7099, 7063,6937 are
needed by GPSO, CFPSO, APSO , AIPSO and AHPSO to reach an acceptable solution, respectively. Among these data, AHPSO only uses 6937 FEs and CPU runtime
of 0.09 seconds, which is the best performance among all the PSOs.
In the above experiments, the results of GPSO, CFPSO, APSO, AIPSO and AHPSO are compared, we can see that the proposed adaptive inertia weight methods are
efficient for PSO. The new PSOs outperform the other PSOs with a faster convergence speed and obtain better optimization results in most unimodal test functions but
not the multimodal functions.
The comparison among APSO, AIPSO and AHPSO should be specially focused.
In general, AISPO and AHPSO perform much better on unimodal functions and APSO perform better on multimodal functions. As APSO has adaptive inertia weight,
adaptive acceleration coefficients and a complex ELS approach to help to jump out of
local optima, while AIPSO and AHPSO only uses an adaptive inertia weight, we can
say that the result of AISPO and AHSPO is acceptable and the proposed method
which uses velocity information or both position and velocity information to replace
position information to adjust inertia weight in PSOs is promising.
3.3 PSOs with Elitist Learning Strategy (ELS)
As the AISPO and AHPSO do not perform well on multimodal functions, we consider
using Elitist Learning Strategy (ELS) as in APSO to helps PSO to jump out of local
optimal in AIPSO and AHPSO. The details are given in the following.
The APSO [6] has an ingenious method named Elitist Learning Strategy (ELS) to
help the particle swarm to jump out of local optimal. The ELS gives a random velocity generated from Gaussian distribution to the global best particle to push it to run for
a potentially better region in the convergence state.
If the global best particle finds a better region, it will move there and all other particles will follow, otherwise the global best particle does not find a better place, it will
not move and the global worst particle will move to this position.
Inertia Weight Adaption in Particle Swarm Optimization Algorithm
77
The merits of ELS have been studied by its introducers. After using this strategy,
the proposed algorithms’ performances are improved on most multimodal functions,
but the performance on unimodal functions will be slightly worse than the ones without ELS because the ELS actually add noise to the particle swarm.
In the following experiment, we will implement ELS on AIPSO and AHPSO to see
whether the algorithm can be enhanced. For simplicity, the ELS will work as follows:
While (f<= 0.05 in 3 continuous generations)
If (f<= 0.05in the next generation)
The ELS will be applied.
The new algorithms are run on f1, f2,f4, f5 for 30 trials. The mean solution gained by
each algorithm and the mean FEs (function evaluations) to reach an acceptable solution are shown in Table 5. For comparison, the AIPSO and AHPSO’s testing result
without ELS are also listed. So we can see that the uses of ELS and compare APSO,
AIPSO and AHPSO in a relatively equitable situation.
Table 5. Result of the algorithms with&without elitist learning strategy
Function
f1
f2
f4
f5
Mean
FEs
Mean
FEs
Mean
FEs
Mean
FEs
APSO
(has ELS)
1.45e-150
7099
5.13e-84
7925
3.49
5334
-12596.5
7568
AIPSO
(no ELS)
1.16e-159
7063
7.07e-89
7921
11.64
8150
-7326.27
---
AIPSO
(with ELS )
1.46e-150
8544
7.56e-84
8162
5.17
5488
-11261.7
10653
AHPSO
(no ELS)
2.67e-159
6937
2.19e-86
7343
9.14
5360
-7348.93
---
AHPSO
(with ELS)
1.15e-150
7332
2.31e-84
7911
3.08
5396
-12596.5
6911
After utilizing the ELS approach to AIPSO and AHPSO, their performance on
multimodal function f4 and f5 are obviously enhanced but brought down on unimodal
function because ELS adds noise to the particles. Especially on f5, without ELS, the
AIPSO and AHPSO cannot find an acceptable solution, but with ELS,AISPO perform
much better than before and the AHPSO can find the global best solution. By comparing the search speed, we can find that the AIPSO and AHSPO with ELS cost much
less FEs than before and become faster than APSO.
In summary, with ELS, the AIPSO and AHPSO can outperform the APSO, which
means that the velocity-based inertia weight and hybrid position & velocity inertia
weight can enhance the PSO, the performance of AIPSO and AHPSO are better than
APSO on most problems. These results meet our expectation that by utilizing velocity
information, the PSO can be improved.
3.4 Monitoring of the Inertia Weight
To monitor the behavior of the new inertia weight, we run AHPSO on Quadric function, and draw the time-varying f and inertia weight in figure 1.
78
Z. Zhou and Y. Shi
1
Inertia Weigt
0.9
0.8
0.7
0.6
0.5
0.4
Generation
Fig. 1.The time-varyinginertia weighton Quadric function
It can be seen from Figure.1 that during 1000 evolutionary generations, the w is
large at the early stage, then decreases rapidly, after that PSO is seen to jump out,
which lead to a large value of w, after that w drops until another convergence state.
The behavior of the inertia weight suggests that the PSO with this inertia weight can
find a potential optimal solution because the value of w reflects the evolutionary state
and the PSO has the potential to jump out of local optimum, that is, the inertia weight
has an abrupt rise after the convergence.
5 Conclusion
In this paper, we proposed two methods to adaptively adjust the inertia weight by
using velocity information. Borrowed the idea from APSO, first the velocity information is utilized instead of the position information in APSO. Another method utilized
both the position and velocity information to adjust the inertia weight. Experimental
tests on seven benchmark functions were conducted to compare the proposed AIPSO
and AHPSO with several existing PSOs including APSO. The experimental results
show that the proposed methods exceed the other PSOs on unimodal functions. For
multimodal functions, AIPSO and AHPSO with elitist learning strategy (ELS) in
general has better performance than APSO, which is reasonable because the APSO
utilizes position information which reflects the potential solutions themselves directly
while the AIPSO (AHPSO) utilizes the velocity information which reflects the changing tendency of the potential solutions but not (only) the solutions themselves. More
importantly, the simulation results illustrate that the use of velocity information can
effectively improve the PSO’s performance, which is the purpose of this paper. In our
future work, we are considering to utilize position, velocity, and cognitive diversity
for inertia weight adaptation.
References
[1] Kennedy, J., Eberhart, R.C.: Particle Swarm Optimization. In: Proc. IEEE Int. Conf. Neural Networks, vol. 4, pp. 1942–1948 (1995)
[2] Eberhart, R.C., Kenedy, J.: A New Optimizer Using Particle Swarm Theory. In: Proc. 6th
Int. Symp. Micro Machine and Human Science, pp. 39–43 (1995)
Inertia Weight Adaption in Particle Swarm Optimization Algorithm
79
[3] Shi, Y., Eberhart, R.: A Modified Particle Swarm Optimizer. In: Proc. IEEE World Congr.
Comput. Intell., pp. 69–73 (1998)
[4] Shi, Y., Eberhart, R.C.: Empirical study of particle swarm optimization. In: Proc. IEEE
Congr. Evol. Comput, pp. 1945–1950 (1999)
[5] Clerc, M., Kennedy, J.: The particle swarm-explosion, stability and convergence in a multidimensional complex space. IEEE Trans. Evol. Comput. 6(2), 58–73 (2002)
[6] Zhan, Z., Zhang, J., Li, Y., Chung, H.S.: Adaptive particle swarm optimization. IEEE
Trans. Syst., Man, Cybern. Part-B. Appl. Rev. 39(6), 1362–1381 (2009)
[7] Yao, X., Liu, Y., Lin, G.M.: Evolutionary programming made faster. IEEE Trans. Evol.
Comput. 3(2), 82–102 (1999)