Understanding and Choosing Genotypes

One of the most important decisions you can make when using a genetic algorithm is the type of encoding you use to represent solutions. Encodings are simply representations of a single solution. A good encoding needs to contain only the information necessary to represent a complete solution to a problem. If a solution is a path through a grid, an encoding of a solution would only need to contain the coordinates of each gridpoint it passes through.

The type of encoding scheme you use is known as a genotype. The genotype of a chromosome tells you what the chromosome should look like. It defines your search space. For example, if you’re trying to create an optimal shipping route through fifteen cities, your ...

Get Genetic Algorithms in Elixir now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.