Simulated Annealing — Searching a Cost Landscape

The current point hops over a bumpy 1-D function. Worse moves are accepted with probability exp(-Δ/T); T cools over time. Best-so-far is tracked separately.

Accept worse: exp(-Δ/T) Always accept Δ ≤ 0 Return best, not current
current best-so-far accepted move rejected move proposed neighbor

Big-O / Cost

QuantityCostNote
Per iterationO(1)incremental Δ + one exp
Whole runO(I · c)I iterations, c per-move cost
MemoryO(state)hold current + best only
Global-opt guaranteelog coolingTₕ = c/log(k+2), impractical

State

Temperature T
Iteration
0
Current cost
Best cost
Accept rate
Worse accepted
0

Last Move

Press Start to run, or Step for one move at a time.

Log