PSO Algorithm¶
- Let $x_{i}$ be a particle's current position.
- Let $v_{i}$ be a particle's current velocity.
- Let $pbest_{i}$ be a particle's best position.
- Let $Nbest$ be a particle's neighborhood's best position.
- If the neighborhood is the whole swarm, the best position is called the global best: $gbest_{i}$ or $p_{g}$.
- If the neighborhood is restricted to few particles, the best position is called the local best: $lbest_{i}$ or $p_{l}$.
Motion Equations¶
$$
\begin{aligned}
v_{t + 1}^{id} &= w \ast v_{t}^{id} + c_{1}r_{1}^{id} (pbest_{t}^{id} - x_{t}^{id}) + c_{2}r_{2}^{id} (Nbest_{t}^{id} - x_{t}^{id}) \\
x_{t + 1}^{id} &= x_{t}^{id} + v_{t + 1}^{id}
\end{aligned}
$$
- $w$ is the inertia weight.
- $c_{1}$ and $c_{2}$ are the acceleration coefficients.
- $r_{1}$ and $r_{2}$ are randomly generated numbers in $[0, 1]$.
- Generated for each dimension and not for each particle.
- $t$ is the iteration number.
- $i$ and $d$ are the particle number and the dimension.
Interpretation of Motion Equations¶
- Inertia: $w \ast v_{t}^{id}$
- A particle cannot suddenly change its direction of movement.
- Cognitive Component: $c_{1}r_{1}^{id} (pbest_{t}^{id} - x_{t}^{id})$
- $c_{1}$ makes a particle trust its own experience.
- Social Component: $c_{2}r_{2}^{id} (Nbest_{t}^{id} - x_{t}^{id})$
- $c_{2}$ makes a particle trust the swarm experience.
Synchronous Update¶
- Initialize the swarm.
- While the termination criteria is not met,
- For each particle,
- Update the particle's velocity.
- Update the particle's position.
- Update the particle's personal best.
- Update the $Nbest$.
Asynchronous Update¶
- Initialize the swarm.
- While the termination criteria is not met,
- For each particle,
- Update the particle's velocity.
- Update the particle's position.
- Update the particle's personal best.
- Update the $Nbest$.