The Particle Swarm Optimization (PSO) algorithm is a population-based stochastic optimization technique that was developed by Eberhart and Kennedy in 1995. It is inspired by the social behavior of bird flocking or fish schooling and aims to find the optimal solution in a given search space.
The PSO algorithm consists of a swarm of particles, each representing a potential solution in the search space. These particles move through the search space searching for the optimal solution. The movement of particles is guided by their own previous best position and the global best position discovered by the swarm.
Mathematical Formulation:
Let's denote the position of a particle i as xi = (xi1, xi2, ..., xid), where d is the dimension of the search space. Similarly, the velocity of the particle i is denoted as vi = (vi1, vi2, ..., vi d). Each particle has its own best position, called pbesti. The global best position, called gbest, represents the best solution found by any particle in the swarm.
At each iteration, the position and velocity of each particle are updated based on the following equations:
vij(t+1) = ωvij(t) + ϕ1r1*(pbestij(t) - xij(t)) + ϕ2r2(gbestj(t) - xij(t))
xij(t+1) = xij(t) + vij(t+1)
where:
- vij(t+1) is the updated velocity of particle i in dimension j at iteration t+1.
- ω is the inertia weight that controls the trade-off between exploration and exploitation, typically between [0, 1].
- ϕ1 and ϕ2 are the acceleration coefficients that control the particle's tendency to move towards its pbest and gbest, respectively.
- r1 and r2 are random numbers uniformly distributed in [0, 1].
- xij(t+1) is the updated position of particle i in dimension j at iteration t+1.
After updating the position, each particle evaluates the objective function value at its new position. If the objective function value at the current position is better than its previous best value, pbest, it updates its pbest. Additionally, if the objective function value is better than the global best, gbest, the swarm updates gbest accordingly.
The PSO algorithm continues to iterate until a termination criterion is met, such as reaching a maximum number of iterations or reaching a satisfactory solution. The final position of the particles represents the optimal solution found by the algorithm.
In summary, the PSO algorithm uses a swarm of particles to iteratively explore and exploit the search space by updating the position and velocity of each particle based on its previous best and the global best. This process continues until convergence to the optimal solution is achieved.