Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

Particle Swarm Optimization

LIACS Natural Computing Group Leiden University


Particle Swarm Optimization (PSO)
• Developed by Eberhart and
Kennedy in 1995.
• A population based optimization
technique inspired by social
behavior of bird flocking or fish
schooling.
• Individual members of the swarm
can profit from the discoveries
and previous experience of all
other members of the school
during the search for food.

2 LIACS Natural Computing Group Leiden University


Cooperation and group dynamics
• Intelligence is not necessarily only individual, but
also interpersonal.
• Knowledge can be shared by social interaction.
• Simple local processes underlie the unpredictable
group dynamics of social behavior.
• Multiple simple agents interacting can be used to
obtain intelligent group behavior to solve complex
problems.

3 LIACS Natural Computing Group Leiden University


Birds searching for food
• Birds fly randomly through the search space.
• Each position in the search space holds a certain
amount of food.
• Each bird wants to move to the place with the
highest amount of food.
• None of the birds knows where that place is.
• What is the best strategy for each bird to end up in
a place with as much food as possible?
Follow the bird with most food!

4 LIACS Natural Computing Group Leiden University


Particle swarm optimization
• Individuals are known as particles.
• Each particle resides at a position in the search
space.
• The fitness value represents the amount of food
at a certain position.
• The particles fly through the search space
following the currently optimal particles.
• Each particle uses its own experience and the
experience of the swarm to change its position.

5 LIACS Natural Computing Group Leiden University


A swarm in a 2D search space

6 LIACS Natural Computing Group Leiden University


The search process
Randomly initialize the start position of each particle i:
r r r
xi (0) ∈ U [a , b ]
r
Each iteration update the positions with a velocity vi :
r r r
xi (t + 1) = xi (t ) + vi (t )
r
Velocity vi :
• Determines the direction and step size of the update.
• Reflects experimental knowledge and socially exchanged
information.

7 LIACS Natural Computing Group Leiden University


Determining the velocity
Update the velocity of each particle by:
1. Following its personal best: the position of the
best fitness the particle has achieved so far
pbest.
2. Either following the global best particle gbest or
the best particle within the neighborhood lbest.
3. Update the current velocity of the particle
(direction and step size) using pbest and
gbest/lbest.

8 LIACS Natural Computing Group Leiden University


Global best velocity update (1)
Velocity update (i runs through particles):
r r
v i (t + 1 ) = ω ⋅ v i (t )
r r
+ c 1 ⋅ r1 i (t ) ⋅ ( y i (t ) − x i (t ))
( rˆ r
+ c 2 ⋅ r2 i (t ) ⋅ y (t ) − x i (t ) )
ω : inertial constant
r1 i (t ), r2 i (t ) ~ U (0 ,1 ) : random coefficients
c1 , c 2 : positive acceleration coefficients
r
y i (t ) : the personal best position
r
ŷ (t ) : the global best position

9 LIACS Natural Computing Group Leiden University


Global best velocity update (2)
r
y i (t )

v
v vi (t + 1) v
xi (t + 1)
xi (t ) r
ŷ (t )

v
vi (t )

10 LIACS Natural Computing Group Leiden University


Global best velocity update (3)
pbest is calculated as:
r r r
r ⎧ yi (t ) if f (xi (t +1)) ≥ f ( yi (t ))
yi (t +1) = ⎨ r r r
⎩xi (t +1) if f (xi (t +1)) < f ( yi (t ))
gbest is calculated as:

{ r r
(
y (t ) = arg min f ( x0 (t )),..., f xnS (t ) )}
Where n S is the number of particles in the swarm.

11 LIACS Natural Computing Group Leiden University


Local best velocity update (1)
Two types of local neighborhoods:

• Geographical neighborhoods:
Particles are considered to be neighbors if their
current positions lie close to each other.
• Ring social network neighborhoods:
Besides their positions in the search space, the
particles are placed in a communication ring
that does not change over time.

