Is there an equivalent of CPLEX callbacks in CP?
I want to enforce the equivalent of subtour elimination constraints in a routing problem. I have the callbacks written for CPLEX (LazyConstraintCallback and UseCutCallback) but can't find a way to add then to CP.
Is there an alternative?
Pinned topic equivalent of CPLEX CallBack in CP?
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2013-02-05T10:51:35Z at 2013-02-05T10:51:35Z by SystemAdmin
SystemAdmin 110000D4XK554 Posts
Re: equivalent of CPLEX CallBack in CP?2013-02-05T10:51:35ZThis is the accepted answer. This is the accepted answer.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