Dear all,
I am trying to solve a transportation problem, in which farmers of a country allocate their grain harvest to some ports for exportation. There
is no problem in optimizing this, except when I introduce some special restrictions.
These restrictions are related with me knowing (for some ports only) the province of origin of the grain they purchase.
Probably it is easier to understand this with the following example:
SETS
farm producers / 1,2,3,4,5,6
/
port demand / 7,8,9,10
/
;
PARAMETERS
yields(farm) production farm in cases
/
1 330
2 540
3 2160
4 1620
5 500
6 250
/
export(port) exportation port in cases
/
7 2000
8 1800
9 1400
10 200
/
;
table d(farm,port) ‘distance of routes’
7 8 9 10
1 2.1 7.0 3.0 3.2
2 0.5 1.1 1.4 1.5
3 1.5 1.7 2.8 0.3
4 3.5 1.3 3.4 0.5
5 2.0 1.0 7.8 5.2
6 2.5 2.8 0.4 3.2
;
VARIABLES
x(farm,port) traded quantities
cost transportation costs
;
positive variable x
;
EQUATIONS
total define objective function
supply(farm) observe supply limit at farm
demand(port) satisfy demand at port
;
total … cost =e= sum((farm,port), d(farm,port) * x(farm,port))
;
supply(farm) … sum(port, x(farm,port)) =l= yields(farm) ;
demand(port) … sum(farm, x(farm,port)) =e= export(port) ;
MODEL transport /all/ ;
SOLVE transport USING lp MINIMIZING cost ;
DISPLAY x.l, x.m
This simple transportation problem (minimize cost) has the following
solution
Optimal solution found.
Objective : 7992.000000
61 VARIABLE x.L traded quantities
7 8 9 10
1 330
2 540
3 2000 160
4 1300 120 200
5 500
6 250
However I am not capable of including some special restrictions that come up from the fact that I know the province of origin of the grain arriving
at some ports.
For example I know the amount that some ports purchase per province:
“Province in which the farms are situated”
farm, province
1 A
2 B
3 A
4 A
5 B
6 A
“Province of origin of purchased goods at port”
port, province, Tn
7 A 1800
7 B 200
8 A 1600
8 B 200
(For 9 and 10 I know nothing on grains´ origin)
I thought it would be trivial, but I don´t see how to write these restrictions, the format of an eventual matrix of restrictions etc…I would very much appreciate your help or guidance on how to proceed.
Thanks!
Javier Godar
–
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.