dantzig fulkerson

Upload: ricardogonzalez6070

Post on 06-Apr-2018

233 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/2/2019 Dantzig Fulkerson

    1/19

    SOLUTION OF A LARGE-SCALE TRAVELING-SALESMANPROBLEM*G DAN TZIG, R FULK ERSO N, AND S JOHNSON

    The Rand Corporation, Santa Monica, California(Received August 9, 1954)

    It is shown that a certain tour of 49 cities, one in each of the 48 states andW ashington, D C , has the shortest road distance

    THE TRAVELING-SALESMAN PROBLEM might be described asfollows: Find the shortest route (tour) for a salesman starting from agiven city, visiting each of a specified group of cities, and then returning tothe original point of depa rture . More generally, given an n by n sym-metric matrix D={d,j), where du represents the 'distance' from / to J,arrange the points in a cyclic order in such a way that the sum of the dubetween consecutive points is minimal. Since there are only a finitenumber of possibilities (at most 3>'2 ( 1)0 to consider, the problem isto devise a method of picking out the optimal arrangement which isreasonably efficient for fairly large values of n. Although algorithms havebeen devised for problems of similar nature, e.g., the optimal assignmentproblem,''** little is known about the traveling-salesman problem. Wedo not claim th at this note alters the situation very m uch; what we shall dois outline a way of approaching the problem that sometimes, at least, en-ables one to find an optimal pa th and prove it so. In particular, it will beshown that a certain arrangement of 49 cities, one m each of the 48 statesand W ashington, D . C , is best, the du used representing road distances astaken from an atlas.

    * HISTORICAL NOTE- Th e origin of this problem is som ewhat obsc ure. Itappears to have been discussed informally among mathematicians at mathematicsmeetings for m an y yea rs. Sur prising ly little in the way of resu lts has appeare d inthe ma them atical l i terature . '" I t may be tha t the minimal-distance tour problemwas stimulated by the so-called Hamiltonian game' which is concerned with findingthe num ber of different to urs possible over a specified netwo rk Th e la tte r problemis cited by some as the origin of group theory and has some connections with thefamou8 Fou r-Co lor Co njecture ' M errill Flood (Colum bia Un iversitj ') sho uld becredited with stimulating interest in the traveling-salesman problem in many quar-ters. As early as 193 7, he tried t o obtain near optim al solutions in reference to

  • 8/2/2019 Dantzig Fulkerson

    2/19

    394 DANTZIG, FULKERSON, AND JOHNSONIn order to try the method on a large problem, the following set of 49cities, one in each state and the District of Columbia, was selected:

    1. M anchester , N H .2. Montpelier , Vt.3. Detroi t , Mich.4. Cleveland, Ohio5 Charleston, W Va6. Louisville, Ky.7. Indianapolis , Ind.8. Chicago, 1119. Milwaukee, Wis10 Minneapolis, Minn.11. Pierre, S. D.

    12. Bismarck, N. D.13 Helena, Mont.14 Sea ttle, W ash.15. Portland, Ore.16. Boise, Idaho17. Salt Lake City, Utah

    18 Carson City, Nev.192021.

    Los Angeles, Calif.Phoenix, ArizSanta Fe , N M,22 Denv er, Colo.23. Cheyenne, Wyo.24 Omaha, Neb25. Des Moines, Iowa26. Kansas Cit^-, Mo.27. Topeka , Kans .28 Oklahom a City , Okla29. Dallas, Tex.30 . Litt le Rock, Ark.31. Memphis , Tenn.32 Jackson, M iss.33 New Orleans, La.

    34 Birmingham , Ala.35 . Atlanta , Ga36. Jacksonvil le , Fla.37. Columbia, S C.38 Raleigh , N C.39 . Richmond, Va40. Washington, D. C.41 . Boston, Mass42 . Port land, Me.A. Balt imore, Md.B Wilmington, De l.C Phi ladelphia , Penn.D . Newark, N. JE New York, N . YF Har t ford, Conn.G. Providence, R. I .

    The reason for picking this particular set was that most of the roaddistances between them were easy to get from an atlas . The triangulartable of distances between these cities (Table I) is part of the original oneprepared by Bernice Brown of The Rand Corporation. It gives dij =Vii (c?jj 11),* (^,^ = 1, 2, , 42), where d'u is the road distance in milbetween I and J . The du have been rounded to the nearest integerCertainly such a linear transformation does not alter the ordering of thetour lengths, although, of course, rounding could cause a tour that wasnot optimal in terms of the original mileage to become optimal in terms ofthe adjusted units used in this paper.We will show th at the tour (see Fig . 16) through the cities 1,2, , 4in this order is minimal for th is subset of 42 cities. Moreover, since indriving from city40 (Washington, D. C.) to city4 1 (Boston, M assachusetts)by the shortest road distance one goes through A, B, , G, successivelit follows that the tour through 49 cities 1, 2, , 40, A, B, , G, 42 in that order is also optimal.

    PRELIMINARY NOTIONSWhenever the road from I to J (in that order) is traveled, the value

    x',j = l is entered into the I,J element of a matrix; otherwise Xij=O isentered . A (directed) tour through n cities can now be thought of as a

  • 8/2/2019 Dantzig Fulkerson

    3/19

    JlzQto0

    '*^ztoa

    1aPQto

    DiSTAK

    mXT.~ -

    ie

    -aS3Cied

    a.GQp

    ^a;fe

    belea

    s

    a3

    , ^

    Th

    befi

    ra>cOJsi

    roundedo

    aC3

    divid

    0Mc* O- c

    O O ooC O - ococs -.)-- - CO Tl- COd ^OO CTN^O

    ^ ^ aN\o CJ ' ^ j r id CO ""^ CO -^ ^-n\O

    CO ^ ''^00 oo i"^r^ *-/~t'o oo

    OS

    d to- " ct

    d d d CO ^d CO')- T^C^ -.(- covDr-osovd r-c< CO ^ "J- ^

    VO OV O\ 0 dCO xf VO VO v o

    VC r-'QO c ^VO P-IP-So?v g v S v ^ ^ ^oo 00 O^ O w

    ^ 0OC?^0^^^^^'-'O^*^O^0oa^c^ co^O -o OCO '*- '4- CO CO d ^ v o ^ so ^ r- o^ N^ CO CJ oo j ^-^^ ^r ^ r ^^ c^^oo oo "vct cJ w-iso i-o"^ ^ r^oo oooo oo o^ O

    r~*-00 "-ooo cl 1"^ I"^ rt cl "^ f^ O ' - '^^ ^

    -CT\ -'^ 0 cJ - ' ^ f ^ ^ sO ^00 '"o O 'O ' J - ' ^ OV O1 - OOCT---. vnoo CT\OO >- ^ CO rJ c d co co ' ^>-o^

    d d "O CTs O O\ !*> 0 "" 0 t^- ''^^ d "H d co *-' ^1 - \ o ' i - 0 " ^ "^so OOOOO ^-"ONO> c i^o "- U-)^o^^vgSv?^^ r~~- f~-- ^ or--oo O.QO o^' 'O 'NO ^O OO C'"'"o f^oo r'~*oo'

    'j ^o r^^o soCO 'J-^O -+ -+

    VO

    - dd C\O d 00CO C

    C7 "j -i 1- C

    d .- f^ Tj- 0 - d e * "^vo

    oo ' ^ ^ d CO *+

    CO * "^VO VO O\ O

    CO 'sO "^co rt oo r

    R>~ t^oo' ?^ o o

    O ^o d ^- OVO vovo VO >S oo O- vor~.voo oo f~P-vovovovo r-oo

    rTCT\ ? O nv ^ O^O^O O oJ 2^cid'S'S- i"sO r~ C^ c o ^ d 00^ ^ v/-,\o >-/-i00 o

    J o d c o d ' d ^ 4 '4W^- t^ Gi 5^ VO VO^ d 00 ^ - oo dr- r^ r^ r--r- 00 ON

    d ro^O CO r^ *-*"> "O O o^ ONOO O '-

    oo r~ r r -^ oo o

  • 8/2/2019 Dantzig Fulkerson

    4/19

    396 DANTZIG, FULKEBSON, AND JOHNSON71 > 2 th rou gho ut ) . Fo r example , forlow

    = 5, the first matrix displayed be-00001

    10000

    00010

    01000

    00100

    01000

    10000

    00010

    00001

    00100

    is a tour since it represents visiting the cities in the 5-cycle (12 4 3 5),while the other matrix is not a tour since it represents visiting the cities bymean s of tw o sub-cycles (1 2) an d (3 5 4 ) .It is clear that all representations for directed tours satisfy the relations

    The mat r ix may be made in to a triangular array by reflecting the numbersabov e the diagonal in the diagonal. Th e sum of corresp onding eleme nts isdenoted by Xij=Xjj-^Xj,. Then the matr ices above become

    1 0 0 oil1 0 1 0

    2 0 0 0 0 1 -0 0 1 1

    Consequently, the sum along the Kih row plus the sum along the Kthcolumn must now be 2. This may be writtenJJ=K

    >0) (l)This device yields a representation for undirected tours and is the one usedthroughout this paper. Itwill be noted that the second array above doesnot represent a tour but nevertheless satisfies the relation (1).For undirected tours, the symbol Xu will be treated identically withXj, so that we may rewrite (1) as

    2lx,j = 2. ixij>0; 1 = 1,2, ,n; l9^J; xjj^Xji) (2)

    The problem is to find the minimum of the linear form

  • 8/2/2019 Dantzig Fulkerson

    5/19

    THE TRAVELING-SALESMAN PROBLEM 397

    as we have observed, a way to describe tours by more linear re-by (2). This is extremely difficult to do as illus-

    by work of I. Heller^ and H. Kuhn.^ They point out that suchions always exist. However, there seems to be no simple way toand for moderate size n the number of such restraintsto be astronomical. In spite of these difficulties, this paper will

    the techniques we have developed which have been successful inall the problems we have tried by this approach. A surprising

    is the use of only a trivial number of the manyto solve any particular problem. To demonstrate the

    we shall attempt to use direct elementary proofs even thoughin many places by linear programming

    There are possibly four devices we have used which have greatly re-the effort in obtaining solutions of the problems we have attempted.First of all, we use undirected tours. This seems to simplify the char-

    of the tours when n is small and certainly cuts down theof computation, even for large n. Secondly, and this is decisive,

    do not try to characterize the tours by the complete set of linear re-but rather impose, in addition to (2), just enough linear con-on the Xrj to assure that the minimum of the linear form (3) isby some tour. For the 49-city problem and also for all the

    we have considered, such a procedure has been relativelyto carry through by hand computation. This may be due in part to

    we use a simple symbolism which permits direct representa-of the algebraic relationships and manipulations on a map of thees. This third device speeds up the entire iterative process, makes itto follow, and sometimes suggests new linear restraints that are notto be obtained by less visual methods. Finally, once a tour has been

    is nearly optimal, a combinatorial approach, using theap and listing possible tours which have not yet been eliminated by theon the problem, may be advantageous. This list can

    one would expect, due to the complex inter-of the res train ts. However, except for short discussion in the

    "An Estimation Procediire," this method will not be de-in detail although it has worked out well for all examples we have

  • 8/2/2019 Dantzig Fulkerson

    6/19

    3 9 8 DANTZIG, FULKERSON, AND JOHNSONeliminate this type of solution by imposing the condition that the sum ofXu over all links {I,J) connecting cities in the subset S of ni cities be lesthan rii, i.e., l (4)where the summation extends over all (/,J) with / and J in the ni cities (SFrom (2) we note that two other conditions, each equivalent to (4), ar

    2Z Xu

  • 8/2/2019 Dantzig Fulkerson

    7/19

    THE TRAVELING-SALESMAN PROBLEM 399the problem is to minimize (3) subject only to (2) Sta r t

    a tour which is conjectured to be optimal , obviously (12 3 4 5).X7/, denoted byXu, are .fi2=X23 = X34 = .f45 = :c6i = l

    Xjj = 0. The variables Xu corresponding to links on the t ourcalled 'basic va riab les. ' T h e length of the tour given by the linear(3) for x= x is D(x)=h. There are five equations in (2). Mul-

    by a paramete r TI to be determined, and then subt rac t thefrom (3). T h u s, we are led to71 / nD(x) = 2 2 dijXij S T; { 2 2 Xij2

    V

    of x,j by bu so tha tD{x) = - E buXu+2T. T,. {bu=it,-\-Kj-du) (7)

    the five TTI values so t h a t 5// correspondmg to basic vari- = l) (8)

    e., if the link (/,J) is on the tour in quest ion. N ote th at to solve for thewehave five l inear equations in f ive unknowns.

    If now we set xu =X/j in (7), the n Xubu =0 for all {I,J) and

    D{x)=2T,w, =o. (9)1

    (7) we have finallyD{x)-Dix) = -J^8uXsj. (10)

    i>jr the regular pentagon ri = }^i for 1 = 1, 2, 3, 4, 5 solves (8), and so= }4{l V5)

  • 8/2/2019 Dantzig Fulkerson

    8/19

    400 DANTZIG, FULKERSON, AND JOHNSON

    12

    D 345

    \56108

    \51212

    \810

    \

    1 2 3 4 5F I G U R E 2

    where, as before, calculate the TI by setting 5jj=0 for 5ij correspondito basic variables x,j. The five equations that the TI must satisfy a

    By alternately subtracting and adding these equations one obtains.

    orThe factors ir; which multiply equations (2) to form (10) are calle'potentials.'* There is one such potential associated with each city

    and these are readily computed by working directly on the map of tcities (see Fig. 3).

    FIGURE 3To form other 5^, add the x/ and wj of city / and city J and subtraoff the distance d,j between them . In this case we note tha t except f

    531 = 5 + 5 - 6 = +4 , all the o ther 5u are

  • 8/2/2019 Dantzig Fulkerson

    9/19

    T H E TRAVELING-SALESMAN PROBLEM 4014. Here the maximum value of 6 isto a 3-cycle (1 2 3) and a 2-cycle (4 5) (Fig. 5).This is not a tour, so we add a loop condition which excludes this

    by all tours. In this case X4i0) (11)

    a condition. Accordingly, we start over again using the five(2) and the sixth equation (11). This time we will need sixc variables and it will be convenient to have xu (the one we set equal tothe tour. Thus, the

    F I G U R E 5 F I G U R E 6is as follows: The basic variables have values a:12 =

    = x34 = X46 = X6i= 1, Xi3 = 0. All Other Xu=O. This solution is shown 1116. The presence of an upper bound on X46 or relation (11) is depicted6 by a block symbol on (4, 5). Now we multiply equation5 / 6 \by ire, add it to 23 x/ ( 23 Xi,2 j , subtract the sum fromin

    23 di

    2 3as before. The result is

    5

    = 2 3 ( 1 (12)/ = ihij = iri-\-Trj du except 646 = 5r44-^6 (c?46 ^ e ) .Now determine the six values of ir/ by setting 5/j=0 corresponding toxu:

    5l2 = ^23 = 834 = ^46 = 561 = 613 = 0 , (13)

  • 8/2/2019 Dantzig Fulkerson

    10/19

    402 DANTZIG, FULKERSON, AND JOHNSONWorking down, ir4 = 5, 1^ = 5. Thus, X4+X6=x6+6, so X6=4. Thvalues are shown adjacent to each city in Fig. 7.With these values of wi all remaining Su = (ir,+irjd!j)

  • 8/2/2019 Dantzig Fulkerson

    11/19

    THE TRAVELING-SALESMAN PROBLEM 403u are fixed, the values of the basic variables are uniquely determined.of coefficients of the basic variables is nonsingulartheir determ inan t is non vanishing). Since the xj satisfy a system of

    is the transpose of this matrix, the x/In the six-city case, one may augment(y7>0) (15):45+2/7=1

    0:13 as a basic variable in addition to the basic variables X/j cor-to (/, J) on the tour. Then, letting X7 be the weight associ-the x; satisfy relations in Fig. 9.%

    F I G U R E 10 F I G U R E 11The value of xi = % can be determined from the odd loop (1 2 3)

    and subtracting the equations around the loop.can then be evaluated immediately. In this case, we have,to (14),D(x)-D(x)= -J8ijx,j-Tnyj, (16)

    5/^=0 if Xu isabasic variable and 8ij = ir,+irjdij otherwise.46 = 3, increasing the value of X46 to 6 (while all other nonbasicm the basicD(x)-D{x) = -3e

  • 8/2/2019 Dantzig Fulkerson

    12/19

    404 DANTZIG, FULKERSON, AND JOHNSONthe basic variables be the same as before but include X46 (i.e., the one we sequal to d in Fig. 10). Let x/ for 1, 2, , 8 be the weights assignto these relations respectively in forming D{x)D{x); then the x/ satisfthe relations shown in Fig. 12, where the loop condition (17) is symbolizeby the dotted loop in the figure.

    F I G U R E 13

    The value of xe =2 may be evaluated from the odd loop ( 6 4 3 2by al ternately adding and subt rac t ing the equat ions in x/ shown on thloop. The other xj can then be imm ediately determ ined. Th is t im

    D{x) -D{x) = - E djjXrjrm^m (18)where 6//=0 for Xjj a basic variable and 8ij = iri+Trj du otherwiSince 24 = 1 while all other 81,

  • 8/2/2019 Dantzig Fulkerson

    13/19

    THE TRAVELING-S.\LESMAN PROBLEM 405shown in Fig. 13 and the new solution ior 6 = 1 is a new tour x with lengthD{x)=D{x) l=22, Fig. 14. We may now drop Xu = O from thebasic set of variables (or alternatively Xn) and replace it by xu as a newbasic variable. This yields the relations for w, of Fig. 15. The expressionfor D(x)D{x) is similar to (18). It can now be tested that all 57/

  • 8/2/2019 Dantzig Fulkerson

    14/19

    s

    ii

  • 8/2/2019 Dantzig Fulkerson

    15/19

  • 8/2/2019 Dantzig Fulkerson

    16/19

    4 0 8 DANTZIG, FfLKERSON, AND JOHNSONuse the remaining admissible links. By extending this type of combiatorial argument to the range of values of the 'slack' variables j/jc, itoften possible at an earlier stage of the iterative algorithm to rule out smany of the tours that direct examination of the remaining tours fominimum length is a feasible approach.

    THE 49-CITY PROBLEM*The optimal tour x is shown in Fig. 16. The proof that it is optimal given in Fig. 17. To make the correspondence between the latte r and iprogramming problem clear, we will write down in addition to 42 relationin non-negative variables (2), a set of 25 relations which suffice to provthat D{x) is a minimum for x. We distinguish the following subsets of th

    42 cities:Si=S2 =S3 =S4 =

    U,13,11,(112,41,4 , 2, ,12,

    421,91, 9, 29, 30 ,,231

    ,42|S.,=S6 =S7 =

    113,(13,124,

    14,14,25,15,26,

    ,2311 6 , 1712 7 1 .

    Except for two inequalities which we will discuss in amoment, the programming problem may now be w ritten as the following 65 relations2 x / / = 2 ( / = ! , , 4 2 ) , X 4 i. .< l, X4,2, 2 xjj>2, S xij

  • 8/2/2019 Dantzig Fulkerson

    17/19

    THE TRAVELING-SALESMAN PROBLEM 409.^18,15=1, Xi8,io = l , b u t a l so a ; i9 , i 8= l , a co n t r a d i c t i on . T h e a r g u m en tthat each tour satisfies the second inequality is similar. If a tour x existsw i t h S a , j X 7 j > 4 2 , t h e n c l e a r l y ^2^,22=1, a n d a ls o Xio,q = J'2',28= 1, s in c e b y(a) these are the only links connecting 83 and S3 hav ing non-zero a,j. (SeeFig. 17 to distinguish be twe en basic and non-basic variab les.) M ore -over, since a26,26 = O, it follows from (b) th a t .r26,io = 3-26,24 = a-27,26 = X28,2-. = l .Again, (b) and the fact that a^ 21 = 0 imply 0-2120 = 3-22,21 = 1 Now look atcity 27. Th ere are thr ee possibilities: X27 24 = 1, "27 22 = 1, or a-28 27 = 1 B ueach of these contradicts the assumption that i is a tour.These relations were imposed to cut out fractional solutions whichsatisfy all th e conditions (2) an d (4). A pictu re of such a fractionalsolution, which gives a smaller value for the minimizing form than doesany tou r, is shown in Fig . 18. N otice th a t it does not satisfy re lation 67.

    FIG 18. A fractional solu tion x satisfying all loop conditions with

    We assert that if the weights x/ are assigned to these restraints in theorder presented above, then the values as given in Fig. 17 satisfy 8ij=0for all variables Xu in the basis. W ith these values of x; in the expressionfor D(x)D{x), all Sij

  • 8/2/2019 Dantzig Fulkerson

    18/19

    4 1 0 DANTZIG, FULKERSON, AND JOHNSONIt can be shown by introducing all links for which 5//> 3'^ that x

    is the unique minimum. There are only 7 such links in addition to thoseshown in Fig. 17, and consequently all possible tying tours were enumerated without too much trouble. None of them proved to be as good as x

    CONCLUDING REMARKIt is clear that we have left unanswered practically any question one

    might pose of a theoretical nature concerning the traveling-salesmanproblem; however, we hope that the feasibility of attacking probleminvolving a moderate number of points has been successfully demonstrated, and that perhaps some of the ideas can be used in problems ofsimilar nature.

    REFERENCES1. W. W. R. B A L L , Mathematical Recreations and Essays, as rev. by H. S. Co.xeter, 11th ed., Macmillan, New York, 1939.2 G. B. DA NTZIG, A. ORDEN, AND P. W O L F E , The Generalized Simplex Methfor Minimizing a Linear Form under Linear Inequality Restraints, RandResearch M emorandum RM-1264 (A pril 5, 1954).3. G. B. DANTZIG, "A pplication of the Simplex Method to a TransportationProblem," Activity Analysis of Production and Allocation, T. C. Koopma

    Ed , Wiley, New York, 1951.4. I. H E L L E R , '"On the Problem of Shoitest Path Between Points," I and I(abstract). Bull. Am. Math. Soc. 59, 6 (November, 1953).5. T. C. KooPMA Nb, "A Model of Transportation," Activity Analysis of Prodution and Allocation, T. C. Koopmans, Ed., Wiley, New Y ork, 1951.6. H. W. KuHN, "The Traveling-Salesman Problem," to appear in the ProcSixth Symposium in Applied Mathematics of the A merican M athematicSociety, McGraw-H ill, New Yo rk.7. D. F. VoTAW AND A. ORDEN, "Personnel A ssignment Problem," Symposiuon Linear Inequalities and Programming, Comptroller, Headquarters U.A ir Force (June 14-16, 1951).8. J. VON NEUM ANN, "A Certain Zero-sum Two-person Game Equivalent to thOptimal A ssignment Problem," Contributions to the Theory of GamesPrinceton University Press, 1953.9. W. T. TuTTE, "On Ham iltonian C ircuits," London Mathematical Society JourXXI, Par t 2, N o. 82, 98-101 (A pril, 1946).10. S. VEEBLtrNSKY, "On the Shortest Path Through a Number of Points," ProcAm. Math. Soc. II, 6 (December, 1951).

  • 8/2/2019 Dantzig Fulkerson

    19/19