Skip to main content

Genetic Algorithms: Introduction

Source: Unit 5 §1

A genetic algorithm is a metaheuristic, search-based optimisation technique inspired by genetics and natural selection - Darwin's survival of the fittest, turned into a loop. It was introduced for problem solving by Professor John Holland in 1965, and it finds optimal or near-optimal solutions to problems that would otherwise take a lifetime to solve exactly.

Exam cueThe one-line reason GAs work

A GA considers multiple points in the solution space simultaneously. That global perspective is what lets it avoid local optima, and it is the answer to almost any "why use a GA?" question.

The connection to optimisation

The set of all possible solutions is the search space, and somewhere in it sits the optimal point (or points). A GA's aim is to find that point.

FactsWhat a GA is allowed to know
  • It uses only the objective function. No derivatives, no gradients, no auxiliary knowledge.
  • Consequently it can handle functions that are non-smooth, non-continuous and non-differentiable - which describes most real problems.

Why bother

NeedExplanation
Solving difficult problemsMany problems are NP-hard; even powerful systems would take years to solve them exactly.
Failure of gradient methodsTraditional gradient methods work on unimodal (single-peaked) functions, but get stuck in local optima on multimodal ones.
A good solution, fastProblems like TSP, path finding and VLSI design need a good-enough answer quickly, not a perfect answer eventually.
xf(x)global optimumlocal optimumgradient descent stops hereblue dots = one generation of the population, evaluated in parallel
A gradient method climbs the hill it happens to start on. A GA holds a population of points across the whole landscape, so the global peak is inside its field of view from the first generation.
GotchaRead the promise carefully: optimal or near-optimal

The notes say a GA finds "optimal or near-optimal" solutions, and the second half of that phrase is doing real work. The global perspective is what lets a GA escape local optima that trap a gradient method; it is not a proof that the point it returns is the global best. Quote the phrase in full.

0%0 of 70 pages studied