Intelligent Systems II · TEE · read
Read the PSO equation and work three individual updates
4. Particle swarm optimization
First understand position, velocity and memory; then solve complete two-iteration minimisation examples.
First read the update in words
New velocity = retained old velocity + pull toward personal best + pull toward the group best. After finding that velocity, add it to the old position. You are calculating a movement, then applying it.
Example: current x=4 and personal best=1 gives the difference 1−4=−3. A coefficient of .5 gives personal pull .5×(−3)=−1.5. The negative sign says “move left”; it does not mean a negative probability. If current x=−2 and best=1, the difference is 1−(−2)=1+2=3, which pulls right.
In vi,jt, i chooses the particle, j chooses its coordinate, and t chooses the recorded iteration. For particle B, coordinate 2, iteration 0, look at row B and the second velocity entry in the initial table. The letters identify a stored number; they are not extra multiplication factors.
The velocity equation is three contributions added together
v_{i,j}^{t+1}=w v_{i,j}^{t}+c_1r_1(pbest_{i,j}^{t}-x_{i,j}^{t})+c_2r_2(gbest_j^{t}-x_{i,j}^{t})x_{i,j}^{t+1}=x_{i,j}^{t}+v_{i,j}^{t+1}| Symbol | Meaning |
|---|---|
| i | Which particle |
| j | Which coordinate of that particle |
| t / t+1 | Before / after this iteration; these are labels, not powers |
| w | Inertia weight: how much old velocity is kept |
| c₁r₁ | Combined strength of the pull to personal best |
| c₂r₂ | Combined strength of the pull to global best |
| r₁,r₂ | Random factors, normally in [0,1]; use the values supplied in an exam |
A best position to the left gives a negative difference and pulls left; a best position to the right gives a positive difference and pulls right. The multiplication sets the strength of each pull.
For one coordinate, x=4, v=0, pbest=4, gbest=2. With w=0.5, c₁=c₂=1 and r₁=r₂=0.5, find the next velocity and position. [3 marks · Practice]
Given
x=4, v=0, pbest=4, gbest=2; w=.5; c₁r₁=.5; c₂r₂=.5.
To find
New velocity followed by new position.
Formula and why it applies
Use the three-term velocity equation, then add the new velocity to x.
v_{new}=0.5v+0.5(pbest-x)+0.5(gbest-x)Solution
Step 1. Inertia
0.5\times0=0Step 2. Personal pull
0.5(4-(4))=0Step 3. Social pull
0.5(2-(4))=-1Step 4. New velocity
v_{new}=0+0+(-1)=-1Step 5. New position
x_{new}=4+(-1)=3For one coordinate, x=4, v=-2, pbest=3, gbest=1. With w=0.5, c₁=c₂=1 and r₁=r₂=0.5, find the next velocity and position. [3 marks · Practice]
Given
x=4, v=-2, pbest=3, gbest=1; w=.5; c₁r₁=.5; c₂r₂=.5.
To find
New velocity followed by new position.
Formula and why it applies
Use the three-term velocity equation, then add the new velocity to x.
v_{new}=0.5v+0.5(pbest-x)+0.5(gbest-x)Solution
Step 1. Inertia
0.5\times(-2)=-1Step 2. Personal pull
0.5(3-(4))=-0.5Step 3. Social pull
0.5(1-(4))=-1.5Step 4. New velocity
v_{new}=(-1)+(-0.5)+(-1.5)=-3Step 5. New position
x_{new}=4+(-3)=1For one coordinate, x=-2, v=1, pbest=-1, gbest=1. With w=0.5, c₁=c₂=1 and r₁=r₂=0.5, find the next velocity and position. [3 marks · Practice]
Given
x=-2, v=1, pbest=-1, gbest=1; w=.5; c₁r₁=.5; c₂r₂=.5.
To find
New velocity followed by new position.
Formula and why it applies
Use the three-term velocity equation, then add the new velocity to x.
v_{new}=0.5v+0.5(pbest-x)+0.5(gbest-x)Solution
Step 1. Inertia
0.5\times1=0.5Step 2. Personal pull
0.5(-1-(-2))=0.5Step 3. Social pull
0.5(1-(-2))=1.5Step 4. New velocity
v_{new}=0.5+0.5+1.5=2.5Step 5. New position
x_{new}=(-2)+2.5=0.5First-iteration shortcut: if pbest was just initialised to x, the personal difference is zero. This follows from the initialisation; it is not a permanent property of PSO. A gbest particle can still move because its inertia term can be nonzero.
Yaad rakho: Old speed ka hissa + apne best ki pull + group best ki pull; phir new speed ko position mein add.