Put 100 cities in random order and the tour that visits them is about eight times longer than the best one. Repeatedly reverse whichever stretch of the tour shortens it most, and the tour shrinks quickly, then stops, typically about 7% too long. No single reversal helps any more, although shorter tours exist. This topic explains how a search that improves at every step gets stuck in this way, and what it can do about it.
Local search is the family of methods that keep one candidate solution and repeatedly replace it with a better one nearby. It needs three things:
- a way to represent a candidate;
- a neighborhood that says which candidates count as nearby;
- an objective that scores them.
A hill climber moves to a better neighbor until no neighbor is better. The method is old, simple, and often effective. It is the right place to start a course on evolutionary computation, because the mutation step of an evolutionary algorithm is itself a local search. Much of the field's machinery exists to fix the problem that hill climbing makes obvious: a search that only moves uphill stops at the first peak it reaches, whether or not that peak is the highest.
This topic treats local search on its own terms, before populations enter the picture, in three steps:
- The method and how it fails. The variants of hill climbing, and the shapes of search space that stop them: local optima, plateaus, and ridges.
- The remedies. Sideways moves, random restarts, simulated annealing, tabu search, and iterated local search, each trading some speed for a better chance of a good solution.
- An application. Hill climbing on two classic puzzles, the course's first assignment, measured over many runs.
Three examples run through the unit: the 100-city tour kroA100 from the TSPLIB library, a one-dimensional fitness landscape of 61 states small enough to analyze exactly, and the 8-queens puzzle. The unit builds on fitness landscapes, which defines neighborhoods, local optima, and basins of attraction.
Articles
- Hill climbing: specifies exactly what a hill climber does and establishes where it stops. Four variants, traced on a small grid and measured on kroA100; local optima, plateaus, and ridges; and the (1+1) evolutionary algorithm as a hill climber with a global mutation operator.
- Escaping local optima: sets out the ways a search can leave a local optimum and measures them against one another. The remedies are compared at equal evaluation budgets on kroA100, where the leader depends on the budget and on what a step costs, and a population is described as another answer. Includes the Boltzmann distribution behind annealing, Hajek's cooling condition worked exactly, a traced tabu search, and an interactive comparison of hill climbing and annealing.
- Hill climbing on 8-queens and the 8-puzzle: shows why the same hill climber solves one puzzle and almost never the other. The course's first assignment is stated and answered in full as a reproducible experiment: success rates, sideways moves and restarts on 8-queens, and the plateaus and local minima that defeat hill climbing on the 8-puzzle. Includes worked boards, traced runs that succeed and that stop, and an interactive 8-queens board.
Related topics
Local search moves across a fitness landscape, and the shape of that landscape decides whether it succeeds. In information retrieval, k-means clustering is a local search of the same kind. Each iteration cannot make the clustering worse, and the result depends on where it starts.
What comes next
Genetic algorithms replace the single candidate with a population and add recombination. A population can hold candidates in several regions at once, and recombination lets information from different regions combine. The next topic starts with the simple genetic algorithm.
References
- Eiben, A. E., and Smith, J. E. (2015). Introduction to Evolutionary Computing, 2nd ed. Springer. record · 35 pages
- Russell, S., and Norvig, P. (2020). Artificial Intelligence: A Modern Approach, 4th ed. Pearson. record · 6 pages
Reviewed: verified, 16 Nov 2026 · citations checked, 16 Nov 2026 · editorial review, 16 Nov 2026 · 4 revisions