Chapter 7 Preventing Premature Convergence
Genetic Algorithms in Elixir — by Sean Moriarity (56 / 101)
👈 What You Learned | TOC | Breaking Codes with Genetic Algorithms 👉
The previous two chapters were dedicated to the process of making better populations from an existing population. Chapter 5, Selecting the Best, focused on choosing solutions for reproduction that give you the best opportunity to increase the overall fitness of your population. Chapter 6, Generating New Solutions, focused specifically on the process of creating new solutions.
Correctly applying selection and crossover on populations is vital to the success of your genetic algorithms. Selection and crossover alone are sufficient for a complete genetic algorithm — you don’t need any additional steps for varying your population if you don’t want to. However, using selection and crossover alone can lead you into a common pitfall: premature convergence.
Premature convergence refers to the stalling of progress in your algorithms as a result of a lack of genetic diversity in your population. As you saw in Chapter 5, Selecting the Best, over time, populations tend to drift toward a similar genetic pattern. To understand why this can be problematic, consider this small population of binary chromosomes as shown in the image.