Apex › Storage & databases

Simulated annealing — escaping local minima

Greedy optimization always moves downhill, so it gets trapped in the first local minimum it finds. Simulated annealing borrows from metallurgy: keep a temperature that starts high and cools, accepting uphill moves with probability exp(−ΔE/T) so the search can climb out of traps early, then settle as it cools. It's the workhorse for rugged combinatorial problems — chip placement, routing, scheduling. Watch greedy get stuck while annealing reaches the deep valley (change the seed — it's probabilistic).

More in Storage & databases