Visualization of a genetic algorithm!

Y-axis: Scaled Full range Node sorting: Fitness Size Height Index Node colors: Fitness Size Height

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.

This work has been done with the help of gpcxx a modern C++ library for genetic programming which has produced the data for the above graphic. The development of this library is still in an early stage. The visualization has been done with the help of d3.js a great javascript framework of interactive visualizations. The graphic as been inspired by Sankey diagrams and the Sankey plugin for d3 js. jquery has also been used for general purpose stuff.

If you need help with visualization of data or algorithms or optimization algorithms in general just drop me a message here.