User cuts in Gurobi

641 views
Skip to first unread message

Jim

unread,
Nov 11, 2009, 11:36:43 AM11/11/09
to Gurobi Optimization
I would like to ask for a clarification about how user cuts are
handled in Gurobi .

The Gurobi reference manuals states:

One very important note: you should only add cuts that are implied by
the constraints in your model. If you cut off an integer solution that
is feasible according to the original model constraints, you are
likely to obtain an incorrect solution to your MIP problem.

Does this mean that I cannot use a cut callback to "lazily" add
constraints that are required to specify my model? (Such constraints
do not cut off feasible solutions of *my* model, but do cut off
integer solutions of the "original" model I have given to Gurobi.) For
example, does it mean I would not be able to use it to add subtour
elimination constraints for solving a TSP problem? Or is this just a
standard warning that if you add invalid cuts there will be problems?
Also, will the cut callback routine be called on incumbent solutions
that are feasible to the current solutions in the model? I.e. in the
TSP example, if I have an integer feasible solution that has a
subtour, would I be guaranteed to have an opportunity to add a cut to
prevent Gurobi from accepting this as a feasible solution? Finally,
if I can conceivably add "lazy" cuts in this fashion, would I need to
turn off Presolve altogether?

Ed Rothberg

unread,
Nov 11, 2009, 6:08:36 PM11/11/09
to Gurobi Optimization
> Does this mean that I cannot use a cut callback to "lazily" add
> constraints that are required to specify my model?

Yes, that's not supported in this release.

> For example, does it mean I would not be able to use it to add subtour
> elimination constraints for solving a TSP problem?

Correct, you can't currently use the cut callback to do that.

Gleb Belov

unread,
Jun 19, 2017, 8:54:21 AM6/19/17
to Gurobi Optimization
Hi, is the situation still the same? In one of recent Python seminars, Gurobi talked about adding proper SECs in a callback... ?

Thank you,
Gleb

Ed Rothberg

unread,
Jun 19, 2017, 10:15:50 AM6/19/17
to Gurobi Optimization

Yes, we added lazy constraint support in version 5.0 (in 2012).  Here's a Python example, from our 7.0 release...


Ed



Reply all
Reply to author
Forward
0 new messages