MODEL:

 ! A 3 Warehouse, 4 Customer Sparse Transportation Problem;

 ! Set members and data are imported from the calling application,
   and the solution is exported back to TRANOLESPARSE.XLS;

 SETS:
    WAREHOUSES: CAPACITY;
    CUSTOMERS: DEMAND;
    ROUTES( WAREHOUSES, CUSTOMERS) : COST, VOLUME;
 ENDSETS

 DATA:
    WAREHOUSES = @POINTER( 1);
    CUSTOMERS  = @POINTER( 2);
    ROUTES     = @POINTER( 3);
    CAPACITY   = @POINTER( 4);
    DEMAND     = @POINTER( 5);
    COST       = @POINTER( 6);
 ENDDATA

 ! The objective;
    [OBJ] MIN = @SUM( ROUTES: COST * VOLUME);

 ! The demand constraints;
    @FOR( CUSTOMERS( J): [DEM]
       @SUM( ROUTES( I, J): VOLUME( I, J)) >= DEMAND( J));

 ! The supply constraints;
    @FOR( WAREHOUSES( I): [SUP]
       @SUM( ROUTES( I, J): VOLUME( I, J)) <= CAPACITY( I));

 DATA:
    @POINTER( 7) = ROUTES;
    @POINTER( 8) = VOLUME;
    @POINTER( 9) = OBJ;
    @POINTER(10) = @STATUS();
 ENDDATA

 END