Back to posts
Genetic Algorithm [GA]

Genetic Algorithm [GA]

Niket Girdhar / July 30, 2024

GAs are a class of optimization algorithms which are based on genetics and the process of natural selection. These are also known as Evolutionary Algorithms and generally generate high quality solutions.


Key terms/concepts in GAs:

  • Population: A set of potential solutions to a problem. This set tends to evolve over iterations also called generations.

  • Chromosome: Each individual function is called a chromosome and are often encoded as a string of bits, numbers or characters.

  • Fitness function: A function that helps evaluate and assign a fitness score to each chromosome based on how fit the solution is for the problem.

  • Selection: It is the process of choosing chromosomes from the current population set to create a new set for the next iteration of algorithm. Commonly used selection methods are tournament selection, roulette wheel selection and rank-based selection.

  • Crossover: It is also known as recombination and is an operator that combines two parent chromosomes to produce child chromosomes. Types of crossover include single-point, multi-point and uniform crossover.

  • Mutation: An operator that introduces minor random changes to the chromosomes. It helps the algorithm to prevent getting stuck with a optimized solution in just one set and not the overall optimized solution.

  • Termination Condition: Condition that checks if the solution satisfies the objective i.e. is optimized.

  • Generation: Each cycle of GA which involves the process of selection, crossover and mutation to produce a new population is called generation.


Applications:

  • Optimization problems like Travelling Salesperson Problem.
  • Machine Learning
  • Finding design optimization based on the entered specifics
  • In drug discovery, genetic alignment and other biology fields
  • In evolving AI behaviors

Advantages of GA:

  • Real-life data input is easier in GAs as compared to some of its competitor algorithms
  • Its implementation is quite easy
  • It is fast as compared to most optimization algorithms out there