Originally posted by: davidoff
Hello
In the sample, the subtours are initially set to an empty collection in the params.dat file. Then subtours are detected in the postProcess and we keep the smallest subtour and resolves the model.
You can display the last subtour added to the MIP
dat.subtours.add(opl.newSubtourSize, opl.newSubtour); writeln(
"Last subtour added : ",Opl.last(dat.subtours));
//add this to display the last subtour
For instance, the first subtour is
<3 [0 0 14 0 0 0 0 0 0 0 0 0 0 15 3 0 0]>
which means that we have found a subtour of 3 cities, namely cities 3 (with successor 14) ,14 (with successor 15) and 15 (with successor 3)
If you want to add initial known subtours, you can set additional sets in params.dat
David
#DecisionOptimization#MathematicalProgramming-General