Sie sind auf Seite 1von 21

THE INTRODUCTION OF

PARTICLE SWARM
OPTIMIZATION
(PSO)

Muhammad
Hafi z

INTRODUCTION TO THE PSO

Inspired from the nature social behavior and dynamic


movements with communications of insects, birds and
fi sh

COOPERATION EXAMPLE
Fisherman 1

Fisherman 2

HOW PSO WORK


Uses a number of agents
(particles ) that constitute a
swarm moving around in the
search space looking for the
best solution
Each particle in search
space adjusts its fl ying
according to its own fl ying
experience as well as the
fl ying experience of other
particles

In 1986, Craig Reynolds described this process in 3


simple behaviors:

Separation

Alignment

Cohesion

avoid crowding local


flockmates

move towards the


average heading of
local flockmates

move toward the


average position of
local flockmates

CONCEPT OF PSO
Collection of fl ying particles (swarm) Changing solutions
Search area - Possible solutions
Movement towards a promising area to get
the global optimum
Each particle keeps track:
its best solution, personal best, pbest
the best value of any particle, global best, gbest

Each particle adjusts its travelling speed dynamically


corresponding to the flying experiences of itself and its

colleagues
Each particle modifies its
position according to:

its current position

its current velocity

the distance between its


current position and pbest

the distance between its


current position and gbest

sk+1

vk
vk+1
sk

vgbest
vpbest
x

s k : current searching point.


s k + 1 : modified searching point.
v k:
current velocity.
v k + 1 : modified velocity.
v p b e s t : velocity based on pbest.

Particles velocity:

1. Inertia

2.
Personal
Influence
3. Social
Influence

Makes the particle move in the


same direction and with the
same velocity
Improves the individual
Makes the particle return to a
previous position, better than
the current
Conservative
Makes the particle follow the
best neighbors direction

PSEUDOCODE FOR A PSO


PROCEDURE
Start
Fo r e a c h p a r t i c l e
Initialize particle
END
Do
Fo r e a c h p a r t i c l e
C a l c u l a t e fi t n e s s v a l u e
I f t h e fi t n e s s v a l u e i s b e t t e r t h a n t h e b e s t fi t n e s s v a l u e ( p B e s t ) i n
history
s e t c u rre n t v a l u e a s t h e n e w p B e s t
End
C h o o s e t h e p a r t i c l e w i t h t h e b e s t fi t n e s s v a l u e o f a l l t h e p a r t i cl e s a s t h e
gBest
Fo r e a c h p a r t i c l e
C a l c u l a t e p a r t i c l e v e l o c i t y a c c o rd i n g e q u a t i o n ( a )
U p d a t e p a r t i c l e p o s i t i o n a cc o rd i n g e q u a t i o n ( b )
End

C h e c k i f t e rm i n a t i o n = t r u e ;
End

Flow chart depicting the General PSO Algorithm:

Start

For each particles position (p)


evaluate fitness
If fitness(p) better than
fitness(pbest) then pbest= p
Set best of pBests as gBest
Update particles velocity (eq. 1) and
position (eq. 3)
Stop: giving gBest, optimal solution.

Loop until max iter

Loop until all


particles exhaust

Initialize particles with random position


and velocity vectors.

COMPARISONS BETWEEN GENETIC


ALGORITHM AND PSO
Most of evolutionary techniques have the following
procedure:
o Random generation of an initial population
o Reckoning of a fi tness value for each subject. It will
directly depend on the distance to the optimum.
o Reproduction of the population based on fi tness
values.
o If requirements are met, then stop. Otherwise go back
to loop.

INTRODUCTION TO THE PSO:


ALGORITHM - EXAMPLE

THANK YOU

Das könnte Ihnen auch gefallen