Back to heuristics for global optimisation

Simulated Annealing

Simulated Annealing is an heuristic method for finding `good' solutions to difficult optimisation problems. The technique was first applied to combinatorial optimisation problems by Kirkpatrick et al. [2] and independently by Cerny [1]. They showed that ideas used in simulating the physical process of annealing as applied to solids, first proposed by Metropolis et al. [3], could be extended to solve optimisation problems in general, especially combinatorial optimisation problems.

Physical Analogy and the Metropolis Algorithm

Annealing is a thermal process used in condensed matter physics to obtain solids with low energy states. The process has two main steps, melting the solid and then carefully reducing the temperature so that the particles of the solid arrange themselves into the ground state. When the solid is melted to a liquid, the particles are arranged randomly, whereas in the ground state of the solid particles are arranged in an organised lattice that achieves a minimum energy configuration. If cooling is not done carefully, the ground state will not be reached, instead quenching occurs, whereby the solid takes on a meta-stable state with less than minimum energy. In either case we have reached a steady frozen state.

Metropolis et al. [3] modeled this physical process with the introduction of an algorithm based on Monte Carlo techniques. (Monte Carlo techniques involve the selective application of randomisation.) The algorithm generates a sequence of simulated states of the solid by successively perturbing states in the following manner:

The Simulated Annealing Algorithm

The application of the Metropolis algorithm to optimisation problems, originally suggested by Kirkpatrick et al. [2] and Cerny [1], is possible after making an analogy between the problem and the Metropolis algorithm determined by the following equivalences.

An optimisation problem can be solved using the Metropolis algorithm by repeatedly sampling neighbourhoods randomly, starting from an initial solution, and accepting as a new solution any configuration of superior quality and any inferior solution that passes the Metropolis test. The Metropolis test is dependent on the control parameter and the magnitude of the increase in such a way that small increases (assuming minimisation is the goal) are more likely to be acceptable than large increases. Also, when the temperature is high, the algorithm is likely to accept almost all configurations regardless of quality, but when the temperature is low, only solutions of a better quality are likely to pass the test. By accepting some inferior solutions the annealing algorithm seeks to avoid becoming trapped in a local optimum that is far from globally optimal (i.e. quenched). For a combinatorial optimisation problem, assuming minimisation of the objective function is the goal, a formulation is: minimise f(x) where x is a element of S and S is the solution space, x a solution, f(x) the objective function, and N(x) the neighbourhood structure. If the number of iterations spent at each temperature is identified as L and the temperature as T then a generalised annealing algorithm for such a problem is shown figure 2.6.



Since T is now a control parameter, Boltzmann's constant has no analogy in the optimisation problem and kappa has been dropped from the Metropolis test. However it is still usual to refer to T as the temperature and the rate and manner by which T is reduced as the cooling (or annealing) schedule. The speed of convergence of the algorithm will depend largely on the choice of L and T for each iteration. The Simulated Annealing algorithm in figure 2.6 is both simple and generally applicable since it is essentially a local search algorithm with the additional feature of the control parameter regulating some amount of uphill moves. The success of the algorithm has been accounted for by applying a Markov Chain model to the technique and demonstrating the asymptotic convergence properties of Simulated Annealing.(Any system that consists of random transitions from one state to another over an index (usually time) together with the Markov property is a Markov Chain. The Markov property essentially says that the choice of states available at the next stage of the system is unaffected by past history. Only the current state affects the selection of the next state.) In purely theoretical terms it has been shown that the algorithm converges to a set of globally optimal solutions as time tends to infinity. However when implementing an annealing algorithm practical considerations must be given to the annealing schedule to ensure convergence to a `good' quality solution occurs in finite time.

Implementing the Algorithm

To implement the algorithm for a particular problem it is necessary to first address two issues, generic and problem specific considerations. Problem specific considerations include the choice of a solution space, the form of the cost function, and an appropriate neighbourhood scheme. Generic considerations involve the choice of the initial temperature, the manner in which temperature is reduced, and the stopping condition. Both factors can greatly affect the speed of convergence.


References

  1. V. Cerny. Thermodynamical Approach to the Traveling Salesman Problem: An Efficient Simulation Algorithm. Journal of Optimization Theory and Applications, 45(1):41--51, 1985.
  2. S. Kirkpatrick, Jr. C.D. Gelatt, and M.P. Vecchi. Optimization by Simulated Annealing. Science, 220(4598):671--679, 1983.
  3. Nicholas Metropolis, Arianna W. RosenBluth, Marshall N. Rosenbluth, Augusta H.Teller, and Edward Teller. Equation of State Calculations by Fast Computing Machines. The Journal of Chemical Physics, 21(6):1087--1092, 1955.

This page is under development. Last updated 17 January 1995

Grant Telfar

grant@isor.vuw.ac.nz