Forum Discussion
FICO
5 years agoCommunity Manager
Lazy cut callback in Java
In Java, how can one separate cuts in a lazy manner, i.e. only separate cuts at the integer nodes? Such an approach is common in for instance a standard TSP formulation where the subtour elimination ...
FICO
5 years agoCommunity Manager
Hi Joris, sorry for the long delay. I first had a hard time reproducing your issue and then got side-tracked by some other things.
Here is what I found by now:
We get into an infinite loop because the example separates the same cut over and over again. This happens for two reasons
- The example separates cuts even for nodes that are not integer feasible.
- The example does not check whether the cut is sufficiently violated before adding it
I suggest to separate cuts only for integer feasible nodes (prob.attributes().getMIPInfeas() == 0) that should fix both issues (because any violated cut found that way will be significantly violated). It also reduces the overhead for non-integral nodes.
An alternative is of course to check that the presolved cut is sufficiently violated. For this you will need the solution to the presolved problem. That can be obtained by function prob.getPresolveSol().
Related Content
Related Content
Variable names in callback (Java API)
I construct a cut in a preintsol callback using variables from the model containing the callback. When constructing the model, I give the variables names (using withName(...)) and store them in a vec...9 months agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum4 unread comments4 unread1View0likes4CommentsAre preintsol callbacks threadsafe?
The optimizer documentation states "When the MIP callbacks are called they are MUTEX protected to allow non threadsafe user callbacks." In my Java code for one-tree Benders, if I specify a single thr...9 months agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum3 unread comments3 unread3Views0likes3CommentsImplementing Lazy Constraints (Java)
We are interested in using Lazy Constraints in Xpress (Java) to implement a TSP algorithm. In particular, after each integer solution is generated, we would like to search for violated constraints an...10 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum6 unread comments6 unread0Views0likes6Comments