Transport optimization model

Problems with syntax of GAMS
Post Reply
Daniel Figueroa
Posts: 1
Joined: 1 year ago

Transport optimization model

Post by Daniel Figueroa » 1 year ago

I got a problem with a transport optimization model exercise. This is the problem to solve:

A company dedicated to the distribution of olive oil should send 30 tons to Madrid, 40 to Barcelona, ​​20 to Valencia and 10 to Bilbao. This company supplies in Badajoz, Cáceres and Jaén, whose availabilities are of 35, 25 and 20 tons, respectively. The costs in euros of sending one tonne of the promotional places to the destinations are:

Madrid Barcelona Valencia Bilbao
Badajoz 10 15 20 9
Cáceres 6 7 10 15
Jaén 15 20 25 30

For each tonne not received at the points of destination, the company has losses of 5, 8, 6 and 4 €, respectively. The company wants to minimize the total cost of the distribution of the merchandise. How could the optimal distribution be made? Formulate an optimization model for this problem.

so, i do not know how to solve the problem in bold, my question for you is how i syntax the cost restriction for the missing tons. it would be great if you could help me to solve it.


$Title The transportation problem


i distributions center /c1, c2, c3 /
j cities /m1, m2, m3, m4 /;

Table d(i,j) cost transport €

m1 m2 m3 m4
c1 10 15 20 9
c2 6 7 10 15
c3 5 20 25 30;


a(i) capacity of distributions center i in tons
/ c1 35
c2 25
c3 20 /
b(j) demand of cities j in tons
/ m1 30
m2 40
m3 20
m4 10 /


x(i,j) shipment quantities in tons
z total cost transpor in €;
positive variable x;

cost objetive function
supply(i) meet supply limit at centers i
demand(j) satisfy demand at cities j;

cost.. z =e= sum((i,j), d(i,j)*x(i,j));
supply(i) .. sum(j,x(i,j)) =l= a(i);
demand(j) .. sum(i,x(i,j)) =g= b(j);
model transport /all/;
solve transport using lp minimizing z;

Post Reply