Playing with Particle Swarm Optimisation

Quick study of PSO for a few test functions

I kept seeing PSO being used in papers to minimise paths for manipulators, so I wrote a quick toy script to test it out. Here’s the results with a Sphere function:

Sphere function PSO

PSO with 5 particles acting on a sphere function landscape.

Here’s the results with the Easom function:

Easom function PSO

PSO with 5 particles acting on an Easom function landscape.

And here’s the results with a Cross in tray function:

Easom function PSO

PSO with 5 particles acting on an Easom function landscape.

The Python script used to generate these solutions can be found here - try it out here.