GAMS 24.3.3  r48116 Released Sep 19, 2014 WEX-WEI x86 64bit/MS Windows 04/01/00 13:47:38 Page 1
G e n e r a l   A l g e b r a i c   M o d e l i n g   S y s t e m
C o m p i l a t i o n


   1  SETs
   2   
   3  i indexes of plants /seattle, san-diego/
   4  j indexes of markets /new-york, chicago, topeka/   ;
   5   
   6  PARAMETERS
   7  a(i)   capacity of plant i
   8  /    seattle    350
   9       san-diego  600
  10  /
  11   
  12  b(j)   demand of market j
  13  /    new-york 325
  14       chicago  300
  15       topeka   275
  16  /
  17  ;
  18   
  19  Table d(i,j)  distance in thousands of miles
  20               new-york       chicago       topeka
  21  seattle      2.5            1.7           1.8
  22  san-diego    2.5            1.8           1.4 ;
  23   
  24   
  25  Scalar f frieght in dollars per cases per thousand miles /90/;
  26   
  27  parameters c(i,j)  transportation costs in thousands of dollars per case ;
  28  c(i,j)= f*d(i,j)/1000;
  29   
  30  Variables
  31   
  32  x(i,j)   shipment quantities in cases
  33  Z        total transportation costs in thousands of dollars ;
  34   
  35  positive variable x ;
  36   
  37  Equations
  38   
  39   
  40  cost        define objective function
  41   
  42  supply(i)   supply limit at plant i
  43   
  44  demand(j)   satisfy demand at market j   ;
  45   
  46   
  47  cost..           z=e= sum((i,j),c(i,j)*x(i,j));
  48  supply(i)..      sum(j,x(i,j))=l=a(i);
  49  demand(j)..      sum(i,x(i,j))=g=b(j);
  50   
  51   
  52  Model TP /all/
  53   
  54  solve TP using lp minimizing z ;
  55   
  56  Display  x.l , z.l ;
  57   
  58   
  59   


COMPILATION TIME     =        0.000 SECONDS      3 MB  24.3.3 r48116 WEX-WEI
GAMS 24.3.3  r48116 Released Sep 19, 2014 WEX-WEI x86 64bit/MS Windows 04/01/00 13:47:38 Page 2
G e n e r a l   A l g e b r a i c   M o d e l i n g   S y s t e m
Equation Listing    SOLVE TP Using LP From line 54


---- cost  =E=  define objective function

cost..  - 0.225*x(seattle,new-york) - 0.153*x(seattle,chicago)
     
      - 0.162*x(seattle,topeka) - 0.225*x(san-diego,new-york)
     
      - 0.162*x(san-diego,chicago) - 0.126*x(san-diego,topeka) + Z =E= 0 ;
     
      (LHS = 0)
     

---- supply  =L=  supply limit at plant i

supply(seattle)..  x(seattle,new-york) + x(seattle,chicago) + x(seattle,topeka)
      =L= 350 ; (LHS = 0)
     
supply(san-diego)..  x(san-diego,new-york) + x(san-diego,chicago)
     
      + x(san-diego,topeka) =L= 600 ; (LHS = 0)
     

---- demand  =G=  satisfy demand at market j

demand(new-york)..  x(seattle,new-york) + x(san-diego,new-york) =G= 325 ;
     
      (LHS = 0, INFES = 325 ****)
     
demand(chicago)..  x(seattle,chicago) + x(san-diego,chicago) =G= 300 ;
     
      (LHS = 0, INFES = 300 ****)
     
demand(topeka)..  x(seattle,topeka) + x(san-diego,topeka) =G= 275 ;
     
      (LHS = 0, INFES = 275 ****)
     
GAMS 24.3.3  r48116 Released Sep 19, 2014 WEX-WEI x86 64bit/MS Windows 04/01/00 13:47:38 Page 3
G e n e r a l   A l g e b r a i c   M o d e l i n g   S y s t e m
Column Listing      SOLVE TP Using LP From line 54


---- x  shipment quantities in cases

x(seattle,new-york)
                (.LO, .L, .UP, .M = 0, 0, +INF, 0)
       -0.225   cost
        1       supply(seattle)
        1       demand(new-york)

x(seattle,chicago)
                (.LO, .L, .UP, .M = 0, 0, +INF, 0)
       -0.153   cost
        1       supply(seattle)
        1       demand(chicago)

x(seattle,topeka)
                (.LO, .L, .UP, .M = 0, 0, +INF, 0)
       -0.162   cost
        1       supply(seattle)
        1       demand(topeka)

