Inferensys

Glossary

Simulated Annealing

A probabilistic metaheuristic optimization technique that finds an approximate global optimum in a large, discrete search space by mimicking the thermodynamic process of heating and controlled cooling of a material.
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
PROBABILISTIC OPTIMIZATION

What is Simulated Annealing?

A metaheuristic optimization algorithm inspired by the metallurgical process of annealing, where a material is heated and then slowly cooled to increase the size of its crystals and reduce defects.

Simulated Annealing is a probabilistic technique for approximating the global optimum of a given function in a large search space. It is particularly effective for combinatorial optimization problems with many local minima, such as the Traveling Salesman Problem (TSP) or Job Shop Scheduling, where deterministic gradient-based methods would get trapped.

The algorithm works by iteratively proposing random moves from the current solution. A move that improves the objective function is always accepted. Crucially, a worse move may also be accepted with a probability governed by a temperature parameter and the Metropolis criterion, allowing the search to escape local optima early on. As the temperature cools according to a defined cooling schedule, the algorithm becomes greedier, eventually settling into a low-energy, near-optimal state.

MECHANISMS & CONCEPTS

Key Characteristics of Simulated Annealing

Simulated annealing is a probabilistic metaheuristic that escapes local optima by accepting worse solutions with a probability that decreases over time, mimicking the metallurgical annealing process.

01

The Metropolis Acceptance Criterion

The core decision rule that determines whether a new candidate solution is accepted. If the new solution is better, it is always accepted. If it is worse, acceptance probability is calculated as:

P(accept) = exp(-ΔE / T)

  • ΔE: The difference in objective function value (new_cost - current_cost)
  • T: The current temperature parameter

At high temperatures, the algorithm accepts significantly worse solutions, enabling broad exploration. As T approaches zero, the probability of accepting an uphill move vanishes, and the search becomes a greedy descent.

02

Cooling Schedule

The cooling schedule dictates how the temperature parameter T is reduced over time and is the most critical hyperparameter for convergence.

Common schedules include:

  • Exponential decay: T_k = α * T_{k-1} where α is typically 0.85 to 0.99
  • Logarithmic decay: T_k = T_0 / log(1 + k), proven to guarantee convergence to the global optimum given infinite time
  • Linear decay: T_k = T_0 - η * k

A schedule that cools too quickly causes premature convergence to a local optimum (quenching). Cooling too slowly wastes computational resources.

03

Neighborhood Generation Function

The mechanism that generates a new candidate solution by perturbing the current state. The design of this function is problem-specific and must ensure the search space is connected.

For the Traveling Salesman Problem (TSP):

  • 2-opt swap: Reverse a subsequence of the tour
  • Node swap: Exchange the positions of two cities
  • Insertion: Remove a city and reinsert it at a different position

The perturbation magnitude should be calibrated so that the expected change in objective value is comparable to the current temperature, maintaining a reasonable acceptance rate.

04

Global Convergence Properties

Simulated annealing is theoretically guaranteed to converge to the global optimum under specific conditions, proven via Markov chain analysis.

Required conditions for convergence:

  • The neighborhood structure must be strongly connected (any state reachable from any other)
  • The cooling schedule must satisfy T_k ≥ T_0 / log(1 + k) for sufficiently large T_0
  • An infinite number of iterations at each temperature level

In practice, these conditions are relaxed, and the algorithm provides a high-quality approximate solution in finite time. The Boltzmann distribution governs the probability of occupying each state at thermal equilibrium.

05

Comparison with Hill Climbing

Simulated annealing fundamentally differs from greedy local search by its ability to escape local optima.

Hill Climbing (Greedy Descent):

  • Only accepts moves that improve the objective
  • Traps at the first local optimum encountered
  • Deterministic given a fixed starting point

Simulated Annealing:

  • Accepts worsening moves probabilistically
  • Can traverse valleys to reach better peaks
  • Stochastic; multiple runs yield different paths

This makes simulated annealing suitable for rugged, non-convex fitness landscapes with many deceptive local optima, such as VLSI circuit placement and protein folding.

06

Parameter Tuning and Restarts

Effective deployment requires careful tuning of three interdependent parameters.

Key parameters:

  • Initial temperature (T_0): Set high enough that approximately 80% of proposed moves are initially accepted. A common heuristic is to run a short pilot phase and set T_0 based on the observed distribution of ΔE values.
  • Markov chain length: The number of iterations at each temperature step before cooling. Should be proportional to the neighborhood size.
  • Termination criterion: Stop when the system appears frozen—typically when the acceptance ratio drops below a threshold or the objective value has not improved for several temperature steps.

Adaptive schedules dynamically adjust the cooling rate based on acceptance statistics, reducing the need for manual tuning.

OPTIMIZATION TECHNIQUE COMPARISON

Simulated Annealing vs. Other Optimization Methods

A comparative analysis of simulated annealing against alternative prescriptive analytics and combinatorial optimization methods used in autonomous supply chain intelligence.

FeatureSimulated AnnealingGenetic AlgorithmMixed-Integer Linear ProgrammingGradient-Based Optimization

Problem Class

Discrete & continuous combinatorial optimization

Discrete & continuous combinatorial optimization

Linear problems with integer constraints

Continuous, differentiable functions

Global Optimum Guarantee

Handles Non-Differentiable Objectives

Escapes Local Minima

Solution Time for Large Search Spaces

Minutes to hours

Minutes to hours

Hours to days (NP-Hard)

Seconds to minutes

Requires Derivative Information

Stochastic Search Process

Typical Supply Chain Application

Vehicle routing, facility location

Multi-echelon inventory, scheduling

Network flow, production planning

Demand forecasting parameter tuning

SIMULATED ANNEALING EXPLAINED

Frequently Asked Questions

Clear, technically precise answers to the most common questions about the simulated annealing optimization algorithm, its mechanisms, and its practical application in solving complex combinatorial problems.

Simulated annealing is a probabilistic metaheuristic optimization algorithm that locates an approximate global optimum in a large, discrete search space by mimicking the thermodynamic process of heating and controlled cooling of a material. The algorithm works by iteratively proposing random moves from a current solution. A move that improves the objective function is always accepted. Crucially, a move that degrades the solution is accepted with a probability defined by the Metropolis criterion: P = exp(-ΔE / T), where ΔE is the increase in cost and T is the current temperature parameter. The temperature starts high, allowing the algorithm to freely explore the solution landscape and escape local minima. As the temperature gradually decreases according to a cooling schedule, the algorithm becomes increasingly greedy, settling into a low-energy (optimal) state. This controlled acceptance of uphill moves is the core mechanism that prevents premature convergence on a suboptimal local minimum.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.