PyCGA is a simple implementation of Compact Genetic Algorithm (cGA) written in Python. It implements a simple OneMax fitness function and a trap-5, as well as a (very simple and very biased) method of solving the said trap. PyCGA can also plot simple graphs showing how the fitness score and the state of each member inside the probability vector change as our algorithm "evolves".
- matplotlib for graph plotting
- The Compact Genetic Algorithm, by Georges R. Harik, Fernando G. Lobo, and David E. Goldberg
- Compact Genetic Algorithm section from the book: Clever Algorithms: Nature-Inspired Programming Recipes, by Jason Brownlee PhD