REMAINING 3 ENTRIES SKIPPED

---- Z  total transportation costs in thousands of dollars

Z
                (.LO, .L, .UP, .M = -INF, 0, +INF, 0)
        1       cost

GAMS 24.3.3  r48116 Released Sep 19, 2014 WEX-WEI x86 64bit/MS Windows 04/01/00 13:47:38 Page 4
G e n e r a l   A l g e b r a i c   M o d e l i n g   S y s t e m
Model Statistics    SOLVE TP Using LP From line 54


MODEL STATISTICS

BLOCKS OF EQUATIONS           3     SINGLE EQUATIONS            6
BLOCKS OF VARIABLES           2     SINGLE VARIABLES            7
NON ZERO ELEMENTS            19


GENERATION TIME      =        0.000 SECONDS      4 MB  24.3.3 r48116 WEX-WEI


EXECUTION TIME       =        0.000 SECONDS      4 MB  24.3.3 r48116 WEX-WEI
GAMS 24.3.3  r48116 Released Sep 19, 2014 WEX-WEI x86 64bit/MS Windows 04/01/00 13:47:38 Page 5
G e n e r a l   A l g e b r a i c   M o d e l i n g   S y s t e m
Solution Report     SOLVE TP Using LP From line 54


               S O L V E      S U M M A R Y

     MODEL   TP                  OBJECTIVE  Z
     TYPE    LP                  DIRECTION  MINIMIZE
     SOLVER  CPLEX               FROM LINE  54

**** SOLVER STATUS     1 Normal Completion         
**** MODEL STATUS      1 Optimal                   
**** OBJECTIVE VALUE              153.6750

 RESOURCE USAGE, LIMIT          0.078      1000.000
 ITERATION COUNT, LIMIT         4    2000000000

IBM ILOG CPLEX   24.3.3 r48116 Released Sep 19, 2014 WEI x86 64bit/MS Windows 
Cplex 12.6.0.1

Space for names approximately 0.00 Mb
Use option 'names no' to turn use of names off
LP status(1): optimal
Cplex Time: 0.08sec (det. 0.01 ticks)
Optimal solution found.
Objective :         153.675000


                       LOWER     LEVEL     UPPER    MARGINAL

---- EQU cost            .         .         .        1.000      

  cost  define objective function

---- EQU supply  supply limit at plant i

             LOWER     LEVEL     UPPER    MARGINAL

seattle       -INF    350.000   350.000      EPS       
san-diego     -INF    550.000   600.000      .         

---- EQU demand  satisfy demand at market j

            LOWER     LEVEL     UPPER    MARGINAL

new-york   325.000   325.000     +INF      0.225      
chicago    300.000   300.000     +INF      0.153      
topeka     275.000   275.000     +INF      0.126      

---- VAR x  shipment quantities in cases

                      LOWER     LEVEL     UPPER    MARGINAL

seattle  .new-york      .       50.000     +INF       .         
seattle  .chicago       .      300.000     +INF       .         
seattle  .topeka        .         .        +INF      0.036      
san-diego.new-york      .      275.000     +INF       .         
san-diego.chicago       .         .        +INF      0.009      
san-diego.topeka        .      275.000     +INF       .         

                       LOWER     LEVEL     UPPER    MARGINAL

---- VAR Z              -INF    153.675     +INF       .         

  Z  total transportation costs in thousands of dollars


**** REPORT SUMMARY :        0     NONOPT
                             0 INFEASIBLE
                             0  UNBOUNDED
GAMS 24.3.3  r48116 Released Sep 19, 2014 WEX-WEI x86 64bit/MS Windows 04/01/00 13:47:38 Page 6
G e n e r a l   A l g e b r a i c   M o d e l i n g   S y s t e m
E x e c u t i o n


----     56 VARIABLE x.L  shipment quantities in cases

             new-york     chicago      topeka

seattle        50.000     300.000
san-diego     275.000                 275.000


----     56 VARIABLE Z.L                   =      153.675  total transportation 
                                                           costs in thousands of
                                                           dollars


EXECUTION TIME       =        0.000 SECONDS      3 MB  24.3.3 r48116 WEX-WEI


USER: GAMS Development Corporation, Washington, DC   G871201/0000CA-ANY
      Free Demo,  202-342-0180,  sales@gams.com,  www.gams.com   DC0000


**** FILE SUMMARY

Input      C:\Users\Modarres\Documents\gamsdir\projdir\Untitled_1.gms
Output     C:\Users\Modarres\Documents\gamsdir\projdir\Untitled_1.lst
