What are Genetic Algorithms?
How do Genetic Algorithms Work?
The algorithm first creates a random initial population.
A sequence of new populations is creating on each iteration, with the genetic algorithm deciding what gets to “reproduce” and what is culled. To decide, the algorithm performs the following steps:
Scores each member of the current population by computing its fitness value, based upon a pre-defined fitness function, and generates a raw fitness score.
Scales the raw fitness scores to convert them into a usable range of values, called expectation values.
Selects members, called parents, based on their expectation.
Produces children from the parents. Children are produced either by making random changes to a single parent, a mutation, or by combining the vector entries of a pair of parents, called a crossover.
Replaces current population with the new “children” to form the next generation.
The algorithm repeats until one of the stopping criteria is met.
Three types of children can be created with this approach:
Elite children—individuals in the current generation with the best fitness values
Crossover children—created by combining the vectors of a pair of parents.
Mutation children—created by introducing random changes to a single parent.