Inferensys

Glossary

Simulated Annealing

A probabilistic metaheuristic for global optimization that mimics the physical process of annealing, accepting worse solutions with a decreasing probability to escape local optima and find the global minimum.
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.
METAHEURISTIC OPTIMIZATION

What is Simulated Annealing?

A probabilistic technique for approximating the global optimum of a given function, widely used in logistics for solving complex routing problems with vast search spaces.

Simulated Annealing is a probabilistic metaheuristic for global optimization that mimics the physical process of annealing, where a metal is heated and then slowly cooled to reduce defects. In an optimization context, the algorithm accepts worse solutions with a decreasing probability—governed by a temperature parameter—to escape local optima and locate the global minimum of a cost function.

The algorithm's ability to probabilistically accept uphill moves prevents premature convergence on suboptimal solutions, making it highly effective for combinatorial optimization problems like the Vehicle Routing Problem (VRP). As the temperature cools according to a defined schedule, the search transitions from exploration to exploitation, eventually settling into a low-energy, near-optimal state.

MECHANISM

Key Characteristics of Simulated Annealing

Simulated annealing is a probabilistic metaheuristic for global optimization that escapes local optima by occasionally accepting worse solutions. The probability of accepting an inferior state decreases over time, governed by a cooling schedule.

01

Metropolis Acceptance Criterion

The core probabilistic 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, it is accepted with a probability of exp(-ΔE / T), where ΔE is the magnitude of the objective function degradation and T is the current temperature. This allows the algorithm to climb out of local minima early in the search when T is high.

02

Cooling Schedule

The function controlling the rate at which the temperature parameter T decreases over iterations. Common schedules include:

  • Exponential decay: T_k = α * T_{k-1}, where α is typically between 0.8 and 0.99
  • Logarithmic cooling: T_k = T_0 / log(1 + k), which guarantees convergence to the global optimum but is impractically slow
  • Linear decay: T_k = T_0 - η * k The schedule directly balances exploration (high T) against exploitation (low T).
03

Neighborhood Generation

A problem-specific perturbation function that generates a new candidate solution from the current state. In the context of the Vehicle Routing Problem, common neighborhood operators include:

  • 2-opt: Reversing a segment of a route to eliminate crossing edges
  • Or-opt: Relocating a short segment of consecutive customers to a different position
  • Cross-exchange: Swapping segments between two distinct routes The efficiency of the search depends heavily on the design of this operator.
04

Global Convergence Properties

Under a logarithmic cooling schedule, simulated annealing is proven to converge asymptotically to the global optimum with probability 1, a property derived from the theory of inhomogeneous Markov chains. In practice, faster cooling schedules are used, trading the theoretical guarantee for computational feasibility. The algorithm is particularly effective on problems with a rugged fitness landscape containing many local optima, such as VLSI circuit placement and complex scheduling.

05

Parameter Tuning

Critical hyperparameters that must be calibrated for effective performance:

  • Initial temperature (T_0): Set high enough that approximately 80% of worse moves are initially accepted, ensuring sufficient exploration
  • Final temperature (T_f): A stopping threshold where the system is considered frozen
  • Iterations per temperature level: The number of neighborhood moves attempted before reducing T, often set proportional to the problem size
  • Restart strategies: Reheating the system to escape deep local minima if no improvement is found after a set number of iterations
06

Comparison to Other Metaheuristics

Simulated annealing is distinguished from related approaches by its single-solution trajectory and explicit temperature mechanism:

  • vs. Tabu Search: SA uses stochastic acceptance of worse moves, while Tabu Search uses deterministic memory structures to forbid recently visited solutions
  • vs. Genetic Algorithms: SA maintains and iterates on a single solution rather than a population, making it more memory-efficient but lacking implicit parallelism
  • vs. ALNS: Adaptive Large Neighborhood Search uses a destroy-and-repair paradigm with adaptive weight adjustment, while SA relies purely on perturbation and the Metropolis criterion
ALGORITHM SELECTION GUIDE

Simulated Annealing vs. Other Metaheuristics

Comparative analysis of Simulated Annealing against Genetic Algorithms, Tabu Search, and Adaptive Large Neighborhood Search for dynamic route optimization problems.

FeatureSimulated AnnealingGenetic AlgorithmTabu SearchALNS

Core Mechanism

Probabilistic hill-climbing with cooling schedule

Population evolution via crossover and mutation

Local search with adaptive memory structures

Iterative destroy-and-repair with adaptive selection

Escapes Local Optima

Population-Based Search

Memory Structures

Parameter Sensitivity

High (cooling schedule critical)

High (population size, mutation rate)

Medium (tabu tenure length)

Medium (destroy/repair weights)

Convergence Speed

Slow on large instances

Slow (evaluates many candidates)

Moderate

Fast (focused neighborhood exploration)

Best For VRP Variants

Small to medium CVRP with tight time windows

Multi-objective routing with trade-off analysis

VRP with complex hard constraints

Large-scale DARP and PDP with many constraints

Typical Solution Gap

2-5% from optimal on CVRP

1-3% from optimal on CVRP

1-4% from optimal on CVRP

0.5-2% from optimal on PDP

SIMULATED ANNEALING

Frequently Asked Questions

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

Simulated annealing is a probabilistic metaheuristic for global optimization that mimics the physical process of annealing in metallurgy, where a material is heated and then slowly cooled to reduce defects. The algorithm starts at a high initial temperature and iteratively explores the solution space by making random moves. Crucially, it probabilistically accepts worse solutions with a probability given by the Metropolis criterion, P = exp(-ΔE / T), where ΔE is the change in objective function value and T is the current temperature. This mechanism allows the search to escape local optima early in the process. As the temperature gradually decreases according to a defined cooling schedule, the algorithm becomes increasingly greedy, converging toward a global 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.