Genetic Algorithm (GA)
Genetic Algorithm (GA)
● Initialize population
● Select parents by evaluating their fitness
● Crossover parents to reproduce
● Mutate the offsprings
● Evaluate the offsprings (Survivor Selection)
● Merge offsprings with the main population and sort
Chromosome, Gene and Population
1. Initialization
Crossover describes the process by which some genes from both parent
chromosomes are overlapped, jumbled together, or swapped to create new
children. Because of the crossing of the parent chromosomes, the offspring
possesses traits from both parents.
3. Crossover
Single-point crossover: In this method, both the parent chromosomes are cut at
the same random point, and the leftover parts are swapped to produce two new
offspring chromosomes.
3. Crossover
Two-point crossover: A method similar to the single-point crossover, but the only
difference is that the parent chromosomes are cut at two random points.
3. Crossover
Swap Mutation
4. Mutation
Scramble Mutation
Inversion Mutation
5. Evaluate the offsprings (Survivor Selection)
The Survivor Selection Policy determines which individuals are to be kicked out
and which are to be kept in the next generation.
Fitness based selection: The children tend to replace the least fit individuals in
the population. (Can be achieved by sorting)
6. Merge Offsprings with the Main Population and Sort
Since the population size remains the same as the first iteration, the number of
individuals at the bottom of the sorted population equal to the number of new
offsprings produced in the previous iteration are eliminated from the selection
process to breed new offsprings.
1. https://pub.towardsai.net/genetic-algorithm-ga-introduction-with-example-
code-e59f9bc58eaf
1. https://www.tutorialspoint.com/genetic_algorithms/genetic_algorithms_survivo
r_selection.htm