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 evolving a population of candidates. Inspired by biological evolution, it combines variation and selection: better candidates are more likely to contribute to later generations, while mutations introduce changes. Over repeated generations, the population can improve. section 4.1

Think of a population as several searchers exploring different parts of a landscape. This can help when a problem has local optima—solutions that look good nearby but are not the best overall. The trade-off is computational cost: evaluating many candidates over many generations can be expensive. section 4.2

A basic evolutionary search follows a repeating cycle:

  • Generate a diverse population of candidate solutions. section 4.1
  • Evaluate the candidates against the problem’s goal and select better-performing ones. section 4.1 section 4.2
  • Create a new generation through reproduction and mutation, then repeat the process. section 1.20 section 4.1

Choosing items for a knapsack

A knapsack holds at most 9 kg. Each candidate is a choice of items, and the goal is to maximize their total value without exceeding the weight limit. Items 1, 4, and 6 weigh 8 kg and are worth $8; items 1, 3, and 7 weigh 9 kg and are worth $14. Items 2, 3, and 6 are worth $15 but weigh 15 kg, so they are invalid. An evolutionary search can explore many such combinations and favor valuable choices that meet the constraint. 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

Use the item weights and values to check the knapsack candidates or try other combinations. section 4.2

A genetic algorithm is one kind of evolutionary algorithm. Its techniques include encoding candidates, selection, crossover, and mutation. Applications include selecting useful features for machine learning, evolving circuit configurations, and generating molecular structures for simulation. section 4.0 section 4.21 section 5.23

How Grokking AI Algorithms, Second Edition covers it

How deep it goes
Explains population search, reproduction, mutation, and selection, then identifies encoding and crossover as further techniques.
Examples
Uses peppered moth adaptation and a weight-constrained knapsack to illustrate selection and optimization.
What you can do after
Apply evolutionary algorithms to optimization problems in other domain contexts.
How it connects
Connects evolutionary algorithms to genetic algorithms, swarm intelligence, machine learning, and artificial neural networks.

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.