liveBook · Manning

Evolutionary computation

As explained in Grokking AI Algorithms, Second Edition

A population-based algorithmic technique that iteratively improves candidate solutions through variation and selection inspired by biological evolution.

Evolutionary computation searches for good solutions by working with a population of candidates rather than following one candidate at a time. Like biological evolution, it produces variation, favors candidates that fit their environment better, and repeats over generations. In computing, that “environment” is the problem the candidates must solve. section 4.1 section 4.2

It is especially useful for optimization problems with many possible valid answers, where some answers are better than others. A population can explore several areas of the solution space when a single searcher might get trapped at a local optimum. The trade-off is computational expense. section 4.2

The basic cycle is:

  • Generate diverse candidate solutions. section 4.1
  • Select candidates that perform better on the problem. section 4.1
  • Produce new variants through reproduction and mutation, then repeat across generations. section 1.20 section 4.1

Packing a knapsack

Suppose a knapsack holds at most 9 kg, and eight available items have different weights and values. Each choice of items is a candidate solution. Choosing items 1, 3, and 7 gives a valid 9 kg load worth $14; choosing items 2, 3, and 6 gives $15 but weighs 15 kg, so it breaks the limit. Evolutionary search aims to find high-value choices that also meet the constraint. Even this small puzzle has 256 possible item combinations. section 4.2

Table 4.1 Knapsack weight capacity: 9 kg

Item ID

Item name

Weight (kg)

Value ($)

1

Pearls

3

4

2

Gold

7

7

3

Crown

4

5

4

Coin

1

1

5

Axe

5

4

6

Sword

4

3

7

Ring

2

5

8

Cup

3

1

The item weights and values make the knapsack’s competing goals—high value and limited weight—concrete. section 4.2

The same approach can search over machine-learning feature choices, electronic circuit configurations, or molecular structures. Genetic algorithms are one evolutionary approach; encoding, crossover, mutation, and selection are techniques for adapting them to different problems. section 4.21 section 5.23

How Grokking AI Algorithms, Second Edition covers it

How deep it goes
Explains variation, selection, and repeated generations, while naming genetic-algorithm techniques without detailing their implementation in the supplied evidence.
Examples
Illustrates adaptation with peppered moths and optimization with an eight-item, 9 kg knapsack.
What it assumes
Builds intuition from natural selection and a small knapsack puzzle before pointing to machine-learning applications.
What you can do after
Evaluate/understand it by recognizing suitable optimization problems and weighing population-based exploration against computational expense.
How it connects
Connects natural selection and optimization to genetic algorithms, swarm intelligence, and machine-learning feature selection.

Also explained in

Compare how 3 books explain evolutionary computation →

Related concepts

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