Plant Location Model: CAPLOC
In this example, we build a model to help decide what plants to open and how much product to ship from each plant to each customer. A detailed discussion of this model may be found in Developing More Advanced Models.
MODEL:
! Capacitated Plant Location Problem;
SETS:
PLANTS: FCOST, CAP, OPEN;
CUSTOMERS: DEM;
ARCS( PLANTS, CUSTOMERS) : COST, VOL;
ENDSETS
DATA:
! The plant, their fixed costs
and capacity;
PLANTS, FCOST, CAP =
P1 91 39
P2 70 35
P3 24 31;
! Customers and their demands;
CUSTOMERS, DEM =
C1 15
C2 17
C3 22
C4 12;
! The plant to cust cost/unit
shipment matrix;
COST = 6 2 6 7
4 9 5 3
8 8 1 5;
ENDDATA
! The objective;
[TTL_COST] MIN = @SUM( ARCS: COST * VOL) +
@SUM( PLANTS: FCOST * OPEN);
! The demand constraints;
@FOR( CUSTOMERS( J): [DEMAND]
@SUM( PLANTS( I): VOL( I, J)) >= DEM( J)
);
! The supply constraints;
@FOR( PLANTS( I): [SUPPLY]
@SUM( CUSTOMERS( J): VOL( I, J)) <=
CAP( I) * OPEN( I)
);
! Make OPEN binary(0/1);
@FOR( PLANTS: @BIN( OPEN));
END
Model: CAPLOC