CS44 W00: Lecture 5

Topics:

  1. Hill-climbing search
  2. Simulated Annealing
  3. Example: Simulated Annealing for TSP

Hill Climbing

beam search The main problem with Hill Climbing is getting stuck in a local minimum. Simulated annealing works as a hill-climbing search method that allows moves in less good goal directions once in a while to escape local minima.

The metaphore comes from annealing, the process of cooling material in a heat bath. If the solid material is heated past its melting point and then cooled down in a solid state, the structural properties of the cooled solid depend on the rate of cooling. SLow cooling leads to strong, large crystals. Fast cooling results in imperfections.

Suppose we have a minimization problem over a set of feasible solutions and a cost function f which can be calculated for all feasible solutions. The optimal solution could be calculated by exhaustively searching the space, calculating f(s) and selecting the minimum. In practice, the feasible solution space is often too large for this to be feasible. Local optimization solves this by searching only a small subset of the solution space. This is achieved by defining a neighbourhood structure on the space and searching only the neighbourhood of the current solution for an improvement. If there is no improvement, the current solution is taken as an approximation of the optimal solution. If there is an improvement, the current solution is replaced by the improvement and the process is repeated. Simulated annealing works essentially like this, except that the neighbourhood is searched in a random way. A neighbour whose cost is worse than the current solution may be accepted depending on a control parameter called a temperature.

The Simulated Annealing Algorithm

  1. Select an initial temperature t_0 (a large number)
  2. Select an initial solution s_0
  3. Select a cost function f
  4. Select a neighbourhood structure for the solution space
  5. Select a temperature reduction function alpha( t )
  6. Repeat
  7. until stopping condition
s_0 is the approximation solution

To apply simulated annealing to a problem, several devcisions need to be made: choosing t_0, alpha(t), the stopping condition, the neighbourhood structure, and the cost function

Cooling Schedules

  1. alpha(t) = a*t with a between 0.8 and 0.99
  2. alpha(t) = t / (1 + b*t), with b small (around 0)
  3. alpha(t) = c / log( 1 + k ), where c is a constant at least as deep as the deepest local minimum and k the number of iterations. This cooling schedule guarantees asymptotic convergence to the optimal solution.

Example: Simulated Annealing for TSP

  1. the solution to TSP on n points is a permutation on n points
  2. there are n! possible solutions
  3. define a k-neighbourhood of a tour by removing k edges and replacing them with k different edges so as to maintain the tour
  4. example: k = 2; remove links (vi, v_i+1), (v_j, v_j+1) and add links (v_i, v_j) and (v_i+1, v_j+1)
  5. example: consider tour 58134276; the tour 58124376 is in its k-neighbourhood
  6. a 2-neighbourhood of a tour is completely determined by the indices i and j that denote the edges to be swapped with i < j (there is only one way to reconnect the tour)
  7. there are n(n-1)/2 possibilities for choosing i and j (thus, a 2-neighbourhood) which is much smaller than the original space
  8. Lemma1: any tour can be obtained from any other tour by a sequence of 2-neighbourhood changes. To see this consider the tour 123456789 and suppose you are interested in swapping edges 2 and 8 to generate 183456729. You can do this in the following manner
    123456789
    123458769
    123854769
    183254769
    183452769
    183456729
    
  9. Lemma2: Any neighbourhood can be generated at random by generating 2 uniform numbers for i and j.
  10. Cost function: length of the tour; it can be computed incrementally as d(v_i, v_j) + d(v_i+1, v_j+1) - d(v_i, v_i+1) - d(v_j+1, v_j)
  11. The simulated annealing solution for TSP is


Switch to:


vasilis@cs.dartmouth.edu