This is a simple tutorial to implement a basic particle swarm optimization algorith in Python in under 100 lines using only Python standard libraries.
Refer to particle-swarm-tutorial.ipynb
for the tutorial. If you want to jump right away into the code, code/particle_algorithm_uc.py
is the uncommented code and code/particle_algorithm.py
is the commented code.