How to set lower bound in Gurobi

5,176 views
Skip to first unread message

optimization

unread,
Jul 11, 2011, 6:23:25 AM7/11/11
to Gurobi Optimization
Hi,

I have known a lower bound for the objective value of a MIP model
(maximize). Could I set the parameter of the model to add the lower
bound? This could speed the calculation process of MIP model.

Christian H.

unread,
Jul 11, 2011, 6:50:20 AM7/11/11
to Gurobi Optimization
Hi,

I had the same issue. My quick and "dirty" solution: Add objective
function as new constraint.

GRBLinExpr expr = new GRBLinExpr();
for (GRBVar v : model.getVars()) {
expr.addTerm(v.get(GRB.DoubleAttr.Obj), v);
}
model.addConstr(expr, GRB.GREATER_EQUAL, 0.0, "lower bound = 0");
model.update();

Cheers,
Chris

optimization

unread,
Jul 11, 2011, 7:57:33 AM7/11/11
to Gurobi Optimization
Thanks.

Greg Glockner

unread,
Jul 11, 2011, 8:20:33 AM7/11/11
to gur...@googlegroups.com
I would modify the proposed approach by the following:

1) Add a new variable to represent the objective (call this z)
2) Set z equal to the original objective function
3) Set the new objective equal to z
4) Set a lower bound on z per your needs

Finally, I've seen cases where bounding the objective can help performance and others where it can hurt performance. It's worth testing.

Martin Fuchsberger

unread,
Jul 11, 2011, 8:34:31 AM7/11/11
to Gurobi Optimization
Is there any plan to add a CutLo / CutUp parameter for such a purpose?

Ed Rothberg

unread,
Jul 11, 2011, 10:55:02 AM7/11/11
to Gurobi Optimization

You can use the 'Cutoff' parameter to specify an upper bound for
minimization or a lower bound for maximization.

If you are looking to set a lower bound for minimization, we don't
provide a parameter for that. It is almost always a bad idea - it
screws up variable pricing.

Ed


Siu Hung Joshua Chan

unread,
May 6, 2014, 3:09:36 AM5/6/14
to gur...@googlegroups.com
Hi Rothberg,

I have the exactly same problem of lower bound for minimization. You said it screws up the pricing problem.
But is there no way to help it? It wastes me a lot of time to watch the algorithm pushing up the lower bound to the known optimal value.
Can't there be any parameter that excludes a constraint for objective function value from the prizing process? But just to monitor the current objective value?
Just like I can always break the optimization when I see the desired objective value and the current solution is returned.
Anything like that in Gurobi 5?

Thanks a lot!

Best,
Joshua



Ed Rothberg於 2011年7月11日星期一UTC+2下午4時55分02秒寫道:

km...@berkeley.edu

unread,
Apr 2, 2015, 1:38:55 PM4/2/15
to gur...@googlegroups.com
It would be great if there was a way to store all the important parts of the history of a solution process that would help the solver start where it's left off if you need to solve the problem in chunks of time.

Seems like this would be the only reliable way to improve optimization time for big models.

Ed Rothberg

unread,
Apr 2, 2015, 2:02:27 PM4/2/15
to gur...@googlegroups.com

There's so much state information in a modern MIP solver that it's proven to be impractical to capture it all to disk.  We've actually implemented this feature in the past, but we wound up ripping it out because it was impossible to maintain.

Ed


km...@berkeley.edu

unread,
Apr 2, 2015, 2:52:41 PM4/2/15
to gur...@googlegroups.com
I am talking about just storing enough to stop after a time limit (at the end, not continuously) and restart - surely this can't be more than what's stored in memory?

Thanks so much,
Kenny

Ed Rothberg

unread,
Apr 3, 2015, 12:29:56 AM4/3/15
to gur...@googlegroups.com

It sounds like what you need is a virtual machine.  You can suspend and resume it as you like.

Ed


Nicolas Cabrera Malik

unread,
May 9, 2018, 9:51:12 AM5/9/18
to Gurobi Optimization
Hi Ed, I know this was a topic long time ago. But i wonder, how can i use that parameter inside a callback ?

Kostja Siefen

unread,
May 9, 2018, 10:02:39 AM5/9/18
to Gurobi Optimization
Hi Nicolas,

Modifying parameters within a callback is not supported. As an alternative, you can always retrieve the current status (best objective/best bound) and terminate the optimization yourself.

Kostja

Nicolas Cabrera Malik

unread,
May 9, 2018, 11:28:09 AM5/9/18
to Gurobi Optimization
Hi Kostja,

I can try that, but the main problem is that I'm doing a benders decomposition, and the best bound it is not reducing as fast as the upper bound that i'm getting with benders at each iteration. And i think that using this UB would improve the performance of the B&B. My implementation uses a callback every time the B&B founds an integer solution, i run a set of subproblems, that allow me to find an UB.

Is there any way of modifying this upper bound? I already tried using a lazy constraint, but it did not work well.

Kostja Siefen

unread,
May 9, 2018, 11:37:23 AM5/9/18
to Gurobi Optimization
Hi Nicolas,

For MIP models you can add cuts or inject solutions from a callback function. Lazy constraints can be used to invalidate solutions.

Did you take a look at BestObjStop and BestBdStop?


Parameters need to be set before the optimization starts, not within a callback

Kostja
Reply all
Reply to author
Forward
0 new messages