12 LIACS Natural Computing Group Leiden University


Geographical neighborhoods

13 LIACS Natural Computing Group Leiden University


Ring social network neighborhoods
1

8 2

7 3

6 4

14 LIACS Natural Computing Group Leiden University


Local best velocity update (2)
Using the ring social network:
r r
v i (t + 1 ) = ω ⋅ v i (t )
r r
+ c1 ⋅ r1 i (t ) ⋅ ( y i (t ) − x i (t ))


( rˆ r
+ c 2 ⋅ r2 i (t ) ⋅ y i (t ) − x i (t ) )
With local best y i (t ) :
rˆ r r
y i ( t ) = min { f ( x m ( t )) | x m ( t ) ∈ N i }

And neighborhood Ni:


r r r
Ni = {xi −n (t ),K,xi (t ),K,xi +n (t )}

15 LIACS Natural Computing Group Leiden University


Pseudo code
for each iteration do
for I=1 to number of particles m do
R1 = uniform random number
R2 = uniform random number
for J=1 to number of dimensions n do
V[I][J] = w * V[I][J]
+ C1 * R1 * (PBEST[I][J] - X[I][J])
+ C2 * R2 * (GBEST[J] - X[I][J])
X[I][J] = X[I][J]+V[I][J]
enddo
update PBEST
enddo
update GBEST
enddo

16 LIACS Natural Computing Group Leiden University


Social aspects of a particle
r
Previous velocity, ω ⋅ vi (t ) :
• Inertia component; memory
• ω is usually chosen slightly less than 1
r r r
Cognitive component, c1 ⋅ r1 ⋅ ( yi − xi ):
• Its own performance w.r.t. the past; nostalgia
• Usually chosen approximately 2
r rˆ r
(
Social component, c 2 ⋅ r2 ⋅ yi − xi : )
• Performance of its neighbors w.r.t. the past; envy
• Usually chosen approximately 2
17 LIACS Natural Computing Group Leiden University
Exploration versus exploitation
• Exploration: the ability to explore regions of the
search space.

• Exploitation: the ability to concentrate the search


around a promising area for refinement.

• c1 ⇔ c 2 reflects the tradeoff between exploration


and exploitation.

18 LIACS Natural Computing Group Leiden University


PSO in practice
Problem:
• The velocity of the particles quickly explodes to
large values. Assigning a Vmax should prevent this.

Improvements:
• Use adaptive acceleration coefficients.
• Use adaptive swarm sizes.
• Dynamically change inerta weights.

19 LIACS Natural Computing Group Leiden University


Application of PSO

PSO is applicable for the optimization of multi-


dimensional non-linear functions.

Among others, applications for:


• Traveling Salesman Problem
• Training of Neural Networks
• Improving the fermentation medium for
Echinocandin B production
• Reactive Power and Voltage Control
considering Voltage Security Assessment

20 LIACS Natural Computing Group Leiden University


Social Systems vs. Particle Swarms
Social-Psychology PS Algorithm
Individual (minds) Particles in space

Population of individuals Swarm of particles

Forgetting and Learning Increase or decrease in some


attribute values of the particle
Individual own experience Each particle has some knowledge
of how it performed in the past and
uses it to determine where it is
going to move to.
Social interactions Each particle also has some
knowledge of how other particles
around itself performed and uses it
to determine where it is going to
move to.

21 LIACS Natural Computing Group Leiden University


Further reading
General Particle Swarm Optimization:
• http://en.wikipedia.org/wiki/Particle_swarm_optimization
• http://www.particleswarm.info/
• http://www.engr.iupui.edu/~shi/Coference/psopap4.html

Simulation applications:
• http://www.projectcomputing.com/resources/psovis/index.html
• http://uk.geocities.com/markcsinclair/pso.html

22 LIACS Natural Computing Group Leiden University

You might also like