Reviewing Genetic Algorithms

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

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Chapter 2 Breaking Down Genetic Algorithms | TOC | Looking Deeper into Genetic Algorithms 👉

Recall from the previous chapter that genetic algorithms work via a series of transformations on populations of chromosomes over some number of generations. One generation represents one complete series of transformations. Ideally, the population that results from subsequent generations have better solutions than previous ones.

The structure of a genetic algorithm provides a generic framework on which to build. For example, every step in the process takes a population and produces a population for the next step. Because you know what every step expects, you can easily generalize your genetic algorithms to all types of problems. While some parts of the algorithm — such as encoding, evaluation, and termination — pertain only to specific problems, most aspects of a genetic algorithm are common to all problems.

You can use this structure to plan out how your framework will look. You’ll ask yourself questions like: what parts of the algorithm are common to all problems? What parts are unique? How can I best split each step for easy customization? How can I take advantage of Elixir’s features to make my algorithms as idiomatic, customizable, and modular as possible?

Think about these questions as you continue through the rest of this chapter.

--

--

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.