GAMS code for Data Envelopment Analysis

Chapter 1 (Fig. 1.01) – Mathematical formulation of the transportation model and the corresponding GAMS code

$Title Chapter 1 (Fig. 1.1)
$Title Mathematical formulation of the transportation model and the corresponding GAMS code

$onText

If using this code, please cite:

---------------------------------------------------------------------------------
Emrouznejad, A., P. Petridis, and V. Charles (2023). Data Envelopment Analysis
with GAMS: A Handbook on Productivity Analysis, and Performance Measurement,
Springer, ISBN: 978-3-031-30700-3.
---------------------------------------------------------------------------------

Website: https://dataenvelopment.com/GAMS/

$offText

Sets i Plants /Plant1*Plant3/
     j Markets /Market1*Market4/;
Parameter S(i) Supply of plant i
/
Plant1 150
Plant2 100
Plant3 250/;

Parameter D(j) Demand of market j
/
Market1 100
Market2 100
Market3 200
Market4 100/;

Table c(i,j) unit transportation cost
        Market1 Market2 Market3 Market4
Plant1   0.54    0.32     0.1    0.29
Plant2   0.3     0.78     0.76   0.27
Plant3   0.44    0.19     0.61   0.97;


Variables
TC Total cost

Nonnegative variables
x(i,j) quantity transported from plant i to market j

Equations
TotalCost objective function
Supply(i) supply constraint
Demand(j) demand constraint;

TotalCost.. TC=E=SUM(i,SUM(j,c(i,j)*x(i,j)));

Supply(i).. SUM(j,x(i,j))=L=S(i);
Demand(j).. SUM(i,x(i,j))=G=D(j);

Model Transportation_example /All/
Solve Transportation_example min TC using LP
Display TC.l, x.l, x.m;