The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998 The.Algorithm.Design.Manual.Springer-Verlag.1998

18.04.2013 Views

Simulated Annealing Next: Traveling Salesman Problem Up: Heuristic Methods Previous: Heuristic Methods Simulated Annealing The inspiration for simulated annealing comes from the physical process of cooling molten materials down to the solid state. When molten steel is cooled too quickly, cracks and bubbles form, marring its surface and structural integrity. To end up with the best final product, the steel must be cooled slowly and evenly. Annealing is a metallurgical technique that uses a disciplined cooling schedule to efficiently bring the steel to a low-energy, optimal state. In thermodynamic theory, the energy state of a system is described by the energy state of each of the particles constituting it. The energy state of each particle jumps about randomly, with such transitions governed by the temperature of the system. In particular, the probability of transition from energy to at temperature T is given by where is a constant, called Boltzmann's constant. What does this formula mean? Consider the value of the exponent under different conditions. The probability of moving from a high-energy state to a lower-energy state is very high. However, there is also a non-zero probability of accepting a transition into a high-energy state, with small energy jumps much more likely than big ones. The higher the temperature, the more likely such energy jumps will occur. What relevance does this have for combinatorial optimization? A physical system, as it cools, seeks to go to a minimumenergy state. For any discrete set of particles, minimizing the total energy is a combinatorial optimization problem. Through random transitions generated according to the above probability distribution, we can simulate the physics to solve arbitrary combinatorial optimization problems. Simulated-Annealing() from S to Create initial solution S Initialize temperature t repeat file:///E|/BOOK/BOOK2/NODE92.HTM (1 of 3) [19/1/2003 1:29:34] for i=1 to iteration-length do Generate a random transition

Simulated Annealing Return S then until (no change in C(S)) If then else if Reduce temperature t There are three components to any simulated annealing algorithm for combinatorial search: ● Concise problem representation - The problem representation includes both a representation of the solution space and an appropriate and easily computable cost function C() measuring the quality of a given solution. ● Transition mechanism between solutions - To move from one state to the next, we need a collection of simple transition mechanisms that slightly modify the current solution. Typical transition mechanisms include swapping the position of a pair of items or inserting/deleting a single item. Ideally, the effect that these incremental changes have on measuring the quality of the solution can be computed incrementally, so cost function evaluation takes time proportional to the size of the change (typically constant) instead of linear in the size of the solution. ● Cooling schedule - These parameters govern how likely we are to accept a bad transition as a function of time. At the beginning of the search, we are eager to use randomness to explore the search space widely, so the probability of accepting a negative transition is high. As the search progresses, we seek to limit transitions to local improvements and optimizations. The cooling schedule can be regulated by the following parameters: ❍ Initial system temperature - Typically . ❍ Temperature decrement function - Typically , where . This implies an exponential decay in the temperature, as opposed to a linear decay. ❍ Number of iterations between temperature change - Typically, 100 to 1,000 iterations might be permitted before lowering the temperature. ❍ Acceptance criteria - A typical criterion is to accept any transition from to when and to accept a negative transition whenever where r is a random number . The constant c normalizes this cost function, so that almost all transitions are accepted at the starting temperature. ❍ Stop criteria - Typically, when the value of the current solution has not changed or improved within the last iteration or so, the search is terminated and the current solution reported. Creating the proper cooling schedule is somewhat of a trial and error process. It might pay to start from an existing implementation of simulated annealing, pointers to which are provided in Section . file:///E|/BOOK/BOOK2/NODE92.HTM (2 of 3) [19/1/2003 1:29:34]

Simulated Annealing<br />

Return S<br />

then<br />

until (no change in C(S))<br />

If then<br />

else if<br />

Reduce temperature t<br />

<strong>The</strong>re are three components to any simulated annealing algorithm for combinatorial search:<br />

● Concise problem representation - <strong>The</strong> problem representation includes both a representation of the solution space and<br />

an appropriate and easily computable cost function C() measuring the quality of a given solution.<br />

● Transition mechanism between solutions - To move from one state to the next, we need a collection of simple<br />

transition mechanisms that slightly modify the current solution. Typical transition mechanisms include swapping the<br />

position of a pair of items or inserting/deleting a single item. Ideally, the effect that these incremental changes have on<br />

measuring the quality of the solution can be computed incrementally, so cost function evaluation takes time<br />

proportional to the size of the change (typically constant) instead of linear in the size of the solution.<br />

● Cooling schedule - <strong>The</strong>se parameters govern how likely we are to accept a bad transition as a function of time. At the<br />

beginning of the search, we are eager to use randomness to explore the search space widely, so the probability of<br />

accepting a negative transition is high. As the search progresses, we seek to limit transitions to local improvements<br />

and optimizations. <strong>The</strong> cooling schedule can be regulated by the following parameters:<br />

❍ Initial system temperature - Typically .<br />

❍ Temperature decrement function - Typically , where . This implies an exponential<br />

decay in the temperature, as opposed to a linear decay.<br />

❍ Number of iterations between temperature change - Typically, 100 to 1,000 iterations might be permitted<br />

before lowering the temperature.<br />

❍ Acceptance criteria - A typical criterion is to accept any transition from to when and to<br />

accept a negative transition whenever<br />

where r is a random number . <strong>The</strong> constant c normalizes this cost function, so that almost all<br />

transitions are accepted at the starting temperature.<br />

❍ Stop criteria - Typically, when the value of the current solution has not changed or improved within the last<br />

iteration or so, the search is terminated and the current solution reported.<br />

Creating the proper cooling schedule is somewhat of a trial and error process. It might pay to start from an existing<br />

implementation of simulated annealing, pointers to which are provided in Section .<br />

file:///E|/BOOK/BOOK2/NODE92.HTM (2 of 3) [19/1/2003 1:29:34]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!