You are on page 1of 7

The Swarm and the Queen: Towards a Deterministic and Adaptive Particle

Swarm Optimization

Maurice Clerc
France Tt5lkom
12, av. de Chevene
74988 Annecy, France
maurice.cler@writeme.com
Un tr&r est cache dedans.
Je ne sais pas 1'endroft; mafs un peu de courage
Vous le fera trouver.
Le Laboureur et ses Enfants. Jean de La Fontaine I

Abstract- A very simple Particle Swarm Optimization Kennedy and Spears 1998; Shi and Eberhart 1998; Shi
iterative algorithm is presented, with just one and Eberhart 1998). Recently, a mathematical
equation and one sodaYconfidence parameter. We explanation, introducing a five dimensional space of
define a "no-hope"convergence criterion and a "re- states and some constriction coefficients for sure
hope" method so that, from time to time, the swarm convergence, has been found (Clerc and Kennedy
re-inltializes its position, according to some gradient submitted) but as there was still no sure way to choose a
estimations of the objective function and to the priori the best parameters, one of them (the
previous re-initialization (it means it has a kind of social/confidence coefficient q) is randomly modified at
very rudimentary memory). We then study two each time step. Also PSO is usually using a system of
different cases, a quite "easy" one (the Alpine two iterative equations, one for the positions and one for
function) and a "difRcult"one (the Banana function), the particles velocities, with several parameters. It gives
but both just in dimension two. The process is more "freedom" to the system but it is also then quite
improved by taken into account the swarm gravity difficult to find the best parameter values.
center (the "queen") and the results are good On the contrary, we present here a purely
enough so that it is certainly worthwhile trying the deterministic algorithm, with just one equation, one
method on more complex problems. confidence coefficient, and one "memory" parameter.
The core of what we could call a No-hope/Re-hope
method is an adaptive process freely inspired by the
1 All for one and one for all outer iteration procedure as described in (Niederreiter
Suppose you and your friends are looking for a treasure in and Peart 1986). At each time step we examine whether
a field. Each digger has an audio detector and can there is still "hope" to reach the objective and, if not, we
communicate to his n nearest neighbours the level of the reinitialize all positions around the best one, taking into
sound he heards and his own position. So each digger account the local shape of the objective function, a s it
knows whether one of his neighbours is nearer to the can be estimated by using the particles positions
objective than him and, if it is the case, can move more (previous and current), and function values. We also
or less towards this damned lucky guy, depending on how examine if the gravity center (the "queen") is itself in a
much he trusts him. So, all together, you may find the solution point: it does not cost much in processor time
treasure more quickly than if you were alone. Or suppose and it appears it sometimes greatly speeds up the
you and your friends are looking for the highest mountain convergence.
in a given country. You all have altimeters and can
communicate , etc ...
This kind of algorithm, called Particle Swarm
Optimization (PSO), has been first and is still largely
experimentally studied: it is indeed extremely efficient
(Eberhart and Kennedy 1995; Kennedy and Eberhart
1995; Kennedy and Eberhart 1997; Angeline 1998;

' Abittreasure is hidden inside I I don't know the place: but with a
of courage /You will find it.
The Ploughman and his Children. Jean de La Fontaine.

0-7803-5536-9/99/$10.00 01999 IEEE 1951


~~ ~

that, for a given objective value S and a given 200


acce table error value E , we have 180
f(xS7 E V = [S - e, S + E ] . For simplicity the space of
-
search is a hypercube H [hi,,,
D
xmm] , H C 52 . it means
we have at least an idea of where the objective point is.
160
140
120
T 100
We define the objective function g 80
Ax) =Is
- f(xl 60
40
Equation 1 20
0
The basic iterative representation we use here is just
x(t + 1) = x(t) + d p - x(t))
Equation 2
Figure 1. Typical theoretical performance curve ( ~ 0 . 0 1 ,
where 'p is the social or confidence coefficient, and p Ax=lO)
the point to which the particles have to converge.
From the Equation 2, if we consider a sequence of time
steps in which p is a constant, we immediately have 3 No-hope criterion
P-x(t)-(l-~)t,)t(P-x(0)) We can define a particle "velocity" b
v(t) = x(t + 1) - x(t{
Equation 3
The conver ence condition is then Equation 8
9-alEP,I[ or P ' ~ l O * a U l L a It means we have here
Equation 4 v(t) = d P - x(t -1)) = d l - d (P - 4 0 ) )
In particular, if we want a convergence to p with an Equation 9
admissible error E , and if the objective function is not too So the maximum "flight" of a particle between time
"sharp" and, more important, not too "flat" around p. that steps t, and t,, i.e. the distance to the farthest point it can
is to say if we have in practice reach, is
k p ) - Ax]- E f o r b -PI E
Equation 5
lK,.tz - ~ l v ( 4 ) - l P - w ( o ~ ( ( l - v ) -1( ~l - d Z )
1-1,
ifv40.N
we obtain convergence time T = l\i %)I ifv EP,2[

Equation 10
In particular, the maximum remaining possible flight
at time t i s
Equation 6 p.-
'IP-X(oJ(1-~)' i f v q q
If we know nothing about p nor x(O), a theoretical [F,.- =lP-X(OjQdl-d' ifcpEJq
estimation of the convergence time Ttheoris then (defining
Ax = %ax - Xmin ) Equation 11
. /4E\ If we define the diameter of the swarm by
e(t) max(i,,)$l,qD I - xj /
Equation 12
Equation 7
and by noting that we have
By plotting TIheorversus cp. we obtain a performance
curve. Figure 1 shows a typical one. Note that due to the
W) = I P - X(0)lll - VIf
hypothesis in Equation 5, we may in practice obtain a Equation 13
better performance curve with some particular objective
functions: the theoretical one is just a good guideline. an estimation of the space of search diameter at each
time step is then given by the formula

1952
fi = W t ) i f q q q
4 -(Zo,-1)8(t) ifo,EP,q
Equation 14
As we can see, it is decreasing.
Now let %mv be the gravity center of the swarm (see
the pseudo-code below for two possible definitions). We Equation 20
can have an idea of the local shape of the objective Of course, we suppose we have Q)re-hope(O)z 1
function by examining the values
(typically 1.1). In practice, in the examples below, each
A
-$,
. A X i ) -B(xgrsv) particle has its coordinates redefined by
4 xi -xgrav

