Chapter 6 Generating New Solutions

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

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 What You Learned | TOC | Introducing N-Queens 👉

In the previous chapter, you learned about selection — the process of choosing parents for reproduction. Selection is important; however, you now need to decide what to do with your pairs of parents.

In Chapter 1, Writing Your First Genetic Algorithm, you learned about the need to balance exploitation and exploration. Recall that exploitation is the process of using the information you have available, while exploration is the process of searching for new information. You exploit the environment to find your objective — like using the sun as a guide to navigate out of the woods. You explore the environment in search of better clues — like trying to find new roads or paths that lead you to your objective.

Crossover is how genetic algorithms exploit information. If you recall from Chapter 4, Evaluating Solutions and Populations, different chromosomes have different schemas that make them better or worse than others. Crossover strategies attempt to combine schemas in an intelligent manner to create new, better solutions.

In this chapter, you’ll see what crossover is and why it’s important. You’ll learn about different types of crossover and how to implement them. Finally, you’ll see some problems crossover might cause and learn how to fix them. Before you begin, you’ll start with an example of why you…

--

--

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.