A random population highest fitness best fitness Instead of a single ball there is a population of 8 individuals; each dot is a candidate solution. They were generated at random and spread over different parts of the landscape. The fitness of the best one is 0.69.
Every individual is a chromosome highest fitness best fitness Every individual is an 8-bit chromosome. The best one, the red dot, is 10111000: in binary these bits are the number 184, which means position x = 7.22 on the landscape. The algorithm works on bits, not positions; the step that turns bits into a position is called decoding.
Choosing parents by tournament highest fitness best fitness A new generation needs two parents. For each parent two individuals are drawn at random and the fitter one wins. In the first tournament 0.45 competed with 0.45 and 0.45 won; in the second 0.24 competed with 0.69 and 0.69 won. Blue dots are the losers, red ones the winners.
Single-point crossover highest fitness best fitness Both parents were cut after bit 2: 00|101001 and 10|111000. The child took the head of the first parent and the tail of the second: 00|111000. The blue dot is the child, x = 2.20, fitness 0.29.
Mutation highest fitness best fitness Each bit of the child is flipped with a small probability. In this child 1 bit changed: 01111000. The child jumped to x = 4.71, fitness 0.68. Mutation brings bits into the population that the parents did not have.
Generation 1 highest fitness best fitness The best individual passes to the new generation unchanged, and the other places fill with children born by selection, crossover and mutation. The best of generation 1 is 10111001, x = 7.25, fitness 0.71. The ball sits on the best individual.
Generation 2 highest fitness best fitness The best individual passes to the new generation unchanged, and the other places fill with children born by selection, crossover and mutation. The best of generation 2 is 10111001, x = 7.25, fitness 0.71. The ball sits on the best individual.
Generation 4 highest fitness best fitness The best individual passes to the new generation unchanged, and the other places fill with children born by selection, crossover and mutation. The best of generation 4 is 11010001, x = 8.20, fitness 0.98. The ball sits on the best individual.
Generation 8 highest fitness best fitness The best individual passes to the new generation unchanged, and the other places fill with children born by selection, crossover and mutation. The best of generation 8 is 11010001, x = 8.20, fitness 0.98. The ball sits on the best individual.
The population reached the global peak highest fitness best fitness After 8 generations the best individual is x = 8.20, fitness 0.98: very close to the top of the global peak. The population looks at many parts of the landscape at once, and crossover combines pieces of distant individuals, so it could find the global peak.