Particle Swarm Optimization
Particle Swarm Optimization
the bird flocking or fish schooling. Each particle ( X i ) of a swarm can move in a D-dimensional
search space. The movement of each particle depends on its velocity and position. The position
of i-th particle of a D-dimensional search space represents a candidate solution,
X i =[ x i ,1 , x i ,2 , xi , 3 , . . .. , x i , D ]. The initial velocity of each particle is represented as
V i=[v i ,1 , v i ,2 , v i ,3 , . .. . , v i , D ]. In each iteration, a particle updates its position by remembering the
following two best values,
i. The best position of a particle achieved so far is called Personal best ( P best i) and its
corresponding objective function value is Pval i.
ii. The best position obtained so far considering all particles of the swarm is called Global
best (Gbest ), and its corresponding objective function value is Gval .
After finding the Pbest i and Gbest each particle updates its velocity and positions using Eq.1
and Eq.2.
t +1 t
V i =w∗V i +C 1∗r 1 ()∗( Pbest i−X i ) + C2∗r 2 ()∗( Gbest −X i ) (1)
t +1 t +1
X i = X i +V i (2)
Parameters of PSO
i. Dimension of problem (D)
ii. Population size (N)
iii. Lower limits of each element present in D dimensional vector ( Fd 1)
iv. upper limits of each element present in D dimensional vector ( Fd 2)
v. velocity of i-th particle (V i)
vi. Cognitive (C 1) and social acceleration coefficients (C 2) of PSO
vii. Inertia weight of PSO (w )
Step 1. Initialization
Example
X 3 =[5.21.5 5.5]
Initially the position of each particle will be the personal best solution each particle
Global best value (Gval ¿=min ( f ( X ) )=49.97 is the corresponding objective function value of
X4
Global best solution (Gbest )= position of the X 4 particle= [6.4 1.5 2.6]
2. PSO Main Loop
¿ [ 0 0 0 ] + [ 0 0 0 ] +0.84∗[4.2−3−4.1]
¿ [3.528−2.16−3.444]
t +1 t +1
X i = X i +V i
f (X ¿ ¿ 1 )≤ Pbest 1 ¿ yes
1
Pval 1=48.875
f (X ¿ ¿ 1 )≤ Gval ¿ Yes
1
Update Global best solution (Gbest ) and Global best value (Gval ¿
Gval=48.875
ii. For 2nd particle ( X 2 )
¿ [ 0 0 0 ] + [ 0 0 0 ] +1.08∗[3.928−1.16−2.944 ]
¿ [4.242−1.252−3.179 ]
t +1 t +1
X i = X i +V i
f (X ¿ ¿ 2 )≤ Pbest2 ¿ yes
1
Pval 2=50.679
f (X ¿ ¿ 2 )≤ Gval ¿ No
1
Global best solution (Gbest ) and Global best value (Gval ¿ remain unchanged
¿ [0.601 0.9576−2.558]
t +1 t +1
X i = X i +V i
f (X ¿ ¿ 3 )≤ Pbest 3 ¿ yes
1
Pval 3=48.342
f (X ¿ ¿ 3 )≤ Gval ¿ Yes
1
Update Global best solution (Gbest ) and Global best value (Gval ¿
Gval=48.342
f (X ¿ ¿ 4 )≤ Pbest 4 ¿ yes
1
Pval 4=49.193
f ( X ¿ ¿ 4 )≤ Gval ¿ No
1
Global best solution (Gbest ) and Global best value (Gval ¿ remain unchanged
So, after the 1st iteration Global best solution (Gbest ) and Global best value (Gval ¿ are
Gval=48.342