Particle Swarm Optimization: Pbest Gbest
Particle Swarm Optimization: Pbest Gbest
𝑉𝑖,𝑗 (t + 1) = 𝑤 𝑉𝑖,𝑗 (t) + 𝑟1 𝑐1 [Pbest 𝑖,𝑗 (t) − 𝑋𝑖,𝑗 (t)] + 𝑟2 𝑐2 [Gbest(t) − 𝑋𝑖,𝑗 (t)] (1)
The leader particle in each generation guides other particles to move towards the
optimal positions. The performance of each particle in the swarm is evaluated
according to objective function or the fitness function of the optimization problem.
Step 2: Assume the local best particles set equals to the positions set such
as: 𝑃𝑏𝑒𝑠𝑡 𝑖, 𝑗 = 𝑋 𝑖, 𝑗 and evaluate the fitness value of each particle
F(x)𝑖, 𝑗 (the fitness value measured in different ways according to
problem) and then take the better value (either maximum or
minimum) from this set to be the global best position (Gbest) called
the leader.
Step 3: Update the particle’s velocity according to equation (1) and then
update the particle’s position according to equation (2).
Step 4: Evaluate the fitness value of each particle with the new position and
compare the current fitness value with the previous position, if the
current is better, replace the 𝑃𝑏𝑒𝑠𝑡 with F(x): 𝑃𝑏𝑒𝑠𝑡 𝑖, 𝑗 = F(x)𝑖, 𝑗, else
𝑃𝑏𝑒𝑠𝑡 𝑖, 𝑗 (t+1) = 𝑃𝑏𝑒𝑠𝑡 𝑖, 𝑗 (t).
Step 5: If t = Tmax then stop and return the solution, else go to step 3.