-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTransportModel.gms
54 lines (41 loc) · 1.24 KB
/
TransportModel.gms
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
$title Transportation Pproblem
$OnText
Developed by
Andres Ramos
Instituto de Investigacion Tecnologica
Escuela Tecnica Superior de Ingenieria - ICAI
UNIVERSIDAD PONTIFICIA COMILLAS
Alberto Aguilera 23
28015 Madrid, Spain
https://pascua.iit.comillas.edu/aramos/Ramos_CV.htm
May 8, 2023
$OffText
sets
I origins / VIGO, ALGECIRAS /
J destinations / MADRID, BARCELONA, VALENCIA / ;
parameters
pA(i) origin capacity
/ VIGO 350
ALGECIRAS 700 /
pB(j) destination demand
/ MADRID 400
BARCELONA 450
VALENCIA 150 / ;
table pC(i,j) per unit transportation cost
MADRID BARCELONA VALENCIA
VIGO 0.06 0.12 0.09
ALGECIRAS 0.05 0.15 0.11 ;
variables
vX(i,j) units transported
vCost transportation cost
positive variable vX ;
equations
eCost transportation cost
eCapacity(i) maximum capacity of each origin
eDemand (j) demand supply at destination ;
eCost .. sum[(i,j), pC(i,j) * vX(i,j)] =e= vCost ;
eCapacity(i) .. sum[ j , vX(i,j)] =l= pA(i) ;
eDemand (j) .. sum[ i , vX(i,j)] =g= pB(j) ;
model mTransport / all / ;
solve mTransport using LP minimizing vCost