Equation 15
Finally, we define our "no-hope'' criterion by writing Equation 21
the search space is too small (in the case, of course, we It means the new swarm position is quite similar to
_ _ gravity center)
have not found a solution yet, even in the the initial position, but usually "distorted" along some
N

i"
< 2 E ' , with E' dimensions.

5 Swarm & Queen algorithm


The high level algorithm pseudocode for a given swarm
size is given below. Note that a s the search space is
Equation 16 globally decreasing during the process, the best initial
position seems to be a regular disposition on the
hypercube H "frontier", but this particular point would
4 Re-hope method need more investigation, particularly for o, values greater
than 1. So we will just examine the case q EN, . Note
In practice, p may be modified during the search. The
simplest way is probably to consider, for a given particle, also that the algorithm could be easily modified to search
p is the best position found in the neighbourhood of this an extremum, but we would not have then a rigorous
particle at each time step, and even to consider this success criterion.
neighbourhood itself is the whole swarm. So let us call THE SWARM&QUEEN ALGORITHM
x, the best position at a given time step. <choose the acceptable error E>
Let nm-,n,tbe the number or reinitializations which <initialize the particle positions>
have already happened, and P)re-hope (nre-in,r) be the (comment: in our particular case, put the particles
regularly on the frontier of H>
memory parameter. In this Re-hope method, we define a <choose the o, value>
new swarm position "around" the previous best particle
<choose the qre-hope(0)value>
%est so that its diameter along the dimension d is defined
bY <choose the maximum acceptable number of time steps
tmax >
(comment: the theoretical convergence time (Equation
7) gives an idea of what it should be)
t*O
while t 5 t,,, do
<compute the gravity center xgrav> (comment: either
weighted or unweighted, see below)
if f(xgrav)EV then <SUCCESS; STOP> else
<find the best particle in the swarm>
(comment: the one for which A x i ) is the
smallest)
Equation 19 for each particle i do
and A d g an estimation of the gradient of g along the x i @ + 1) = x i ( t ) + ~ t ( X b e s t ( f ) - X i ( f ) )
dimension d. In practice, it is calculated a s follow:

1953
I I

Figure 2. The 2D Alpine function


