Originally posted by: SystemAdmin
There is no callback to achieve this in CPO. The way to introduce new inferences in the solver is to define your own constraint that eliminate subtours. Look at the documentation about how to define custom constraints (an instance of IlcConstraintI) in CP Optimizer Extensions User’s Manual > Writing complex custom constraints.
Note that posting linear subtour elimination constraints when propagating an IlcConstraints does not do the job because they will be added localy and will be removed when backtracking. For going deeper about the implementation of such a constraint, you can have a look at this paper:
http://libra.msra.cn/Publication/379871/solving-small-tsps-with-constraints Regards
Philippe
#CPOptimizer#DecisionOptimization