MODEL:
! A generic transportation Problem;
! Keywords: Transportation model;
SETS:
! The SETS section describes the general data structure;
   SUPPLIER : CAPACITY; ! Each supplier has a capacity;
   CUSTOMER : DEMAND;   ! Each customer has a demand;
! A combination of supplier/customer has a 
     cost/unit shipped and amount shipped;
   LINK( SUPPLIER, CUSTOMER): COST, VOLUME;
ENDSETS
! The objective; MIN = @SUM( LINK( I, J): COST( I, J) * VOLUME( I, J)); ! The capacity constraints. Volume shipped out of I must be <= supply at I; @FOR( SUPPLIER( I): @SUM( LINK( I, J): VOLUME( I, J)) <= CAPACITY( I)); ! The demand constraints. Volume shipped into J must equal demand at J; @FOR( CUSTOMER( J): @SUM( LINK( I, J): VOLUME( I, J)) = DEMAND( J)); ! Here are the data for a specific instance; DATA: SUPPLIER = WH1 WH2 WH3 WH4 WH5 WH6; CAPACITY = 60 55 51 43 41 52; CUSTOMER = V1 V2 V3 V4 V5 V6 V7 V8; DEMAND = 35 37 22 32 41 32 43 38; COST = 6 2 6 7 4 2 5 9 4 9 5 3 8 5 8 2 5 2 1 9 7 4 3 3 7 6 7 3 9 2 7 1 2 3 9 5 7 2 6 5 5 5 2 2 8 1 4 3; ! You can get the data from and store results to a spreadsheet with the @OLE() statement, or a SQL database with the @ODBC() statement; ENDDATA END