$TITLE Newspaper Distribution SETS I locations including pizza store / I1*I8 / A(I,I) ARCS /I1.(I2*I8),(I2*I8).(I2*I8)/ ALIAS(I,J); PARAMETERS DEMAND(I) represents the demands of all locations /I1 -10 I2 1 I3 1 I4 2 I5 1 I6 3 I7 1 I8 1 / TABLE COST(I,I) I1 I2 I3 I4 I5 I6 I7 I8 I1 0 12 15 7 20 15 5 14 I2 0 0 2 5 7 12 11 18 I3 0 2 0 4 5 10 9 16 I4 0 5 4 0 3 6 2 10 I5 0 9 10 3 0 6 4 10 I6 0 12 10 6 6 0 3 5 I7 0 11 9 2 4 3 0 3 I8 0 18 16 10 10 5 3 0 ; SCALARS FIXED fixed cost associated with each delivery trip /.557/ ORDER the current number of orders /10/ ; VARIABLES X(I,I) 0 or 1 depending on whether arc is used Y(I,I) amount shipped from I to J Z total cost; BINARY VARIABLE X; POSITIVE VARIABLE Y; EQUATIONS OBJ total cost of shipping FLOW total demand is satisfied MEET only one driver can meet the demand of each customer LEAVE only one driver can leave the pizza store BACK no truck can return to the pizza store RESTRICT force variable to 0; OBJ.. Z =E= SUM((I,J), COST(I,J)*X(I,J))+SUM(J,X('I1',J))*FIXED; FLOW(J)..SUM(I,Y(I,J)$A(I,J)- Y(J,I)$A(J,I))=E=DEMAND(J); MEET(J)$(ORD(J) NE 1).. SUM(I,X(I,J)$A(I,J)) =E= 1; LEAVE(I)$(ORD(I) NE 1).. SUM(J,X(I,J)$A(I,J)) =L= 1; BACK('I1').. SUM(I,X(I,'I1')) =L= 0; RESTRICT(I,J).. Y(I,J) =L= ORDER*X(I,J); MODEL TRANSPORT /ALL/; OPTION MIP=CPLEX; TRANSPORT.OPTFILE=1; SOLVE TRANSPORT MINIMIZING Z USING MIP; DISPLAY Y.L,X.L;