Algorithm
Assume we are trying to find a state where some evaluation function
f is a global maximum:
current = Initial-State(problem)
for t = 1 to infinity do
T = Schedule(t) ; T is the current temperature, which
; is monotonically decreasing with t
if T=0 then return current ; halt when temperature = 0
next = Select-Random-Successor-State(current)
deltaE = f(next) - f(current) ; If positive, next is
; better than current.
; Otherwise, next is
; worse than current.
if deltaE > 0 then current = next ; always move to
; a better state
else current = next with probability p = e^(deltaE / T)
; as T -> 0, p -> 0
; as deltaE -> -infinity, p -> 0
end