Hi,
in the example CPLEX_Studio1263\opl\examples\opl\models\TravelingSalesmanProblem the TSP problem is solved with Integer Programming
https://en.wikipedia.org/wiki/Travelling_salesman_problem
I provide here a skeleton that does the same but with CPO (Constraint Programming)
Why could that be interesting ?
The model is
minimize endOf(itvs[n+1]) - (n+1);
subject to
{
startOf(itvs[1])==0; // break sym
noOverlap(seq,Dist,true); // nooverlap with a distance matrix
last(seq, itvs[n+1]); // last node
}
regards
NB: Integer Programming generally gives better results than CPO but useful to have 2 tools instead of 1. (Why not adding a screwdriver to the hammer sometimes ?)
Alex Fleischer
PS:
Many how to with OPL at https://www.linkedin.com/pulse/how-opl-alex-fleischer/
Many examples from a very good book : https://www.linkedin.com/pulse/model-building-oplcplex-alex-fleischer/
Making optimization simple : https://www.linkedin.com/pulse/making-decision-optimization-simple-alex-fleischer/
#DecisionOptimization#OPLusingCPOptimizer