Particle swarm optimization: the simplest what and how

11Nov

While there exist many introductory materials on Particle Swarm Optimization (PSO), it is best to have an intuitive example, simple, understandable at first reading, and illustrative. I personally do not like those examples that try to bring all intricacies together. Here comes the simplest example I guess: to find a minimum for the function:

It is know that the optimal solution is found when x=-1, and the minimum is f(x)=0;

The below video demonstrate the results of finding this optimal solution using PSO based approach:

As you can see, after some initial random movements of the design variables, the design variable gradually converges to x=-1 (the black curve) and the optimal value reaches 0.

The basic procedures to implement this PSO based approach are as follows:

[1] Create a collection of particles, each particle represents an instance of the design variable. In this case, the design variable is a scalar-valued single parameter: