Genetic Algorithms

Learn all about genetic algorithms and their applications.

We'll cover the following

As we’ve said, genetic algorithms mimic evolution. These algorithms almost literally emulate the biological process.

DNA molecules are the building blocks of life. They’re formed by four different types of components that we’ll call A, C, T, and G. We can think of DNA as a sequence of these four letters. A little change in this sequence (changing one of the letters for others) is called a mutation, and can have an enormous impact on the individual.

For example, cancer is provoked by mutations. But mutations are also responsible for the lifeforms we can see today, including ourselves. Mutations are responsible for evolution.

A new individual (plant, cell, human, etc.) has one part of the DNA of each of its progenitors. In this new individual, both progenitors’ DNA segments coexist and are combined to create a unique new chain and, therefore, a unique new life.

In genetic algorithms, we’re going to incorporate these two operations: the mutation in one solution and the crossover of two solutions to create a new one.

Evolution defends the theory that those individuals that had advantageous mutations, prevailed (survived until our days). In the same way, in genetic algorithms, the best solutions are preserved for the next iterations. To assess the quality of a solution, we use a score or fitness function. This strategy of preserving the best solutions (the solutions with higher values in the score function) for the next generations is called elitism.

Let’s explore the details of genetic algorithms.

Get hands-on with 1200+ tech skills courses.