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
Attached you can find a short example for a TSP problem that separates subtour elimination constraints lazily. There are two things you have to do
- Hook into the preintsol callback to reject integer feasible solutions that do not satisfy all the lazy cuts.
- Hook into the optnode callback to generate violated lazy cuts.
Note that you can check
if (prob.attributes().getMIPInfeas() != 0)
return;in the optnode callback to restrict separation to nodes that are integer feasible
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