Visualization of a genetic algorithm!
Genetic algorithms (GA) are one of the standard optimization methods. They work by evolving a population of trial solutions towards better solutions using biological inspired genetic operators. The trial solutions are also called individuums. The above graphics shows the evolution of a particular genetic algorithm - genetic programming - solving a problem of symbolic regression. It shows beautifully how the GA optimizes the problem. The above graphic can be used for visual debugging. Furthermore, it uncovers the beauty of a complex algorithm.
- The evolution of 12 generations each consisting of 256 individuums is shown.
- The link colors encode the genetic operator. Red is elite, blue is mutation, green is crossover and yellow reproduction.
- The y-position of the nodes can encode the fitness, the size, or the height of the according individuum. And the position of the y-node can describe either the absolute value of the fitness, the size, or the height or the sequence in the population.
- The node colors can describe the fitness, the size, or the height of the individuum.
- The history of a individuum, hence all its ancestors and the genetic operators used to create the individuum can be highlighted by moving the mouse over a specific individuum.
Conclustions from the graphic:
- The convergence of the genetic algorithm can be seen. In this example it is rarely good. The software for the genetic programming is still in an early beta phase.
- Mutation is not very effective and results often in bad individuals.
- Size grows during evolution, a hint for bloat.
- Height grows during evolution, a hint for bloat.
- Most individuums have the same ancestors.
If you need help with visualization of data or algorithms or optimization algorithms in general just drop me a message here.