The main stages of the basic genetic algorithm flow are shown in the following flowchart:
![](https://static.packt-cdn.com/products/9781838557744/graphics/assets/cbbfbc4b-9b8d-437f-82e4-71e595a34d2d.png)
Basic flow of a genetic algorithm
These stages are described in detail in the following sections.
The main stages of the basic genetic algorithm flow are shown in the following flowchart:
These stages are described in detail in the following sections.
The initial population is a set of valid candidate solutions (individuals) chosen randomly. Since genetic algorithms use a chromosome to represent each individual, the initial population is actually a set of chromosomes. These chromosomes should conform to the chromosome format that we chose for the problem at hand, for example, binary strings of a certain length.