Skip to content
Swarm intelligence optimizer
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
build/lib/swarmopt Method overriding for variations Jun 27, 2018
media Tidy up for scoreboard development May 30, 2018
swarmopt Update Oct 24, 2018
.gitignore Move untested code out of the way; get basic tests passing Jun 5, 2018 Create May 30, 2018 Update Jun 11, 2018
requirements.txt Move untested code out of the way; get basic tests passing Jun 5, 2018 Test covered first optimizer and scoreboard Jun 15, 2018



SwarmOpt is a library of swarm intelligence optimizer built from several PSO variations.

Swarm intelligence leverages global population-based search solutions to balance exploration and exploitation with respect to specified cost functions. There are many exciting nooks and crannies to explore in the SI ecosystem, yet I've chosen to kick things of with some Particle Swarm Optimization (PSO) algorithms, as they are easy to understand and fiddle with. The PSO lineage was sparked by Eberhart and Kennedy in their original paper on PSOs in 1995, and the intervening years have seen many variations spring from their central idea.


To install SwarmpOpt, run this command in your terminal:

$ pip install swarmopt


  • Global Best PSO - Kennedy & Eberhart 1995
  • Local Best PSO - Kennedy & Eberhart 1995
  • Unified PSO - Parsopoulos & Vrahatis 2004
  • Dynamic Multi-Swarm PSO - Liang & Suganthan 2005
  • Simulated Annealing PSO - Mu, Cao, & Wang 2009

Benchmark Functions

Single objective test functions:

  • Sphere Function
  • Rosenbrock's Function
  • Ackley's Function
  • Griewank's Function
  • Rastrigin's Function
  • Weierstrass Function

On Deck

  • Cooperative Approach to PSO (CPSO)(multiple collaborating swarms)
  • Proactive Particles in Swarm Optimization (PPSO) (self-tuning swarms)
  • Inertia weight variations
  • Mutation operator variations
  • Velocity clamping variations
  • Multiobjective variations
  • Benchmark on something canonical like MNIST


  • Neural network number of layers and weight optimization
  • Grid scheduling (load balancing)
  • Routing in communication networks
  • Anomaly detection


Siobhán K Cronin, SwarmOpt (2018), GitHub repository,

You can’t perform that action at this time.