The Constraints
There are two sets of constraints in the model:
1. | each customer must be sent enough product to satisfy demand, and |
2. | each plant can't supply more than its capacity. |
The following expression guarantees each customer receives the quantity of product demanded:
! The demand constraints;
@FOR( CUSTOMERS( J): [DEMAND]
@SUM( PLANTS( I): VOL( I, J)) >= DEM( J)
);
For each customer, we sum the amount being shipped to that customer and set it to be greater than or equal to the customer's demand.
To limit shipments from a plant to the plant's capacity, we use:
! The supply constraints;
@FOR( PLANTS( I): [SUPPLY]
@SUM( CUSTOMERS( J): VOL( I, J)) <=
CAP( I) * OPEN( I)
);
For each plant, we sum up the amount being shipped from the plant and set this quantity to be less than or equal to the plant's capacity multiplied by the plant's 0/1 OPEN indicator. Note that in order for the plant to be able to ship any quantity of product, the OPEN binary variable will be forced to 1 by these constraints.