...

/

Looking Deeper into Genetic Algorithms

Looking Deeper into Genetic Algorithms

Learn about the components and processes involved in designing the structure of a genetic algorithm.

The genetic algorithm structure

Based on what we’ve learned so far, we can understand that every genetic algorithm follows the same basic steps. While algorithms for different problems may use different techniques, probabilities, or strategies, they all share the same structure. As programmers, we want to take advantage of this.

One of the golden rules of programming is “Don’t Repeat Yourself (DRY),” which essentially boils down to not rewriting unnecessary code. We can exploit the shared structure of genetic algorithms to avoid rewriting code that remains the same from algorithm to algorithm. Unfortunately, we have to start from scratch.

So how do we go about designing a versatile framework from the ground up? Start with the basics. All genetic algorithms follow the same structure. They all use chromosomes and populations, and they all require similar inputs. We can use this to our advantage and begin designing from the ground up.

Chromosomes and populations

...
Access this course and 1400+ top-rated courses and projects.