= Simulated annealing
{wiki}
<Simulated annealing> accepts worse <feasible solutions> to escape a <local minimum>. Minimize an <objective function> $E(x)$, analogous to <energy>. Effective <temperature> $T>0$ has the same units as $E$, absorbing the <Boltzmann constant>; it controls exploration, rather than a material's <thermodynamic temperature>.<Optimization by Simulated Annealing by Scott Kirkpatrick and others>[Printed pp. 672–673: effective temperature and cost as energy]{ref}
Given current <feasible point> $x$, draw $y$ from a <proposal distribution> $q(x,y)$. For a symmetric <proposal distribution>, $q(x,y)=q(y,x)$, use the <Metropolis–Hastings acceptance probability>
$$
\Delta E=E(y)-E(x),\qquad a_T(x,y)=\min\{1,\exp(-\Delta E/T)\}.
$$
Accept with this <conditional probability>; on rejection retain $x$. Every downhill or equal-cost proposal is accepted. Draw a fresh <uniform random variable> $U$ on $(0,1)$ and accept if $U<a_T(x,y)$. The off-diagonal <transition probability> $P_T(x,y)=q(x,y)a_T(x,y)$ includes proposing $y$.<Optimization by Simulated Annealing by Scott Kirkpatrick and others>[Printed p. 672: acceptance rule and rejected proposals]{ref}
For a <maximization problem> with <objective function> $f$, set $E=-f$: every improving proposed neighbor is accepted, and a worsening move of loss $\Delta=f(x)-f(y)>0$ has <conditional probability> $\exp(-\Delta/T)$ of acceptance, under the same symmetry assumption. <Likelihood-power annealing> uses precisely this sign convention for a <log-likelihood>. Retain the best <feasible solution> seen, since the current state can worsen even after a <global minimum> has been visited.
If the <proposal distribution> is asymmetric, use the full <Metropolis–Hastings acceptance probability>, for $q(x,y)>0$,
$$
a_T(x,y)=\min\left\{1,\exp\left(-\frac{E(y)-E(x)}{T}\right)\frac{q(y,x)}{q(x,y)}\right\}.
$$
A missing reverse proposal gives zero acceptance. Even a downhill proposal need not be accepted with <probability> one in this case. Choosing uniformly among a variable number of neighbors is generally asymmetric: $q(x,y)=1/d(x)$ and $q(y,x)=1/d(y)$ give the correction $d(x)/d(y)$, where $d$ is <vertex degree>.<Markov Chains and Mixing Times, second edition by David A. Levin and others>[§3.2.2, printed pp. 40–41, equation (3.4): general base chain]{ref}
The useful idea is to separate exploring from insisting on improvement: an uphill move can open a route to a better <feasible solution>. Its usefulness depends on the <proposal distribution>, the scale of the <objective function>, and the <cooling schedule for simulated annealing>. Finite practical schedules carry no general guarantee of finding a <global minimum>.
Back to article page