The big idea: A genetic algorithm searches for a good solution by imitating evolution.
The cycle
Population
Keep a population of candidates.
Score
Score them.
Combine
Let the best ones combine.
Mutate
Mutate a few.
Repeat
Go round again.
It does not solve the problem. It searches a space too large to check exhaustively.
Where it earns its place
- The search space is far too large to try every option
- There is no formula that gives the answer directly
- But any candidate can be scored — you can tell a good one from a bad one
- A good enough answer is acceptable; the perfect one is not required
- Timetabling, route planning, aerial design, circuit layout
Free preview
This is the free notes preview
You're reading the free notes. Aimnova Pro unlocks the full study experience — and you can try it with your first topic free to keep:
- FlashcardsLock in vocabulary and key terms with spaced repetition.
- Practice questionsAnswer exam-style questions and get instant AI marking.
- Mock exams & past-paper vaultSit full mocks and see exactly how examiners award marks.
- Personalised study planA daily plan built around your exam date and weak areas.
Population
Start with many random candidate solutions, each encoded as a string of values — a chromosome.
Fitness
Score every candidate with a fitness function. This is the one piece you must design, and it decides everything.
Selection
Choose parents, weighted towards higher fitness — but not only the best, or the population loses variety and the search stalls.
Crossover
Combine two parents to make offspring, taking part of each. This is how good partial solutions get recombined.
Mutation
Randomly alter a small number of values. This is what introduces ideas not present in either parent, and what escapes a local optimum.
The cycle on a real problem: the travelling salesperson
| Stage | For a delivery van visiting 30 shops |
|---|---|
| Population | Many random orders in which to visit the 30 shops; each order is a chromosome |
| Fitness function | Total distance of the route: shorter is fitter |
| Selection | Shorter routes are more likely to be chosen as parents |
| Crossover | Take part of one parent's order and fill in the rest from the other, keeping each shop exactly once |
| Mutation | Occasionally swap two shops in a route |
| Evaluation | Work out the fitness (distance) of every new route |
| Termination | Stop after a set number of generations, when a route is short enough, or when routes stop improving |
Crossover and mutation do different jobs: Crossover recombines what the population already has — it explores between existing solutions.
Mutation introduces something genuinely new. Without it the population converges on a blend of its starting material and can never reach anything outside it.
Study smarter, not longer
Most students waste 40% of study time on topics they already know. Our AI tracks your progress and optimizes every minute.
| Setting | Too low | Too high |
|---|---|---|
| Mutation rate | Converges early on a local optimum | Becomes a random search — good solutions are destroyed |
| Population size | Too little variety to recombine | Each generation is slow |
| Selection pressure | Good solutions spread too slowly | The population becomes clones and the search stalls |
The fitness function is the whole design: The algorithm optimises the fitness function exactly — the same failure mode as a reinforcement reward.
Score a timetable only on "no clashes" and it may return one that puts every lesson at 8am. It satisfied what you asked for.
No guarantee of the best answer: A genetic algorithm returns a good solution, not a provably optimal one, and two runs can give different answers.
Saying that is usually worth a mark — it is the honest limitation.
How this is tested — you must name the five stages in order and justify the approach from the size of the search space. It comes up two ways:
Paper 1 Section A
- Describe how a genetic algorithm works, 4-6 marks
- Name the stages of the cycle
- State the role of mutation
Paper 1 Section B — case study
- Justify a genetic algorithm for a scenario
- Explain a limitation of the result
The classic trap: Omitting mutation, or describing it as noise. Crossover only recombines what is already present — mutation is the only source of anything new, and the only escape from a local optimum.
One generation: score, select, cross over, mutate, repeat.
Interactive diagram
Explore the labelled diagram, charts and maps for this topic in full study mode.
A school must build a timetable from thousands of possible arrangements. Describe how a genetic algorithm would approach this, and state one limitation.
Model answer plan
See the answer broken into clear points, with guidance on how each point earns marks.