Genetic Algorithms

What are Genetic Algorithms?


How do Genetic Algorithms Work?

  1. The algorithm first creates a random initial population.

  2. 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:

    1. 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.

    2. Scales the raw fitness scores to convert them into a usable range of values, called expectation values.

    3. Selects members, called parents, based on their expectation.

    4. 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.

    5. Replaces current population with the new “children” to form the next generation.

  3. 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.