Formulatng & Solvng Integer Problems Chapter 11 289 The Optonal Stop TSP If we drop the requrement that every stop must be vsted, we then get the optonal stop TSP. Ths mght correspond to a ob sequencng problem where v s the proft from ob f we do t and c s the cost of swtchng from ob to ob. Let: y = 1 f cty s vsted, 0 otherwse. If v s the value of vstng cty, then the obectve s: Mnmze The constrant sets are: c x v y. (1) Each cty can be vsted at most once x = y (2) If we enter cty, then we must ext t: xk = y k (3) No subtours allowed for each subset, S, of ctes not ncludng the home base 1. x < S 1, where S s the sze of S., S For example, f there are n ctes, ncludng the home base, then there are (n 1) (n 2)/(3 2) subsets of sze 3. (4) Alternatvely, (3) may be replaced by u > u + 1 (1 x )n for = 2, 3,..., n. Effectvely, u s the sequence number of cty n ts tour. Constrant set (3) s much tghter than (4). 11.6.3 Capactated Multple TSP/Vehcle Routng Problems An mportant practcal problem s the routng of vehcles from a central depot. An example s the routng of delvery trucks for a metropoltan newspaper. You can thnk of ths as a multple travelng salesperson problem wth fnte capacty for each salesperson. Ths problem s sometmes called the LTL(Less than TruckLoad) routng problem because a typcal recpent receves less than a truck load of goods. A formulaton s: Gven: V = capacty of a vehcle d = demand of cty or stop Each cty,, must be vsted once for > 1: x = 1
290 Chapter 11 Formulatng & Solvng Integer Programs Each cty > 1, must be exted once: x = 1 No subtours: x < S 1,, s No overloads: For each set of ctes T, ncludng 1, whch consttute more than a truckload: x < T k,, T where k = mnmum number of ctes that must be dropped from T to reduce t to one load. Ths formulaton can solve to optmalty modest-szed problems of say, 25 ctes. For larger or more complcated practcal problems, the heurstc method of Clarke and Wrght (1964) s a standard startng pont for quckly fndng good, but not necessarly optmal, solutons. The followng s a generc LINGO model for vehcle routng problems: MODEL:! (VROUTE);! The Vehcle Routng Problem (VRP) occurs n many servce systems such as delvery, customer pck-up, repar and mantenance. A fleet of vehcles, each wth fxed capacty, starts at a common depot and returns to the depot after vstng locatons where servce s demanded. Problems wth more than a dozen ctes can take lots of tme. Ths nstance nvolves delverng the requred amount of goods to 9 ctes from a depot at cty 1; SETS: CITY/ Ch Den Frsn Hous KC LA Oakl Anah Peor Phnx/: Q, U;! Q(I) = amount requred at cty I(gven), must be delvered by ust 1 vehcle. U(I) = accumulated delveres at cty I ; CXC( CITY, CITY): DIST, X;! DIST(I,J) = dstance from cty I to cty J X(I,J) s 0-1 varable, = 1 f some vehcle travels from cty I to J, else 0 ; ENDSETS DATA:! cty 1 represents the common depot,.e. Q( 1) = 0; Q= 0 6 3 7 7 18 4 5 2 6;
Formulatng & Solvng Integer Problems Chapter 11 291! dstance from cty I to cty J s same from J to I, dstance from cty I to the depot s 0, because vehcle need not return to the depot ; DIST=! To Cty;!Ch Den Frsn Hous KC LA Oakl Anah Peor Phnx From; 0 996 2162 1067 499 2054 2134 2050 151 1713! Chcago; 0 0 1167 1019 596 1059 1227 1055 904 792! Denver; 0 1167 0 1747 1723 214 168 250 2070 598! Fresno; 0 1019 1747 0 710 1538 1904 1528 948 1149! Houston; 0 596 1723 710 0 1589 1827 1579 354 1214! K. Cty; 0 1059 214 1538 1589 0 371 36 1943 389! L. A.; 0 1227 168 1904 1827 371 0 407 2043 755! Oakland; 0 1055 250 1528 1579 36 407 0 1933 379! Anahem; 0 904 2070 948 354 1943 2043 1933 0 1568! Peora; 0 792 598 1149 1214 389 755 379 1568 0;! Phoenx;! VCAP s the capacty of a vehcle ; VCAP = 18; ENDDATA!----------------------------------------------------------;! The obectve s to mnmze total travel dstance; MIN = @SUM( CXC: DIST * X);! for each cty, except depot...; @FOR( CITY( K) K #GT# 1:! a vehcle does not travel nsde tself,...; X( K, K) = 0;! a vehcle must enter t,... ; @SUM( CITY( I) I #NE# K #AND# ( I #EQ# 1 #OR# Q( I) + Q( K) #LE# VCAP): X( I, K)) = 1;! a vehcle must leave t after servce ; @SUM( CITY( J) J #NE# K #AND# ( J #EQ# 1 #OR# Q( J) + Q( K) #LE# VCAP): X( K, J)) = 1;! U( K) = amount delvered on trp up to cty K >= amount needed at K but <= vehcle capacty; @BND( Q( K), U( K), VCAP);! If K follows I, then can bound U( K) - U( I); @FOR( CITY( I) I #NE# K #AND# I #NE# 1: U( K) >= U( I) + Q( K) - VCAP + VCAP*( X( K, I) + X( I, K)) - ( Q( K) + Q( I)) * X( K, I); );! If K s 1st stop, then U( K) = Q( K); U( K) <= VCAP - ( VCAP - Q( K)) * X( 1, K);! If K s not 1st stop...; U( K) >= Q( K)+ @SUM( CITY( I) I #GT# 1: Q( I) * X( I, K)); );! Make the X's bnary; @FOR( CXC( I, J): @BIN( X( I, J)) ;);! Must send enough vehcles out of depot; @SUM( CITY( J) J #GT# 1: X( 1, J)) >= @FLOOR((@SUM( CITY( I) I #GT# 1: Q( I))/ VCAP) +.999); END
292 Chapter 11 Formulatng & Solvng Integer Programs Optmal soluton found at step: 973 Obectve value: 6732.000 Varable Value X( CHI, HOUS) 1.000000 X( CHI, LA) 1.000000 X( CHI, PEOR) 1.000000 X( CHI, PHNX) 1.000000 X( DEN, CHI) 1.000000 X( FRSN, OAKL) 1.000000 X( HOUS, CHI) 1.000000 X( KC, DEN) 1.000000 X( LA, CHI) 1.000000 X( OAKL, CHI) 1.000000 X( ANAH, FRSN) 1.000000 X( PEOR, KC) 1.000000 X( PHNX, ANAH) 1.000000 By followng the lnks, you can observe that the trps are: Chcago - Houston; Chcago - LA; Chcago - Peora - KC - Denver; Chcago - Phoenx - Anahem - Fresno - Oakland. Combned DC Locaton/Vehcle Routng Frequently, there s a vehcle routng problem assocated wth openng a new plant or dstrbuton center (DC). Specfcally, gven the customers to be served from the DC, what trps are made, so as to serve the customers at mnmum cost. A complete soluton to the problem would solve the locaton and routng problems smultaneously. The followng IP formulaton llustrates one approach: Parameters F = fxed cost of havng a DC at locaton, C = cost of usng route, a k = 1 f route orgnates at DC and serves customer k. There s exactly one DC assocated wth each route. Decson varables y = 1 f we use DC, else 0, x = 1 f we use route, else 0 The Model Mnmze F y + c x subect to (Demand constrants) For each customer k: a k x = 1 (Forcng constrants) For each DC and customer k: a k x y
Formulatng & Solvng Integer Problems Chapter 11 293 11.6.4 Mnmum Spannng Tree A spannng tree of n nodes s a collecton of n 1 arcs, so there s exactly one path between every par of nodes. A mnmum cost spannng tree mght be of nterest, for example, n desgnng a communcatons network. Assume node 1 s the root of the tree. Let x = 1 f the path from 1 to goes through node mmedately before node, else x = 0. A formulaton s: Mnmze subect to c x (1) x = n 1, (2) x < S 1 for every strct subset S of {1, 2,,n},, S x = 0 or 1. An alternatve to (1) and (2) s the followng set of constrants based on assgnng a unque sequence number u to each node: x 1, for = 2, 3, 4,,n, u > u + x (n 2) (1 x )+(n-3)x, for = 2, 3, 4,..., n. u > 0. In ths case, u s the number of arcs between node and node 1. A numerc example of the sequence numberng formulaton s n secton 8.9.8. If one has a pure spannng tree problem, then the greedy algorthm of Kruskal (1956) s a fast way of fndng optmal solutons. 11.6.5 The Lnear Orderng Problem A problem superfcally smlar to the TSP s the lnear orderng problem. One wants to fnd a strct orderng of n obects. Applcatons are to rankng n sports tournaments, product preference orderng n marketng, ob sequencng on one machne, orderng of ndustres n an nput-output matrx, orderng of hstorcal obects n archeology, and others. See Grötschel et al. (1985) for a further dscusson. The lnear orderng problem s smlar to the approach of conont analyss sometmes used n marketng. The crucal nput data are cost entres c. If obect appears anywhere before obect n the proposed orderng, then c s the resultng cost. The decson varables are: The problem s: x = 1 f obect precedes obect, ether drectly or ndrectly for all. Mnmze c x subect to (1) x + x = 1 for all