Chapter 3 Encoding Problems and Solutions

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

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 What You Learned | TOC | Using Structs to Represent Chromosomes 👉

Not all problems are created equal. Every optimization problem you face will inevitably have a unique set of challenges. However, this doesn’t mean that you should approach every problem differently, as patterns will often arise from one problem to the next.

A key aspect of problem solving is to model problems in a way that makes them easier to understand and thus easier to solve. This might mean translating data into formats that are easier to work with, choosing or creating data structures that simplify solutions, or transforming the problem itself into a form you already know. The steps you take at the beginning when planning your approach to solving a specific problem are vital to finding its solution.

In the previous chapter, you designed a framework for writing genetic algorithms. The framework you designed generalized the steps common to all genetic algorithms. The purpose of this exercise was both to better understand the structure of genetic algorithms and optimization problems and to make it easier for you to write genetic algorithms in the future.

In the process of designing this framework, you separated problem-specific aspects from more general aspects of genetic algorithms. In this chapter, you’ll take a closer look at these problem-specific aspects and 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.