Why do particles in particle swarm optimization converge to the global best when their personal best has just as much weight? I know this is probably a really basic question but I just cant wrap my head around it right now.
So the basic PSO update formula is as follows:
$$\bar{v}_{n+1} = \omega \cdot \bar{v}_n + c_k \cdot r_1 \cdot (\bar{p}_{best}-\bar{p}_n)+ c_s\cdot r_2 \cdot (\bar{g}_{best}-\bar{p}_n) $$
velocity(n+1) = momentum_component + cognitive_component + social_component
Now both the cognitive part and the social part have the same weight to them on the updated velocity.
So when a particle is moving around the space and lets say the cognitive part pulls the particle in a certain direction while the social component pulls the particle in the opposite direction, shouldnt the particle be stuck forever? Or at least go back and forth never converging?
However if I run the basic vanilla PSO algorithm the particles always seem to converge to the gbest as if their pbest has barely any influence.
The random number biases distance along the vectors, so it changes per update helping in escaping local optimum, and the global best also changes during the algorithm, if you really want some of these answers try programming a visual particle system using PSO.