Hello, I am an engineer trying to improve myself in gams coding.I’m a bit amateur. I’m working on a project at my workplace and I have some experiments. The following coding does not provide appropriate routing for me. While doing the solution, subtours appear. How can I add a constraint to prevent this?
sets
Module locations with i product /013/
module locations with j products /013/
k number of corridors /08/
bb warehouse partitions /12/
n items /015/
;
Alias(i,j)
;
parameters
A(i) the shortest first i from the staff’s starting point. go to module
/ 1 115
2 87
3 87
4 75
5 85
6 51
7 33
8 57
9 61
10 27
11 83
12 79
13 53
/
;
scalars
Number of cb warehouse partitions /2/
Number of products ordered from yesterday /13/
TT maximum time allowed for each collection /1500/
W minimum number of modules to be visited /13/
;
Variables
X(i,j) i. from location j. Whether or not you have traveled to the location
;
free Variable z;
binary variables
X(i,j)
;
table
T(i,j)
$call=xls2gms r=a1:o15 i=table15.xls o=parc.inc
$include parc.inc
;
Equations
purpose
equations1
equations2
equations3
equations4
equations5
equations6
;
purpose…z=e=sum ((i,j),T(i,j)*X(i,j));
equations1(j)…sum((i),X(i,j))=e=1;
equations2(i)…sum((j),X(i,j))=e=1;
equations3(i)…sum((j),X(“0”,j))=e=1;
equations4(j)…sum((i),X(i,“0”))=e=1;
equations5(i)…sum((j)(ord(j) = ord(i)), x(i,j))=l=0;
equations6(i,j)(ord(i) < ord(j))… x(i,j) + x(j,i) =l= 1;
attempt /all/
solve attempt using minlp minimizing z;