A maximum circle fitting implemented as a genetic algorithm. The algorithm uses the standard roulette wheel selection for the parents. The green circle is the optimal solution, found on a separate thread with an exhaustive search on the problem space.

You can tweak the mutation (probability the gene mutates) and the crossover (probability that two genes pass to the next generation) rates from the dropdown. Hit space to pause/unpause the simulation.