Back to heuristics for global optimisation
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:
where T is the temperature and kappa a physical constant known as the Boltzmann constant.
and Z(T) is a normalising partition function defined as:
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.
The form of the evaluation function is quite clear for many problems, taking the value of the function that is being optimised. In the TSP case this is simply the sum of the intercity distances in a (cyclic) tour. With many combinatorial optimisation problems however, the evaluation function is not as straightforward, especially when searching for any feasible solution to some problem. In these cases, a penalty function is generally applied, which can distinguish between two infeasible solutions to determine which one is closer to feasibility. Thus the solution space for the annealing algorithm does not necessarily consist entirely of feasible solutions, although the algorithm will tend to discourage the selection of infeasible solutions as the temperature decreases.
With a solution space , a neighbourhood scheme, and an evaluation function defined, the algorithm can now determine which other solutions can be reached in a single move, from a particular solution, and whether they are better or worse than the current position. Also, to begin the algorithm, a method of constructing an initial solution is required. This is usually achieved in either a randomised or a systematic manner.
Finding an initial temperature is analogous to heating a solid in the true annealing process to a temperature when all particles are free to move about in the solid, meaning the system is equally likely to be in any state. This can be achieved in the algorithm by selecting some arbitrary initial temperature and performing a preliminary `heatup' process. This typically involves repeatedly increasing the temperature until a certain high percentage of moves are being accepted.
Once the initial temperature has been determined and the algorithm proper has begun, the time spent at each value of the temperature needs to be decided upon. Returning to the true annealing process, notice that temperature reduction must be performed carefully in order to reestablish the thermal equilibrium of the system, categorised by the Boltzmann distribution. Every time the temperature is reduced in the algorithm, L should be the number of iterations needed before the distribution of states returns to equilibrium. This is quite a theoretical consideration and L is often determined arbitrarily, e.g. fixed at some constant value. Alternatively some degree of feedback can be used in the algorithm to determine when equilibrium has (approximately) been reached.
As noted above, temperature reduction needs to be performed carefully. If the temperature is reduced too quickly then the system can quickly become trapped in a local optimum of poor quality, analogous to quenching in the physical system. If the temperature is reduced too slowly then time until the algorithm converges to a local optimum can become prohibitively long. There is a trade off between the size of the incremental changes in the temperature and the number of iterations required to reestablish thermal equilibrium. The larger the change, the longer it will take to reestablish equilibrium at each temperature. If small changes are used then equilibrium is found relatively quickly, larger changes require more time to regain the Boltzmann distribution. Again the exact manner in which temperature is reduced can be determined arbitrarily, such as a geometric decrease T=aT where a<1 (although usually quite close to 1), or through a feedback mechanism. In general it is advisable not to spend too long at high temperatures, since then the algorithm is effectively performing a random search. Too much time should also not be spent at low temperatures, since the algorithm is then simply performing a local search.
The algorithm should terminate when there is little chance of escaping from the current solution to a better quality solution, and if temperature reduction has been done carefully, the quality of this local optimum will be close to that of the global optimum. Many methods of determining when to stop can be used. For example, if the current solution has not changed for a certain number of temperature reductions then the algorithm terminates, an arbitrary method. Alternatively, information from the algorithm can be used to measure the rate of change in solution quality (as a function of temperature) at successive temperatures, and when this rate has fallen below a certain threshold then the algorithm terminates.
This page is under development. Last updated 17 January 1995
Grant Telfar
grant@isor.vuw.ac.nz