Breaking Codes with Genetic Algorithms

Learn what premature convergence is and understand its impact by looking at the ciphering example.

What is premature convergence?

The previous two chapters were dedicated to the process of making better populations from an existing population. The chapter Selecting the Best focused on choosing solutions for reproduction that give the best opportunity to increase the overall fitness of our population. The chapter 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 our genetic algorithms. Selection and crossover alone are sufficient for a complete genetic algorithm; we don’t need any additional steps for varying our population if we don’t want to. However, using selection and crossover alone can lead us into a common pitfall: premature convergence.

Premature convergence refers to the stalling of progress in our algorithms due to a lack of genetic diversity in our population. As we saw in the lesson Exploring Selection, over time, populations tend to drift toward a similar genetic pattern. To understand why this can be problematic, consider this sample population of binary chromosomes as shown in the image given below:

Get hands-on with 1200+ tech skills courses.