Question: Set i 'customers' / 1 * 8 / j 'customers' / 1 * 8 / k 'vehicles' / 1 * 2 / ; Parameter c

Set
i 'customers' /1*8/
j 'customers' /1*8/
k 'vehicles' /1*2/;
Parameter
c(i,j) 'distance between customers' /
1.110,1.215,1.320,1.425,1.530,1.635,1.740,1.845,
2.115,2.210,2.312,2.418,2.522,2.628,2.735,2.838,
3.120,3.212,3.310,3.415,3.518,3.624,3.730,3.833,
4.125,4.218,4.315,4.410,4.512,4.618,4.722,4.825,
5.130,5.222,5.318,5.412,5.510,5.615,5.720,5.822,
6.135,6.228,6.324,6.418,6.515,6.610,6.712,6.815,
7.140,7.235,7.330,7.422,7.520,7.612,7.710,7.815,
8.145,8.238,8.333,8.425,8.522,8.615,8.712,8.810/;
Parameter
d(i) 'demand of customers' /
110,212,38,45,515,69,77,86/
Q 'vehicle capacity' /50/;
Scalar
depot 'depot location' /0/;
Variable
z 'objective function value (total distance)';
Binary Variable
x(i,j,k)'1 if vehicle k travels from i to j';
Positive Variable
u(i) 'load at customer i';
Equation
obj 'objective function'
visit1 'each customer is visited once'
visit2 'each customer is served by one vehicle'
capacity 'vehicle capacity constraint'
subtour 'subtour elimination';
obj ..
z =e= sum((i,j,k), c(i,j)* x(i,j,k));
visit1(i)..
sum(j$(j ne i), x(i,j,k))=e=1;
visit2(j)..
sum(i$(i ne j), x(i,j,k))=e=1;
capacity(i,k)..
u(i)- u(j)+ Q * x(i,j,k)=l= Q - d(j);
subtour(i,k)..
u(i)=g= d(i);
Model VRP /all/;
Solve VRP using mip minimizing z;
Display x.l, u.l, z.l; when I copy paste this code to gams it gives error, can you fix it?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!