Skip to main content

How to model the indicator function in Gurobi

Answered

Comments

2 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff Gurobi Staff
    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?.
  • Tobias Achterberg
    • Gurobi Staff Gurobi Staff

    Yes, using an indicator is the right way to go. And it is very easy, you just need to invert the direction of the indicator. Instead of

    f_r > 0 -> i_r = 1

    you would enforce

    i_r = 0 -> f_r <= 0

    This is mathematically equivalent, and it fits to how indicators in Gurobi are defined.

    0

Post is closed for comments.