- Year
- 1983
- Type
- Probabilistic metaheuristic / local search
What does it do?
Simulated annealing is a probabilistic local-search metaheuristic introduced by Kirkpatrick, Gelatt, and Vecchi in 1983.
It draws an analogy with the annealing of metals, in which controlled heating and slow cooling bring a material into a low-energy state, and applies this idea to escape local optima in combinatorial and continuous optimisation. The method keeps a single current solution and sometimes accepts a worse one, with a probability that falls as the temperature is lowered.
The intuition behind the method
Imagine trying to find the lowest point in a hilly landscape while blindfolded. A purely greedy search always steps downhill and can get stuck in the first valley it finds, which may not be the deepest one. Simulated annealing adds controlled randomness: while the temperature is high, the algorithm sometimes accepts an uphill step, which lets it leave shallow valleys. As the temperature falls according to a cooling schedule, the algorithm accepts worse moves less and less often and settles on a solution. The quality of the result therefore depends heavily on how the temperature is lowered.
History
Kirkpatrick, Gelatt, and Vecchi introduced simulated annealing in their 1983 paper in Science, making an explicit analogy between statistical mechanics, including the annealing of solids, and the optimisation of functions of many parameters. The ability of the method to identify the best among multiple solutions is widely noted, with further examples in Bohachevsky, Johnson and Stein (1986), Goffe, Ferrier and Rogers (1994), and Brooks and Morgan (1995).
When to use it
Choose simulated annealing when you can define a neighbourhood move that turns a valid solution into a nearby valid solution, when the objective can be evaluated but not differentiated, and when the landscape appears to contain many local optima. It suits combinatorial problems such as scheduling, routing, and graph problems, as well as black-box continuous optimisation. No training data or normality assumption is required. Do not choose it when the objective is smooth and differentiable, since gradient-based methods usually exploit that structure better, or when no meaningful neighbourhood can be defined. If the evaluation budget is too small for the cooling schedule to run through its full range, a deterministic local search is usually the more appropriate choice.
Limitations and considerations
- Solution quality is sensitive to the cooling schedule; a poor schedule can yield results no better than random search.
- The neighbourhood structure must be designed for each problem class, which requires domain expertise.
- The theoretical convergence result depends on very slow cooling, which is generally too costly to use, so a finite run returns a near-optimal solution without a guarantee.
- Does not use gradient or other structural information, so gradient-based methods are usually more efficient on smooth, differentiable problems.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Can leave local optima because it probabilistically accepts some worse solutions, which pure greedy descent never does.
- Needs only the ability to evaluate the objective and generate neighbouring solutions, so non-differentiable or black-box objectives can be handled.
- Applies to both combinatorial and continuous problems, provided a neighbourhood move is defined for the problem.
- Theory indicates convergence to the global optimum under very slow (logarithmic) cooling; a finite run does not reach this guarantee in practice.
- Has few core settings to decide: the initial temperature, the cooling schedule, and the neighbourhood move.
Applications
- Multi-objective combinatorial optimisation, where simulated annealing has been adapted to produce trade-off solutions (Ulungu et al., 1995; Suman, 2002).
- Reliability-oriented system design, for example simulated annealing based multi-objective algorithms applied to system reliability (Suman, 2003).
- Maximisation of an explicitly known objective function in statistics and econometrics, where simulated annealing is described as a powerful global search tool.
How it works
How it works
The algorithm begins with a starting solution — any feasible point in the search space — and a high initial temperature. The starting solution can be random or problem-specific; the initial temperature is typically set high enough that almost any neighbouring solution would be accepted at the start.
A neighbouring solution is generated by applying a small random change (a 'move') to the current solution. The neighbourhood structure must be tailored to the problem: for a scheduling problem a move might swap two tasks; for a continuous function it might add a small random perturbation to the current parameter vector.
The difference in objective value between the new and current solution is computed. If the new solution is better, it is always accepted. If it is worse, it is accepted with a probability that decays with the size of the deterioration and the current temperature — typically exp(−ΔE / T). This probabilistic acceptance is the core mechanism that prevents premature convergence. The rule rests on the statistical-mechanics analogy that Kirkpatrick, Gelatt and Vecchi (1983) use to connect the annealing of solids with optimisation.
After each iteration (or after a fixed number of moves at the same temperature), the temperature is reduced according to a cooling schedule — commonly a geometric schedule T ← α·T where α is slightly below 1. This geometric rule is a practical heuristic and carries no convergence guarantee; the theoretical guarantee applies only to very slow logarithmic cooling. The choice of cooling schedule strongly affects solution quality: cooling too fast traps the search in a local optimum; cooling too slowly wastes computational time. Suitable values of α and of the initial temperature depend on the problem and are best set by pilot runs.
The algorithm stops when the temperature falls below a minimum threshold, a maximum number of iterations is reached, or the solution has not improved for a specified number of steps. The best solution encountered throughout the entire run — not just the final state — is returned as the result.
Common pitfalls
- If the iteration budget is too small for the cooling schedule to run its full course, the search ends while the temperature is still high or only partly reduced, and the result may be no better than a local optimum reached by greedy descent. In that case a deterministic local search or tabu search may be a better choice.
- Setting the initial temperature too low means the algorithm almost never accepts a worse move and behaves like greedy hill-climbing, losing its ability to escape local optima.
- Cooling too aggressively, with the temperature dropped by a large factor at each step, can lock the search into a local optimum. Check the result by repeating the run from several starting solutions and comparing outcomes.
- Applying a neighbourhood move designed for one problem type to a different problem can make moves infeasible or meaningless. Verify that every generated neighbour is a valid solution.
- Reporting only the final state rather than the best solution seen during the run can miss the true optimum found at an intermediate step.
Frequently asked questions
How do I choose the cooling schedule?
A common starting point is a geometric schedule, T ← α·T, with α slightly below 1; this is a heuristic and carries no convergence guarantee. Set the initial temperature high enough that most early uphill moves are accepted, so the search can move freely, and keep cooling until accepted uphill moves become rare. In pilot runs, track the acceptance rate of worsening moves to judge both settings. If final solution quality is poor, cool more slowly by raising α toward 1; if runtime is too long, cool faster. Repeat the run from several starting solutions to check that the results are consistent.
How does simulated annealing differ from genetic algorithms or particle swarm optimisation?
Simulated annealing maintains a single solution and explores the neighbourhood through random perturbations, accepting worse solutions probabilistically. Genetic algorithms and particle swarm optimisation maintain a population of solutions and use crossover, mutation, or swarm movement to evolve the population. Simulated annealing is generally simpler to implement for problems with a natural neighbourhood structure, while population-based methods can be more effective for high-dimensional continuous problems.
Is the global optimum guaranteed?
Theoretically yes, under logarithmic cooling, in which the temperature decreases very slowly; a geometric schedule carries no such guarantee. In practice such cooling is too slow to be used, so the algorithm returns a near-optimal solution, and a finite run carries no guarantee of reaching the global optimum. Solution quality generally improves with slower cooling and more iterations. Running multiple restarts and keeping the best solution found is a practical way to increase confidence.
When should I prefer tabu search or a genetic algorithm instead?
Choose tabu search when you need a deterministic, memory-guided search that avoids revisiting recent solutions and can exploit problem structure efficiently in a shorter run. Choose a genetic algorithm or particle swarm optimisation when the problem is high-dimensional and continuous, or when a population of diverse solutions is needed to map the optimum landscape. Simulated annealing is a strong default for combinatorial problems with a clear neighbourhood structure and when implementation simplicity matters.
Related methods
Sources
Kirkpatrick, S., Gelatt, C.D. & Vecchi, M.P. (1983). Optimization by Simulated Annealing. Science, 220(4598), 671-680.
Open DOI referencevan Laarhoven, P.J.M. & Aarts, E.H.L. (1987). Simulated Annealing: Theory and Applications. Springer.
ISBN: 9789027725431fuzzy-multicriteria-decision-making-2008, p. 64
COMPUTATIONAL METHOD IN STATISTICS AND ECONOMETRICS, p. ?