Skip to main content

Indicator Constraint Definition for Bounds

Answered

Comments

3 comments

  • Jonasz Staszek
    Community Moderator 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 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

Please sign in to leave a comment.