Chapter 5 Selecting the Best

Genetic Algorithms in Elixir — by Sean Moriarity (43 / 101)

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 What You Learned | TOC | Exploring Selection 👉

In the last chapter, you learned how to evaluate solutions using fitness functions. Remember, fitness functions measure the viability of a solution. Fitness functions are an important aspect of your genetic algorithm, but they mean nothing if you don’t do anything with them. With your population evaluated, and each chromosome assigned a fitness, it’s time to perform selection.

If you’ve ever been on a team, you understand the importance of having the right people. Whether it be in sports, music, work, or any collaboration, choosing the right people to fill positions and complement other members is vital to the success of the organization. This idea of selecting the right people to fill the right roles directly correlates to selection in genetic algorithms.

Selection is the first genetic operator in an evolution. On the surface, selection is responsible for choosing chromosomes that will reproduce in the next step. At its core, selection is responsible for ensuring the next generation of chromosomes is even stronger than the last.

Charles Darwin’s theory of evolution suggests that strong traits that are key to survival become more common in successive generations. Whether you believe in evolution or not, the idea of natural selection is a key aspect of genetic algorithms.

--

--

The Pragmatic Programmers
The Pragmatic Programmers

We create timely, practical books and learning resources on classic and cutting-edge topics to help you practice your craft and accelerate your career.