Any good practice for using bigM?
AnsweredHi,
I am using many big-Ms in my model, which makes my coefficient statistics very bad. I think that is the main reason for the very slow solving of my optimisation.
Matrix range [2e-02, 4e+06]
Objective range [1e+00, 2e+02]
Bounds range [1e+00, 1e+04]
RHS range [1e+00, 4e+06]
Is there any method to avoid using bigMs, or if I have to, how can I avoid numerical issues caused by bigM?
Thanks.
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
Hi Yongning,
in general, I can recommend to you this blog post by Paul Rubin on the subject, it covers a lot of important aspects.
Beyond that, you could try to "calculate" your tightest big-M for a given model. So suppose you use a big-M formulation
such as this:
```
t <= y*M
```
Then, you could find out what the largest value is that `t` can attain. You can do this by solving the model with the objective function:
```
max. t
```
This will then return to you the biggest value that the variable t can have, and consequently the smallest value that M can have. This of course only works for this particular model; if your data changes, this value may change. However, it can (a) give you an indication on how "good" your big-M value is and (b) inspire you to find ways to tighten the formulation.
Hope this helps.
Best
Richard
0 -
Many thanks, Richard. That's quite informative and useful.
0
Post is closed for comments.
Comments
3 comments