Operations Research Letters 10 (1991) 173-176 North-Holland
April 1991
A note on exploiting the Hamiltonian cycle problem substructure of the Asymmetric Traveling Salesman Problem * J o s e p h F. P e k n y School of Chemical Engineering, Purdue University, West Lafayette, I N 47907, USA
Donald
L. M i l l e r
Central Research & Development Department, E.I. du Pont de Nemours and Company, Wilmington, DE 19880, USA
Daniel Stodolsky Department of Mathematics, Carnegie Mellon University, Pittsburgh, PA 15213, USA Received August 1989 Revised May 1990
The assignment problem is a well-known relaxation of the Asymmetric Traveling Salesman Problem (ATSP). Associated with every optimal dual solution to the assignment problem is a directed admissible graph. An ATSP solution is found if the admissible graph is Hamiltonian, otherwise the assignment problem bound may be strengthened. The exploitation of this result requires an exact algorithm for the directed Hamiltonian cycle problem. Computational results are presented for up to 3000 cities to show that determining the Hamiltonicity of admissible graphs improves the performance of an exact ATSP algorithm. Traveling Salesman Problem * Hamiltonian cycle problem * assignment problem
1. Introduction
The Assignment Problem (AP) is a well-known relaxation of the Asymmetric Traveling Salesman Problem (ATSP) [1]. An exact branch and bound algorithm based on this relaxation has been used to solve ATSPs with up to 500 000 cities [7,8,2]. In an earlier paper by the authors [9], we presented an exact algorithm for the Directed Hamiltonian Cycle (DHC) problem. Given a directed graph. this algorithm either produces a Hamiltonian cycle or guarantees that one does not exist. In this note, we demonstrate the application of this D H C algorithm within an exact branch and bound algorithm for the ATSP.
* This work has been supported by the Engineering Design Research Center, an NSF Engineering Research Center.
In the next section, we briefly review an AP based branch and bound method for the ATSP. and describe how the D H C algorithm works within this framework. Section 3 presents computational results for problems of size up to 3000 cities showing the effectiveness of this combined A T S P / D H C approach and Section 4 presents conclusions.
2. Branch and bound algorithm for the A T S P
The most successful approach for solving large ATSPs has been branch and bound algorithms using AP lower bounds. A book by Lawler et al. [6] provides a thorough discussion of the TSP as well as a review of literature through 1985. The chapter by Balas and Toth, which discusses branch
0167-6377/91/$03.50 ~i2:1991 - Elsevier Science Publishers B.V. (North-Holland)
173
Volume 10, Number 3
OPERATIONS RESEARCH LETTERS
and bound methods, is particularly relevant [1]. Pekny and Miller provide a detailed description of such an algorithm and present results for problems up to 500000 cities [7]. In this paper, we report the enhancement of this ATSP algorithm by the incorporation of the exact D H C algorithm of [9]. Readers are referred to the above papers for details of the D H C and ATSP algorithms. Dantzig et al. [4] provided the following integer programming formulation of the TSP: n
minimize
tt
£
£ c, ,x, j
(1)
i~l j=l
subject to n
E Xij= 1,
j=l
. . . . . n,
(2)
i = 1 . . . . . n,
(3)
i=1 tl
}-~ x,i = 1, j~ !
Ex,,-
v s c { l ..... n},
i~S .j~S
S ~ j~,
i, j = l ..... n.
x//~{0,1},
(4) (5)
Dropping equation (4) yields the AP relaxation of the TSP. Because the constraint matrix associated with equations (2) and (3) is totally unimodular, the integrality requirements on x may be relaxed, yielding a linear programming problem whose dual is given by I1
maximize
•
(u,+ei)
(6)
i=1
subject to
ci,-ui-vj>~O
Vi, j.
(7)
Given an optimal dual solution to the AP, we define the admissible graph as ( G = V, A) where
x=
{(i, ;)
Lc,,- u,- v,=0)}.
We define the reduced cost ~,j to be c O - u, - vj. The ATSP algorithm of Miller and Pekny [7,8] recursively generates a search tree. Each vertex in the tree is an ATSP with a lower bound obtained by solving the AP relaxation. If this bound is not less than the best currently known solution to the original ATSP, the vertex is discarded. If the AP 174
April 1991
solution is an ATSP solution, the corresponding tour is saved, otherwise the vertex is branched creating several child vertices. The child vertices are more constrained than their parent, i.e. certain city to city transitions have been disallowed. The procedure is then applied recursively to these new vertices. When the recursion terminates, the saved tour with the lowest cost is an optimal solution to the ATSP. Introduction of the D H C algorithm results in a slight modification of the above scheme. The DHC algorithm is applied to vertices whose lower bound is less than the best known ATSP solution just prior to branching. The admissible graph is generated and its Hamiltonicity is determined. If the graph is Hamiltonian, a feasible ATSP solution at the AP cost has been found and the corresponding tour is saved, otherwise the vertex is branched. In this sense, the D H C algorithm operates as an upper bounding technique, reducing computation time by finding ATSP solutions earlier in the calculation (see below). Any of the heuristic methods [5,3] for D H C could perform this function, although not as well as an exact method because they sometimes fail to locate existing Hamiltonian cycles. A second use of the D H C relies on the algorithm being exact. Below we show that the admissible graph from any optimal dual solution contains all optimal assignments. Thus, if the admissible graph is not Hamiltonian, no child of this search tree vertex may have a Hamihonian cycle at the AP cost. This allows the AP lower bound to be increased by the minimal strictly positive element of ~ (the smallest nonzero reduced cost). Let a weighted bipartite graph G = (S u T, A) be given with I S I = I T I = n. Then Vi ~ S, j ~ T, define c,j to be the weight of arc (i, j). Let u and v be an optimal solution to the dual of the AP on G. Let f = {(i,, j , ) , (i 2, J2)
. . . . .
(in, J,)}
be a feasible solution to the AP on G. Let G = (S U T, if), where A-= {(i, j ) l c , , - u ~ - v j = O ,
i~S,
j~ T}.
Proposition 1. f is an optimal solution to the AP if and only if f is a perfect matching on G.
Volume 10, Number 3
OPERATIONS RESEARCH LETTERS
Table 1 ~' Cost range = [0, 1000]
100 500 1000 1500 2000 2500 3000
April 1991
500
Root
Total time (sec)
Average APs solved
time (sec~
With DHC
Without DHC
With DHC
Without DHC
0.15 2.44 8.06 18.09 31.56 50.86 63.84
0.92 21.95 47.70 39.32 53.10 136.56 102.38
0.79 23.82 227.32 260.67 690.44 1579.07 769.85 b
84.4 68.0 44.5 5.3 2.0 5.5 1.0
98.9 151.3 905.8 245.9 217.1 273.4 78.6
400
"G"
300
4. 200 '
,./
|
" Results collected on a Sun 4 / 2 8 0 computer. b Average of nine trials, due to one failure (see text). 500
1000
1500
Problem
2000
2500
3000
Size
Proposition 2. Let v(AP) and c,(TSP) denote the values of the optimal solutions of the AP and TSP respectively. Then u(AP) = v(TSP) if and only if
Fig. 1. A T S P / D H C algorithm execution time "~s. problem size, cost range [0, 1000].
is Hamiltonian.
Results for ten problems of each size and cost range were averaged to obtain the data. Without the DHC, the algorithm failed to complete on one 3000 city problem after 6000 seconds. This problem was Hamiltonian at root and solved in 203 seconds with the D H C algorithm. In all but the smallest (100 city) problems, the incorporation of the DHC algorithm leads to a significant reduction in the number of APs solved. When the cost range is low with respect to problem size, the DHC algorithm significantly reduces the total execution time. In fact, for the small cost range, the time to solve the root AP of the search tree accounts for a large fraction of the total time. When. the cost range is much larger than problem
These propositions immediately follow from the equality of the optimal primal and dual objective functions of the AP. One result of Proposition 1 is that the admissible graph implied by any optimal dual solution to the AP contains all optimal assignments. The bound strengthening result follows immediately from Proposition 2.
3. Computational results Tables 1 and 2 show computational results for the A T S P algorithm, and the c o m b i n e d A T S P / D H C algorithm. Using a Sun 4 / 2 8 0 computer with 32 megabytes of memory, we solved ATSPs with random cost matrix elements uniformly drawn from ranges [0, 1000] and [0, 10 000].
5000
4000
Table 2 " Cost range = [0, 10000]
100 500 1000 1500 2000 2500 3000
3000
Root
Total time (sec)
Average APs solved
time (sec)
With DHC
Without DHC
With DHC
Without DHC
0.15 2.63 9.15 20.03 35.95 60.59 88.68
0.93 29.15 276.90 346.64 1505.53 1299.75 1434.82
0.76 26.00 283.13 361.11 1597.73 1763.43 1895.14
96.0 362.9 940.8 349.8 710.9 292.2 323.7
96.0 486,6 1834.6 658.1 2248.9 1776.4 900.1
a Results collected on a Sun 4 / 2 8 0 computer.
2000
1000
•
S 0
I
~ 500
1000
•
i 1500
Problem
I 2000
2500
3000
Size
Fig. 2. ATSP algorithm execution time vs. problem size, cost range [0, 1000]. 175
Volume 10, Number 3
OPERATIONS RESEARCH LETTERS
size, the benefits of the D H C algorithm are less substantial. As the tables show, the average execution times and the number of APs solved do not always vary smoothly with problem size. These anomalies are caused by a few problem instances which take much longer than the average time. This variability is evident in Figures 1 and 2, which show execution time with and without the D H C algorithm for the [0, 1000] cost range. Note the order of magnitude difference in scale between Figures 1 and 2. Since the AP lower bounds are very strong [7], the strengthening of the lower bound due to Proposition 2 is often sufficient to prune a branch in the search tree. In addition, the detection of a Hamiltonian cycle allows a search tree branch to be terminated. Hence both failure and success of the DHC algorithm to detect a Hamiltonian cycle can lead to a reduction in the size of the search tree. This advantage is somewhat offset by the cost of executing the D H C algorithm before branching every search tree vertex.
4. Conclusions Exploitation of admissible graph Hamiltonicity improves the performance of an exact ATSP algorithm on problems with cost matrix elements drawn from a uniform distribution of integers. The degree of improvement depends on the rat(o of problem size to the range of cost matrix elements. When this ratio is large, the improvement is dramatic, while negligible improvement or a slight deterioration occurs when this ratio is small. As this grows, it reaches a threshold where solving an ATSP is no more difficult than determining the Hamiltonicity of the admissible graph associated with the corresponding AP. Computational results suggest this threshold is about 3 for randomly generated problems with uniformly distributed cost elements. The embedded D H C algorithm improves performance by reducing the number of APs that must be solved in the course of determining an optimal ATSP solution. The reduction in
176
April 1991
the number of APs solved offsets the extra effort involved with using an exact D H C algorithm.
Note added in proof Results in this paper do not take advantage of matrix sparsification as do the algorithms reported in later papers [7,8]. Thus execution times reported here are longer than identically sized problems in [7,8]. The ratio of times with/without D H C are comparable in the later algorithms. In combination with matrix sparsification, use of the D H C substantially extends the size of random problems which may be solved.
References [1] E. Balas and P. Toth, "Branch and bound methods", in: The Traveling Salesman Problem: A Guided Tour of Combinatorial Optimization, E.L. Lawler, J.K. Lenstra, A.H.G. Rinnooy Kan and D.B. Shmoys (eds.), Wiley, New York, 1985, 361-701. [2] E. Balas, D.L. Miller, J.F. Pekny and P. Toth, "A parallel shortest path algorithm for the assignment problem", J. ACM, in press, 1991. [3] V. Chvatal, "Harniltonian cycles", in: The Traveling Salesman Problem: A Guided Tour of Combinatorial Optimization, E.L. Lawler, J.K. Lenstra, A.H.G. Rinnooy Kan and D.B. Shmoys (eds.), Wiley, New York, 1985, 403-429. [4] G.B. Dantzig, D.R. Fulkerson and S.M. Johnson, "Solution of a large-scale Taveling Salesman Problem", Operations Research 2, 393-410 (1954). [5] A.M. Frieze, "An algorithm for finding Hamilton cycles in random directed graphs", Journal of Algorithms 9, 181-204 (1988). [6] E.L. Lawler, J.K. Lenstra, A.H.G. Rinnooy Kan and D.B. Shmoys (eds.), The Traveling Salesman Problem: A Guided Tour of Combinatorial Optimization, Wiley, New York, 1985. [7] D.L. Miller and J.F. Pekny, "Exact solution of large asymmetric traveling salesman problems", Science 251, 754-761 (1991). [8] J.F. Pekny and D.L. Miller, "A parallel branch and bound algorithm for solving large Asymmetric Traveling Salesman Problems", Math. Prog., in press, 1991. [9] D. Stodolsky, J.F. Pekny and D.L. Miller, "An exact algorithm for finding Hamiltonian circuits in directed graphs", Engineering Design Research Center Report 0525-88, Carnegie Mellon University, Pittsburgh, PA, 1988.