Search code examples
matlabparticle-swarmcollective-intelligence

Particle Swarm Optimization: what means gBest value?


I am designing a Particle Swarm Optimization simulator for MATLAB and I have a doubt about the gBest local position.

As I understood reading about the algorithm, gBest value identify the global best value that has EVER discovered by the particles. However, I saw in a pretty bearable implementation that the developer considered gBest as the best value encountered by the particles in the CURRENT generation.

Have I misunderstood the PSO algorithm basics? Was the developer wrong in his implementation or, however, was it just another different approach?

Thanks in advance, Víctor.


Solution

  • There are many ways to fine tune the PSO , but the classical algorithm of the PSO uses gBest as the swarm best known position, therefore it is not from current iteration only. In your algorithm you have to implement a memory of some sort in order to calculate the delta used in the velocity update:

    delta

    Note that I called pbest as the particle best known position and sbest the swarm best known position (your gBest). c1 and c2 are the confidence levels in the particle itself and in the swarm.