Simulated annealing
Simulated annealing is a stochastic optimization method that gradually reduces the probability of accepting worse solutions to escape local optima.
Advanced Algorithms and Data Structures
Simulated annealing is a randomized optimization algorithm that probabilistically accepts some worsening transitions while gradually reducing that probability to escape local optima and approach a global optimum.
- How it is used
- Optimizes routes and graph embeddings when local minima or nondifferentiable costs make downhill-only search unsuitable.
- How deep it goes
- Develops a generic pseudocode loop, acceptance behavior, cooling schedule, transition design, and tuning trade-offs without proving convergence.
- Examples
- Works through traveling-salesperson tour costs and swaps, then applies vertex moves to minimum-crossing and force-directed graph drawings.
- What you can do after
- Build it from scratch by supplying a cost function, candidate transition, acceptance rule, cooling schedule, and iteration limit.
Read how Advanced Algorithms and Data Structures explains simulated annealing →
Optimization Algorithms: AI techniques for design, planning, and control problems
The original form of simulated annealing that uses a temperature-controlled probability of accepting worsening moves.
- How it is used
- Uses a trajectory-based, derivative-free search for continuous and discrete optimization problems.
- How deep it goes
- Derives the acceptance rule and gives pseudocode, cooling guidance, hand iterations, and practical implementations.
- Examples
- Works through a bounded quadratic and a five-city traveling salesman problem, then applies SA to Berlin52 and delivery routing.
- What you can do after
- Apply it via optalgotools’ SimulatedAnnealing to bounded function optimization and traveling salesman problems.
Machine Learning Algorithms in Depth
Simulated annealing is a heuristic optimization method that probabilistically accepts higher-energy states according to a temperature-controlled schedule to escape local optima.
- How it is used
- Uses temperature-controlled search to minimize energy while allowing moves that can escape local optima.
- How deep it goes
- Develops the acceptance and cooling loop into pseudocode and a from-scratch implementation; does not establish a global-optimum guarantee.
- Examples
- Uses a two-dimensional energy landscape, sampled energies, and a traveling salesman problem application.
- What you can do after
- Build it from scratch to search a two-dimensional energy function, and consider restarts when seeking better optima.
Read how Machine Learning Algorithms in Depth explains simulated annealing →
What to know first
- graphA graph is a mathematical structure consisting of vertices and edges that connect pairs of vertices to represent relationships or connections.
- local optimumA local optimum is a feasible point whose objective value is no worse than that of sufficiently nearby feasible points, though a better point may exist elsewhere.
- Traveling Salesman problemThe Traveling Salesman problem is a combinatorial optimization problem that seeks a minimum-cost tour visiting each specified location exactly once and returning to the starting location.
Related concepts
- objective functionuses · An objective function is a mathematical function that assigns values to candidate solutions or parameter settings, which an optimization procedure seeks to minimize or maximize.
- trajectory-based searchkind of · A search approach that generates a sequence of candidate states by repeatedly moving from one state to another.
- update ruleuses · An update rule specifies how an algorithm revises its current state, estimate, or representation using new information or an iteration step.
- local optimumaddresses · A local optimum is a feasible point whose objective value is no worse than that of sufficiently nearby feasible points, though a better point may exist elsewhere.
- Traveling Salesman problemaddresses · The Traveling Salesman problem is a combinatorial optimization problem that seeks a minimum-cost tour visiting each specified location exactly once and returning to the starting location.
- adaptive simulated annealingincludes · Adaptive simulated annealing is a simulated-annealing variant that adjusts its search parameters or operators in response to search conditions.
Questions about simulated annealing
What is simulated annealing?
Simulated annealing is a stochastic optimization method that gradually reduces the probability of accepting worse solutions to escape local optima.
Which Manning books explain simulated annealing?
Advanced Algorithms and Data Structures, Optimization Algorithms: AI techniques for design, planning, and control problems and Machine Learning Algorithms in Depth.
What should I know before learning simulated annealing?
Manning books that teach simulated annealing usually introduce graph, local optimum, Traveling Salesman problem and annealing first.
What kinds of simulated annealing are there?
Kinds of simulated annealing include adaptive simulated annealing.
What is simulated annealing a kind of?
Simulated annealing is a kind of trajectory-based search. A search approach that generates a sequence of candidate states by repeatedly moving from one state to another.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


