Exploring Selection

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

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Chapter 5 Selecting the Best | TOC | Customizing Selection in Your Framework 👉

Selection is vital to the performance of a genetic algorithm because it contributes to the creation of good solutions for the next generation. The idea is that parents have characteristics that make them strong based on your fitness criteria and will pass these characteristics on to the next generation of solutions.

Consider this: in medieval and early modern Europe, monarchs would carefully select partners to maintain their status as royalty. The idea was based on the assumption that royal blood was stronger and the genes of a commoner would ruin the purity of the bloodline.

Monarchs practiced a loose derivative of selection. They would choose partners based on territory, power, money, and other factors, which essentially amounted to the “fitness” of a potential partner. They hoped that marrying other royals would lead to a strong bloodline and continued success for the royal family.

Unfortunately, the lack of royals to marry outside of preexisting royal families meant that later monarchs often had to “keep it in the family.” A lot of monarchs were forced to marry cousins. While this initially didn’t seem like an issue — both cousins would be royalty and thus strong, after all — as the practice of intermarriage increased, so did the severity of birth defects within the royal family. But, how…

--

--

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.