Skip to main content

Indicator Constraint Definition for Bounds

Answered

Comments

4 comments

  • Official comment
    Simranjit Kaur
    • 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 try Gurobot, our chatbot interface offering instant, expert-level support.
  • Jonasz Staszek
    • Community Moderator
    • Gurobi-versary
    • Thought Leader
    • First Question

    Hi Phillip,

    you can model this via indicator constraints. Perhaps these two posts (here and here) will be helpful.

    Best regards
    Jonasz

     

    1
  • Jaromił Najman
    • Gurobi Staff

    Hi Phillip,

    To briefly add on Jonasz' answer:

    Is it true that the first equation forces the second

    No, if you encode x=0 -> f=0, then for x=1, f can by anything, i.e., it can be f=0. If you really want to make sure that f is > 0 then, you have to use an epsilon for x=1 as you proposed. Note that this epsilon should not be smaller than the FeasibilityTol you are using. Something like epsilon = 1e-4 should work fine.

    Best regards, 
    Jaromił

     

    1
  • Phillip Meng
    • Gurobi-versary
    • Conversationalist
    • First Question

    Thank you both, that clarifies our thinking on our modelling implementation.

    :)

    0

Post is closed for comments.