(comment: mathematically necessary to be In dimension two and on [0,10]2 it gives Figure 2.
always able to compute g ( $ ) With a lot of imagination, you can almost recognize the
if (xi( t + 1) EV then <SUCCESS; STOP> French CBte d’Azur in the South and the Mont Blanc as
if fit < 2d then <use the Re-hope method> the highest summit. This function is interesting for testing
t-t+l the search of an extremum for the following reasons:
end while there are as many local extrema a s w e want, just by
FAILURE increasing q,,
end there is just one global extremum,
the solution can easily be directly computed.
UNWEIGHTED GRAVITY CENTER UGC
L )
In any dimension D, in the hypercube [0,10]’. the
Equation 22 maximum is at the point (x,,x~,...,x~)E[O,~]’ where x,
is the solution of
WEIGHTEO GRAVITY CENTER WGC
A ) tan(x)+Zx -o,~E]?,?[
Equation 25
that is to say the point (7.917,...,7.917). The maximal
value is then about 2.808’.
Equation 23
(comment: the better the particle the bigger its weight)

We now examine some results in two cases: the


Alpine function, which is quite easy, and the Banana
function, a bit more difficult, both in dimension 2. for we
are just trying for the moment to understand what
happens.

6 Two examples

6.1 The Alpine function


This function is defined by

Equation 24

1954
~~ ~~

Figure 3. The Banana function (reduced scale for


function values)
clearly see the swarm has indeed often some difficulties
6.2 The Banana function to fini a solution for the Banana function.
Rosenbrocks valley (De Jong's function 2, Banana
function) is a classic optimization problem. The global
minimum ( S O ) is inside a long, narrow, parabolic
shaped flat valley, and convergence to the solution point
(1,l) is well known to be difficult. In 2D the equation of
the surface is
f(Xl,X2)'10O(X2 -x$+ (1-xl)2

Equation 26

Figure 3 shows what the function looks like for


( ~ ~ , x ~ ) E [ - 2 , (as
2 ] ~function values are quite big, the
scale has been reduced along the third dimension).

7 Results
We study here what happens when we are looking for
the (known) maximal value of the 2D-Alpine function on
[0,10]2, and the (known) minimal value of the 2D-
Banana function. In both cases the admissible error is
e=O.Ol. We try the 49 Q, values (0.02, 0.06 ,...,0.98), with
tmax= 400 and qre-hope( 0) = 1.05 . Figure 4 shows a
typical convergence sequence. It is interesting to note
how the swarm almost finds a solution in just two time
steps, but the solution area is so thin that it doesn't "see"
it, and so it has to slowly come back.
Some global performance curves are in Figure 5 (with
each Re-hope process counted a s a time step). We

1955
--t t=O
--t t=l

0,84 -

0,82 -
0,80 -
0,78
0,76 -
- -
-Solution

-
t54
t=5
t=6
t-7
are;

0,74 - - -- -- t=8

0,72 -

0,70 4

Figure 4. A convergence sequence for the Banana function ( ~ 0 . 6 weighted


, gravity
center)

Figure 5. Performance curves for the 2D Alpine and Banana functions (weighted
gravity center)

1956
quality = 1- -
As the success ratio is simply 100% (which is not the
case, for example, by using a "classical" PSO with a
random q), it makes sense to globally compare the
curves to the theoretical one
converg. time-

Equation 27
converg. time
A -
converg. time
theoretical curve

Also it is interesting to note how many successes are


To Neil Hickox for his nice MacOS 3D Surfaces
software.
Bibliography
Angeline, P. J. (1998).
&tide
Selection to Improve
Swarm Oat- . . . . IEEE International
Conference on Evolutionary Computation, Anchorage,
Alaska, May 4-9.
Clerc, M. and J. Kennedy (submitted). "The Particle
Swarm: Explosion, Stability, and Convergence in a
Multi-Dimensional Complex Space. .
Eberhart, R. C. and J. Kennedy (1995). New O .p . w
obtained thanks to the Queen, to the Re-hope method or Theory. Proc. Sixth International
both.. Finally, we obtain Table 1. Symposium on Micro Machine and Human Science,
Alpine I Banana 1 Nagoya, Japan, IEEE Service Center, Piscataway, NJ.
function I function . Kennedy, J. and R. C. Eberhart (1995). Particle S w a
UGC I WGC I UGC 1 WGC. m z a t i o p IEEE International Conference on Neural
Success ratio lO0sB l 0 O A l0OA 1 0 0 % Networks, Perth, Australia, IEEE Service Center,
a)laststepthanks) 5596 9696 2 % 1 6196 Piscataway, NJ.
to the queen I I I I Kennedy, J. and R. C. Eberhart (1997). j4 discrete b m
b) the Re-hone I 59sa 491 73%1 75 yersion of the Darticle swarm a b o rithm. International
Conference on Systems, Man, and Cybernetics.
Kennedy, J. and W. M. Spears (1998). Match
s to Problems: An Experimental Test of the
Quality vs 1.19 s m
0 s on the
theoretical Multimodal Pr oblem Generatob. IEEE International
estimation Conference on Evolutionary Computation.
Table 1. Some quality ratios. Niederreiter, H. and P. Peart (1986). "Localisation of
search in quasi-Monte Carlo methods for global
optimization." SIAM I. Sci. S w t . C o w 7: 660-664.
8 Discussion Shi, Y. and R. C. Eberhart (1998). Parameter Selection in
In these four cases, the Swarm&Queen method works Particle Swarm Optimization, Indiana University Purdue
University Indianapolis.
extremely well, although the WGC option clearly ..
Shi, Y. H. and R. C. Eberhart (1998). U d i f i e d Pq&&
improves the performance. Interestingly, the convergence
is not always obtained for the same reasons. Sometimes Swarm ODtimizer. IEEE International Conference on
the Re-hope procedure is used, sometimes not, Evolutionary Computation, Anchorage, Alaska, May 4-9.
sometimes the successful time step is due to the Queen,
sometimes not. This suggests that the three mechanisms
normal iteration
gravity center
Re-hope procedure

are indeed able to cooperate. Nevertheless it is still


unclear how the best qre-hope(0) has to be chosen. It has
been done here experimentally (for example results are a
bit worse with the value 1.5) and this is of course not
very satisfying. Some preliminary results show the
optimal value is in fact slightly depending on q. So an
obvious research direction is now to clear up this
theoretical point.
Acknowledgments
To Jim Kennedy, for his kind proofreading and for the
"weighted gravity center" idea.

1957

You might also like