Particle swarm optimization implementation

To locate a minimum of Himmelblau's function using particle swarm optimization, we've created a Python program called 03-pso-himmelblau.py, which is located at https://github.com/PacktPublishing/Hands-On-Genetic-Algorithms-with-Python/blob/master/Chapter12/03-pso-himmelblau.py.

The following steps describe the main parts of this program:

  1. We start by setting various constants that will be used throughout the program. First is the dimensionality of the problem at hand two, in our case which, in turn, determines the dimensionality of the location and velocity of each particle. Next comes the population size the total number of particles in the swarm, and the number of generations, or iterations, ...

Get Hands-On Genetic Algorithms with Python now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.