Skip to main content

Gurobi Effect of Abs/Max

Answered

Comments

2 comments

  • Martin Bromberger
    • Gurobi Staff

    Hi Matthew,

    One advantage of simple general constraints like Abs/Max is that Gurobi will recognize most well-known cases for which a simpler formulation (e.g., continuous without introducing binary variables) exists and applies it instead. If you want to be absolutely sure, you can run your example and check in the log that there are still only continuous variables after presolve.

    It is recommended to use simple constraints instead of doing your own reformulations because this increases code/model readability and maintenance. For instance, you don't get any inconsistencies if you change your model and your case-specific reformulation no longer works.

    I'm unsure if this provides sufficient information for your second question, but the documentation on general constraints might be a good starting point. The documentation on nonlinear constraints could be interesting if you are interested in how Gurobi handles nonlinear functions like sinusoidal equations.

    Hope this helped answer your questions.

    Best regards,

    Martin

    0
  • Matthew Chamberlain
    • Gurobi-versary
    • First Question
    • First Comment

    Hi Martin!

    Thanks for your help! It's helpful that Gurobi offers this automatic recognition. I will give it a try.

    0

Please sign in to leave a comment.