(1) initialise population;
(2) evaluate population;
(3) while (!stopCondition) do
(4)  select the best-fit individuals for reproduction;
(5)  breed new individuals through crossover and mutation operations;
(6)  evaluate the individual fitness of new individuals;
(7)  replace least-fit population with new individuals;
Algorithm 1: Generic pseudocode of a genetic algorithm.