liveBook · Manning

Genetic algorithm

As explained in Inside AI

A genetic algorithm is an optimization technique that evolves a population of candidate solutions through evaluation, selection, recombination, and random variation.

Finding an efficient delivery plan can mean comparing many routes, schedules, and resource allocations. A genetic algorithm searches for a good combination by repeatedly testing and changing candidate solutions. It is an optimization technique inspired by natural selection, not a way to guarantee the best possible answer. section 2.5

The search proceeds in generations:

  • Start with a population of possible solutions and evaluate each one against chosen measures, such as delivery time and cost. section 2.5
  • Select better-performing solutions and combine parts of them through crossover. For example, pair one plan’s faster route with another’s resource allocation. section 2.5
  • Occasionally make a random change, called mutation, to explore another option. Repeat with the new population until improvement stops or a set number of cycles has passed. section 2.5
Table 2.2 Complexity of the genetic algorithm for the school bus route example
Number of locations to visit
Number of possible routes to compare
1
1
2
2
3
6
4
24
10
3,628,000
20
2,432,902,008,176,640,000

The school-bus route table shows why comparing every possibility becomes difficult: ten locations have 3,628,000 possible routes, while twenty have more than two quintillion. section 2.5

The useful result depends on how candidates are evaluated: a plan judged only on speed may not meet a cost goal. Genetic algorithms can also play one part in a larger system; a proposed fraud-prevention combination uses them to optimize model parameters alongside other AI techniques. section 2.5 section 11.7

How Inside AI covers it

How deep it goes
Walks through evaluation, selection, crossover, mutation, and stopping conditions without code or formal equations.
Examples
Illustrates candidate solutions with delivery routes and resource allocations, then tabulates the number of possible school-bus routes.
What it assumes
Introduces population, fitness evaluation, selection, crossover, and mutation through a familiar planning problem without requiring prior algorithm knowledge.
What you can do after
Evaluate/understand it as a way to search delivery plans or optimize model parameters, with progress judged against chosen measures.
How it connects
Connects natural selection to optimization and places genetic algorithms alongside data mining, fuzzy logic, and deep learning in combined AI systems.

Also explained in

Compare how 7 books explain genetic algorithm →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Inside AI. The section links point to the parts of the book it draws on.