Hi i am working on a MTSP problem where i have 3 vehicles leaving a warehouse to make deliveries at 7 other hospitals.
Currently i have my first four constraints working. But i can't / dont understand how to create the sub tour elimination constraint. I also currently have a constraint that eliminates sub tours of 2 nodes but none that will prevent longer sub tours.
please help. Here is my dat and mod file.
param hospital;
param m;
param CTruck;
set HOSP = 1..hospital;
set DEST = 2..hospital;
param D{HOSP,HOSP};
param T{HOSP,HOSP};
var x{i in HOSP, j in HOSP}, binary, default 0;
#var u{2..hospital} >= 0;
minimize objective_function:
sum {i in HOSP, j in HOSP} x[i,j]*D[i,j];
subject to depart: # m trucks leave peoria
sum{j in HOSP} x[1,j] = m;
subject to return: # m trucks return to peoria
sum{j in HOSP} x[j,1] = m;
subject to noreturn{i in HOSP}: # trucks can't depart and arrive to same location
x[i,i] = 0;
subject to singleentrance{j in DEST}: # all nodes are entered exactly once
sum{i in HOSP} x[i,j] = 1;
subject to singleexit{i in DEST}: # all nodes are exited exactly once
sum{j in HOSP} x[i,j] = 1;
#subject to subtourelim:
subject to notwocycles{i in DEST, j in DEST: i <> j}: # no two node cycles that don't include 1
x[i,j] + x[j,i] <= 1;
.........
.........
.......
....
...
..
.