Particle Swarm
Optimization
Mohamed Talaat
1
Agenda
• What is PSO?
• Basic Idea of PSO.
• PSO Algorithm.
• PSO Parameters.
• GA vs PSO
• Demo
• Advantages of PSO.
• Limitations of PSO.
2
3
What is PSO?
• Inspired from the nature social behavior and dynamic
movements with communications of insects, birds
and fish.
– Steer toward the center
– Match neighbors’ velocity
– Avoid collisions
• Proposed by James Kennedy & Russell Eberhart
(1995)
Neural Networks NN 1 4
Basic Idea Of PSO
5
Basic Idea Of PSO
• 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 “flying”
according to its own flying experience as well as the
flying experience of other particles.
Combines self-experiences with social experiences.
6
Basic Idea Of PSO
• Collection of flying 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
7
Basic Idea Of PSO
• 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
PSO Algorithm – Mathematical
Model
PSO Algorithm
1. Create a ‘population’ of agents (particles) uniformly
distributed over X
2. Evaluate each particle’s position according to the objective
function.
3. If a particle’s current position is better than its previous best
position, update it.
4. Determine the best particle (according to the particle’s
previous best positions).
PSO Algorithm
5. Update particles’ velocities:
6. Move particles to their new positions:
7. Go to step 2 until stopping criteria are satisfied
PSO Algorithm
[x*] = PSO()
P = Particle_Initialization();
For i=1 to it_max
For each particle p in P do
fp = f(p);
If fp is better than f(pBest)
            pBest = p;
end
end
gBest = best p in P;
For each particle p in P do
v = v + c1*rand*(pBest – p) + c2*rand*(gBest – p);
p = p + v;
end
end
PSO Parameters
• Number of Particles: usually between 10 and 50
• C1: is the importance of personal best value
• C2: is the importance of neighborhood best value
• Usually C1 + C2 = 4
• If velocity is too low → algorithm too slow
• If velocity is too high → algorithm too unstable
GA vs PSO
• Both algorithms start with a group of a randomly generated
population.
• Both have fitness values to evaluate the population.
• Both update the population and search for the optimum with
random techniques.
• Both systems do not guarantee success.
• PSO does not have genetic operators like crossover and
mutation. Particles update themselves with the internal
velocity.
GA vs PSO
• In GAs, chromosomes share information with each other.
So the whole population moves like a one group towards an
optimal area.
• In PSO, only gBest (or lBest) gives out the information to
others. It is a one -way information sharing mechanism.
• In GAs, the evolution only looks for the best solution.
• In PSO, all the particles tend to converge to the best
solution quickly.
Demo
15
16
Advantage/Disadvantages s of PSO
• Advantages:
• Simple implementation.
• Easily parallelized for concurrent processing.
• Derivative free.
• Very few algorithm parameters.
• Very efficient global search algorithm.
• Disadvantages:
• Memory
• Slow convergence.
Thanks 
17

Particle Swarm Optimization - PSO

  • 1.
  • 2.
    Agenda • What isPSO? • Basic Idea of PSO. • PSO Algorithm. • PSO Parameters. • GA vs PSO • Demo • Advantages of PSO. • Limitations of PSO. 2
  • 3.
    3 What is PSO? •Inspired from the nature social behavior and dynamic movements with communications of insects, birds and fish. – Steer toward the center – Match neighbors’ velocity – Avoid collisions • Proposed by James Kennedy & Russell Eberhart (1995)
  • 4.
    Neural Networks NN1 4 Basic Idea Of PSO
  • 5.
    5 Basic Idea OfPSO • 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 “flying” according to its own flying experience as well as the flying experience of other particles. Combines self-experiences with social experiences.
  • 6.
    6 Basic Idea OfPSO • Collection of flying 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
  • 7.
    7 Basic Idea OfPSO • 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
  • 8.
    PSO Algorithm –Mathematical Model
  • 9.
    PSO Algorithm 1. Createa ‘population’ of agents (particles) uniformly distributed over X 2. Evaluate each particle’s position according to the objective function. 3. If a particle’s current position is better than its previous best position, update it. 4. Determine the best particle (according to the particle’s previous best positions).
  • 10.
    PSO Algorithm 5. Updateparticles’ velocities: 6. Move particles to their new positions: 7. Go to step 2 until stopping criteria are satisfied
  • 11.
    PSO Algorithm [x*] =PSO() P = Particle_Initialization(); For i=1 to it_max For each particle p in P do fp = f(p); If fp is better than f(pBest)             pBest = p; end end gBest = best p in P; For each particle p in P do v = v + c1*rand*(pBest – p) + c2*rand*(gBest – p); p = p + v; end end
  • 12.
    PSO Parameters • Numberof Particles: usually between 10 and 50 • C1: is the importance of personal best value • C2: is the importance of neighborhood best value • Usually C1 + C2 = 4 • If velocity is too low → algorithm too slow • If velocity is too high → algorithm too unstable
  • 13.
    GA vs PSO •Both algorithms start with a group of a randomly generated population. • Both have fitness values to evaluate the population. • Both update the population and search for the optimum with random techniques. • Both systems do not guarantee success. • PSO does not have genetic operators like crossover and mutation. Particles update themselves with the internal velocity.
  • 14.
    GA vs PSO •In GAs, chromosomes share information with each other. So the whole population moves like a one group towards an optimal area. • In PSO, only gBest (or lBest) gives out the information to others. It is a one -way information sharing mechanism. • In GAs, the evolution only looks for the best solution. • In PSO, all the particles tend to converge to the best solution quickly.
  • 15.
  • 16.
    16 Advantage/Disadvantages s ofPSO • Advantages: • Simple implementation. • Easily parallelized for concurrent processing. • Derivative free. • Very few algorithm parameters. • Very efficient global search algorithm. • Disadvantages: • Memory • Slow convergence.
  • 17.