function SIMULATED-ANNEALING(problem,schedule) returns a solution state
current ← problem.INITIAL-STATE
for t = 1 to ∞ do
T ← schedule(t)
if T = 0 then return current
next ← a randomly selected successor of current
ΔE ← VALUE(next) - VALUE(current)
if ΔE > 0 then current ← next
else current ← next only with probability eΔE/T
Figure 4.6 The simulated annealing algorithm, a version of stochastic hill climbing where some downhill moves are allowed. The schedule input determines the value of the “temper- ature” T as a function of time; higher temperatures early in the schedule mean that downhill moves are accepted more readily; late in the schedule with low temperatures, downhill moves are mostly rejected.
function SIMULATED-ANNEALING(problem,schedule) returns a solution state
inputs: problem, a problem
schedule, a mapping from time to "temperature"
current ← MAKE-NODE(problem.INITIAL-STATE)
for t = 1 to ∞ do
T ← schedule(t)
if T = 0 then return current
next ← a randomly selected successor of current
ΔE ← next.VALUE - current.VALUE
if ΔE > 0 then current ← next
else current ← next only with probability eΔE/T
Figure ?? The simulated annealing algorithm, a version of stochastic hill climbing where some downhill moves are allowed. Downhill moves are accepted readily early in the annealing schedule and then less often as time goes on. The schedule input determines the value of the temperature T as a function of time.