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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.