Simulated annealing
Common metaheuristic for global optimizationSimulated annealing is a Metaheuristic for approximating global optima. Broadly speaking, the algorithm uses an energy-based iterative optimization process for exploring the search space. The exact approach varies from problem to problem, but the generic algorithm has the following components:
- Iteration: the basic step of the algorithm is a probabilistic decision between staying in the current state and moving to some neighboring state . Each iteration yields a state of lower energy, effectively decreasing the exploratory capability of future iterations (i.e. by decreasing the likelihood of moving to higher energy neighbors than the current state).
- Neighboring states: the neighboring states of a given state are those states reachable via a transformation of . A stochastic transformation function (with ) embodies the notion of a “move” from one state to the next, and is usually defined as a simple/naive random alteration to a given state. Even simple alterations allow the algorithm to progressively explore a great variety of states in the search space.
- Acceptance probability: there are a few components needed in order to make informed decisions about transitions between states:
- We must define some method of evaluating the relative difference between two states. An energy function maps states to energy values, with lower energy implying greater quality i.e. closer to the target.
- We need a time-varying, monotonically decreasing temperature function , mapping a timestep to a temperature value. This function (along with defined below) defines the annealing schedule of the algorithm, and effectively controls the speed at which we move from exploration to exploitation. We must have a temperature of zero at the end of the allotted time budget i.e. where the timestep .
- We need a method of producing the probability of accepting a candidate state while in the current , under an energy function and temperature function at the current iteration . This is defined by the acceptance probability function , mapping energies , , and temperature to the probability of making a transition as described above. Some necessary qualities of include:
- As , if . must tend to some positive value for . This has the effect of narrowing the search space as we exhaust our iteration schedule, becoming increasingly strict about transitioning to better (lower energy) states.
- For , for . This ensures that, so long as we have some non-zero temperature, there is at least some chance of transition to higher energy states i.e. exploration is still possible.
- Ensuring the probability produced by is equal to one when , irregardless of temperature. This ensures we always move to a more optimal state when we can. This is not, however, necessary for the algorithm to converge1.
- It is typical for to reflect differences in energies and such that the probability of a state transition increases as the difference decreases. This is fairly intuitive property to have, and will likely have positive impacts on efficiency, but again is not necessary2.
Intuitively, simulated annealing attempts to find an optimal solution to an optimization problem by initially allowing a large amount of global exploration of