JOIIKNAI. Ol- CUMl'lll'ATlONAL PHYSICS um. k6 l)2 (iw) New Optimization Heuristics The Great Deluge Algorithm and the Record-to-Record Travel GUNTER DUECK IBM Germany, Heidelberg Scientific Center, Tiergartenstrasse 15, D-6900 Heidelberg Receive! IX-ecmbcr 4. J99«; revised October 29, 1991 In a former paper we introduced a very effective new general purpose optimization principle. We compared this method, which we called threshold accepting (TA), with the well-known simulated annealing (SA) method for discrete optimization. The empirical results demonstrated the superiority of the TA algorithm. In further experiments with the TA principle we discovered two new powerful optimization heuristics: The great deluge algorithm (GDA) and the record-to-record travel (RRT). These algorithms resemble in their structure the formerly studied TA and the SA method. The differences lie in their acceptance rules for worse intermediate solutions. Both, the GDA and the RRT, are essentially one-parameter algorithms; i.e., for the achievement of best possible performance, a good choice is necessary only for a single parameter. This is in contrast for instance to the classical SA algorithm, where it is necessary to choose carefully a certain sequence of parameters, the so-called annealing schedule. The quality of the computational results obtained so far by RRT and GDA shows that the new algorithms behave equally well as TA and thus a fortiori better than SA. 'C) 1993 Academic Piess, Inc. INTRODUCTION In [I] we introduced the threshold accepting (TA) principle which yielded computational results superior to the well-known simulated annealing (SA) method. We demonstrated in tests on traveling salesman problems that TA • yields much better results than SA • needs considerably less computing time • is more insensitive in its parameters. During tests of TA on other problems, especially on knapsack problems (a detailed report will follow), we found that one can simplify even the TA principle. This resulted in two new optimization heuristics which we called the great deluge algorithm (GDA) and the Record-to-Record Travel (RRT). We give a description of all these algorithms in discussion here. In many typical optimization problems one wants to find among many configurations one configuration which maximizes or minimizes a certain "quality-function." In the familiar traveling salesman problem one wants to find a circuit of travel through a given number of cities with minimal tour length. The algorithms we discuss here work as follows. First an initial configuration is chosen. Then each step of the four algorithms consists of a slight change of the old configuration into a new one. The "qualities" of the two configurations are compared. Then a decision is made if the new configuration is "acceptable." If the new configuration is acceptable it serves as the "old" configuration for the next step. If it is not acceptable, the algorithm proceeds with a new change of the old configuration. The four algorithms differ in their decision rule to determine whether a configuration is acceptable or not. Kirkpatrick et al. [2] introduced the concept of "annealing" and combined it with the well-known Monte-Carlo algorithm by Metropolis et al. [3] which originally was used to numerically perform averages over large systems from statistical mechanics. The idea of SA runs as follows. The "qualities" of the two configurations (the old one and the new one) are compared. If the new configuration is better then it serves as the "old" configuration for the next step. If it is worse then it is accepted only with a certain probability as the current configuration for the next step. This probability depends on a time-dependent parameter called temperature and on the decrease in quality. The probability that a worse configuration is accepted is slowly lowered during the running time. We make these explanations more pricise: SA Algorithm for Maximization. choose an initial configuration choose an initial temperature 7'>() Opt: choose a new configuration which is a stochastic small perturbation of the old configuration compute AE:= quality (new configuration)-quality (old configuration) IF AE>0 THEN old configuration := new configuration 0021-9991/9.1 S5 00 Copyright ip) 1993 by Academic Press. Inc. All rights of reproduction in uny Form reserved. 86 new optimization heuristics 87 ELSE with probability exp(JE/T) old configuration := new configuration IF a long time no increase in quality or too many iterations THEN lower temperature T IF some time no change in quality anymore THEN stop GOTO Opt Note that if the temperature is high, very often worse configurations are accepted. It is a kind of art to choose a successful annealing schedule, that is. a rule for lowering the temperature in the algorithm. In most applications the success of the algorithm is very sensitive against the choice of the annealing schedule. We explain briefly the parameters above within the framework of the traveling salesman problem (TSP). Here, the task is to find a minimum length tour through a given number of "cities." As an initial configuration, one chooses a random tour through all of the cities. A new configuration is obtained by small changes in the tour. The quality of a tour is given by its length. The method called threshold accepting (TA) which we studied in [1 ], is formally very similar to SA. TA Algorithm for Maximization. Choose an initial configuration Choose an initial THRESHOLD T>0 Opt: choose a new configuration which is a stochastic small perturbation of the old configuration compute AE := quality (new configuration equality (old configuration) IF AE>-T THEN old configuration := new configuration IF a long time no increase in quality or too many iterations Then lower THRESHOLD T IF some time no change in quality anymore THEN stop GOTO Opt. TA accepts every new configuration which is not much worse than the old one (SA accepts worse solutions only with rather small probabilities). The Great Deluge Algorithm for Maximization. Choose an initial configuration choose the "rain speed" UP > 0 choose the initial WATER-LEVEL > 0 Opt: choose a new configuration which is a stochastic small perturbation of the old configuration compute E := quality (new configuration) IF E> WATER-LEVEL THEN old configuration :^ new configuration WATER-LEVEL := WATER-LEVEL + UP IF a long time no increase in quality or too many iterations THEN stop GOTO Opt Imagine, the GDA is to find the maximum point on a certain surface, for instance, the highest point in a fictitious empty country. Then, "we let it rain without end" in this country. The algorithm "walks around" in this country, but it never makes a step beyond the ever increasing water level. And it rains and rains ■ ■ ■. Our idea is that in the end the GDA "gets wet feet" when it has reached one of the very heighest points in the country so that is has found a point close to the optimum. Originally, we did not really believe in this procedure, because our intuition mentioned: If you start this algorithm on an isle with no mountains then you will obtain very poor results. If the rain decomposes the country very quickly into different continents then you cannot hope to always reach very high points, etc. Nevertheless, we shall see that it works, and it works extremely well. The Record-to-Record Travel for Maximization Choose an initial configuration choose an allowed DEVIATION > 0 set RECORD := quality (initial config.) Opt: choose a new configuration which is a stochastic small perturbation of the old configuration compute E := quality (new configuration) IF E> RECORD-DEVIATION THEN old cnfiguration := new configuration IF £■> RECORD THEN RECORD := E IF a long time no increase in quality or too many iterations THEN stop GOTO Opt During a run of RT any configuration is accepted the quality of which is not much worse than the best value RECORD obtained so far. RRT is in some sense a variant of GDA. "The water level" in the RRT is the value of RECORD-DEVIATION. The new optimization heuristics have the advantage that they depend only on one single parameter. For the GDA it is necessary to choose the rain speed UP only. The value UP is the only parameter which is responsible for the computation speed and for the quality of the results. If the rain speed is high, the algorithm is very fast and produces results of only minor quality. If UP is chosen to be very small then the algorithm produces an excellent result after a long computation time. 88 GUNTER DUECK In the RRT algorithm, a very similar behaviour can be observed when varying the parameter DEVIATION. A small value gives a quick poor result, a large one excellent results after a long time. In our experiments with the GDA we found a reasonable rule for the choice of the parameter UP: the best UP should be somewhat smaller than 1 % of the average gap between the quality of the current configuration and the water level. This easy rule revealed to us very quickly a very good choice for UP in all cases that we tried to attack an optimization problem with GDA. We see that GDA and RRT are extremely easy to implement, and they depend only on a single parameter which is not hard to choose in a satisfactory manner. It is left now to report the computational results. We have studied TA until now for the TSP, for finding good error-correcting codes, for the minimization of spin-glass Hamiltonians, for 0-1 linear programming, 0-1 quadratic programming, quadratic assignment problems, etc. In a forthcoming report we shall present our results on integer programming, together with a report on a large customer project. In the present paper we give a comparison of the new heuristics only for two typical traveling salesman problems, the 442-cities problem of Grotschel [4] and the 532-cities problem of Padberg and Rinaldi [8], For these two problems, many papers have been written with computational results. Furthermore, the optimum tour lengths have been recently determined. GROTSCHEL'S 442-PROBLEM: THE ALGORITHMS Grotschel's 442-cities problem is a Euclidean TSP. There are given the coordinates of 442 cities in the Euclidean plane. It is asked for a closed polygonal tour of minimum length joining all the given points (cities). If C is the set of cities, a tour can be regarded as a permutation n: C -* C. Given a permutation n, the corresponding tour starts in 7i(l), goes to tt(2), goes to n(N), and ends in 7t(l), where N is the number of cities (here N = 442). All our algorithms start with a random permutation on C as an initial tour. As in [5], we choose the LIN-2-OPT exchange as a procedure to construct a new perturbation tour from an old one. This rule has been applied successfully to Euclidean TSPs (cf. [9]). LIN-2-OPT. choose i,je C, i< j cut in the tour the connections between the cities n(i) and + 1) (n{N+ 1) := n(\)) and 7E(7)and7iO'+l) (n(N + 1) := te(1 )) insert connections between iz(i) and n(j) and n{i + 1) and + 1) (n(N+l):=n(l)) Formally, the new permutation is given by _ (7i(A:) for k^iork>j ^ '~{n(i + j+l-k) for i