Back to Study Material Artificial Intelligence

Genetic algorithm

Genetic algorithms are population-based optimization methods inspired by Darwinian natural selection and genetic recombination. Rather than maintaining a s...

Genetic algorithm

Evolution as an Optimization Strategy

Genetic algorithms are population-based optimization methods inspired by Darwinian natural selection and genetic recombination. Rather than maintaining a single candidate solution and refining it, a genetic algorithm evolves a population of candidate solutions over multiple generations, selecting, recombining, and mutating them to produce progressively better offspring.

The algorithm begins by initializing a population of individuals, each encoded as a string of genes — typically a binary string, though real-valued and permutation encodings are also common. Each individual is evaluated by a fitness function that measures how well it solves the problem.

Selection chooses which individuals reproduce. Fitter individuals have a higher probability of being selected, but even weaker individuals may occasionally be chosen, maintaining diversity. Roulette wheel selection and tournament selection are common strategies.

Crossover (recombination) creates new individuals by combining genetic material from two parents. In one-point crossover, a random cut point divides both parent strings, and the two halves are swapped to produce two children. This allows promising partial solutions from different parents to be combined.

Mutation randomly flips genes in an individual with a small probability, introducing new variation that crossover alone cannot produce and preventing premature convergence.

A concrete example: designing the shape of an aircraft wing for maximum aerodynamic efficiency. Each individual in the population encodes wing geometry parameters. The fitness function runs a fluid dynamics simulation and returns the lift-to-drag ratio. Over hundreds of generations, the population converges toward designs with high efficiency scores.

Genetic algorithms are used in circuit design, financial modeling, drug discovery, and game AI. They excel in large, irregular search spaces where gradient information is unavailable.

Exam tip: Know all four genetic algorithm operators — initialization, selection, crossover, mutation — and their roles. Examiners often ask which operator maintains diversity (mutation) and which combines good partial solutions (crossover).