Professional Documents
Culture Documents
1d
1. Straightforward formulation: Let xit = 1 if load i is assigned to trailer t, o otherwise Li = linear feet of load i ri = revenue from load i
10 2 i it
M axim ize z =
10
rx
i =1 t =1
subject to
Lx
i i =1 2
it
36, t = 1, 2
x
t =1
it
2. Formulation using if-then: Let xit = feet in trailer t assigned to load i yi = (0, 1), i = 1, 2, , 10, wit = (0, 1), i = 1, 2, ..., 10, t = 1, 2
10 2
x
i =1
it
36, t = 1, 2
xi1 Li yi , xi 2 Li (1 yi ), i = 1, 2,...,10 (above constraint is not as efficient as xi1 + xi 2 1, i = 1, 2,...,10 in formulation 1) (if xit > 0 then xit = Li ) translates to xit M (1 wit ), Li xit Mwit , Li + xit Mwit , i = 1, 2,...,10, t = 1, 2 xit , wit , yi = (0,1), i = 1, 2,...,10, t = 1, 2
Solution: z = $7929. Problem has several alternative optima. (See file ampl9.1d-7.txt.) Solution 1 Solution 2 Trailer Load Feet Load Feet 1 1 5 1 5 5 7 2 11 6 9 6 9 8 14 9 10 Total 35 ft Total 35 ft 2 2 11 4 15 4 15 5 7 9 10 8 14 Total 36 ft Total 36 ft
9-14