$TITLE WAREHOUSE LOCATION PROBLEM $OFFUPPER * This problem minimizes cost subject to tradeoffs between * transportation costs and location costs * * References: * The model is taken from pg 369 in Magnanti et al text. SETS I warehouses / W1 * W6 / J customers / CT1 * CT10 / ; PARAMETERS F(I) fixed operating cost for ware house i if opened /W1 99 W2 99 W3 45 W4 96 W5 29 W6 98 / K(I) capacity for warehouse i /W1 94 W2 95 W3 79 W4 99 W5 79 W6 84 / D(J) demand for each customer j /CT1 12 CT2 45 CT3 72 CT4 34 CT5 53 CT6 98 CT7 34 CT8 74 CT9 98 CT10 21 / ; TABLE C(I,J) per unit operating cost at warehouse i plus transportation cost CT1 CT2 CT3 CT4 CT5 CT6 CT7 CT8 CT9 CT10 W1 23 34 45 23 12 23 12 23 28 17 W2 16 47 33 22 28 63 42 27 53 31 W3 52 41 41 41 41 52 36 47 58 61 W4 35 62 62 51 53 14 24 54 16 53 W5 54 13 14 22 34 63 42 52 52 34 W6 53 14 23 41 51 52 34 12 14 14; VARIABLES X(I,J) amount to be sent from warehouse i to customer j Y(I) 0 or 1 indicating if warehouse i is opened Z total costs ; BINARY VARIABLE Y ; POSITIVE VARIABLE X ; EQUATIONS COST define objective function DEMANDS (J) the demands of each customer must be met from the warehouse LOGICAL (I) goods can be shipped only if warehouse is opened ; COST .. Z =E= SUM( I, SUM(J, C(I,J)*X(I,J) ) + F(I)*Y(I) ) ; DEMANDS (J) .. SUM(I, X(I,J) ) =E= D(J) ; * LOGICAL (I) .. SUM(J, X(I,J)) - Y(I) * SUM(J, D(J) ) =L= 0; LOGICAL (I) .. SUM(J, X(I,J)) - Y(I) * K(I) =L= 0; MODEL WAREHOUSE /ALL/ SOLVE WAREHOUSE USING MIP MINIMIZING Z ; DISPLAY X.L, X.M, Y.L, Y.M ; * OPT Z=19869 * * X15=38, X19=56, X26=56, X29=42, * X36=45, X37=34, X41=12, X43=72, * X45=15, X52=34, X54=34, X5,10=10, * X62=10, X68=74