! Standard fixed charge transportation problem;
! Keywords: Fixed charge, Transportation problem;
SETS:
source: capacity, fixedcost, open;
dest: demand;
sxd( source, dest): costpu, ship;
ENDSETS DATA:
! Sources of production;
source = PLANT01 PLANT02 PLANT03;
! Capacity of each source;
capacity = 1200 1800 1500;
! Fixed cost if we ship anything from source;
fixedcost= 1800 1900 1700;
! Destinations;
dest = CUST01 CUST02 CUST03 CUST04;
! Demand at each destination;
demand = 600 700 500 550;
! Cost per unit shipped from each source to each destination;
costpu = 9 8 6 7
5 7 8 6
6 5 9 8;
ENDDATA
! Variables:
open( s) = 1 is source s is used (or open), else 0,
i.e., it is a binary variable,
ship( s, d) = amount shipped from source s to destination d;
! LINGO assumes by default that all variables are >= 0;
! minimize fixed cost + shipping costs;
min = fctot + sctot;
fctot = @SUM( source( s): fixedcost( s)* open(s));
sctot = @SUM( sxd( s, d) : costpu( s, d)* ship( s, d));
@FOR( source( s):
@bin( open( s)); ! Source is either used (1) or not used (0);
! Cannot ship more than installed capacity from source s;
@SUM( sxd( s, d): ship( s, d)) <= capacity( s)* open(s);
);
@FOR( dest( d):
! Must satisfy demand at each destination d;
@SUM( sxd( s, d): ship( s, d)) = demand( d);
);
|