Skip to main content

ComputeIIS and how to use it to troubleshoot

Answered

Comments

4 comments

  • Jonasz Staszek
    Community Moderator Community Moderator
    Gurobi-versary
    Thought Leader
    First Question

    Hi Charitha,

    it seems to me that you need to redefine your continuous variable to allow it to assume negative values. The default lower bound for continuous variables in Gurobi is 0.

    Try the following:

    en[46,135] = model.addVar(lb=-GRB.INFINITY, ub=GRB.INFINITY, name="en[46,135]")

    and the IIS you showed will not be infeasible any more.

    I would also recommend two things:

    1. If you know some (binary) variables are fixed beforehand, try to reformulate your problem in such a way that they are no longer required. This can usually be done fast and saves model generation time. From my own experience, I can add that it can save a lot of trouble later on (like the ones you are seeing).
    2. The trick I showed you will only work for this single IIS. Chances are that if you re-run the optimization process with only the two bounds added, your model would still be infeasible and a very similar IIS would be generated, this time with different variables and constraints. You need to "generalize" the "bound-fixing" trick to cover all of the situations in which such infeasibilities could arise.

    Hope this helps.

    Best regards
    Jonasz

     

     

    0
  • Charitha Heendeniya
    Gurobi-versary
    Collaborator
    Investigator

    Dear Jonas,

    Thank you for the reply. x[386,135,t2] = 0 and x[386,135,t1] = 0 because they are coming from a partial solution. So Gurobi also knows it.

    You are right. en[46,135]  is continuous. 

    Buddi

    0
  • Jonasz Staszek
    Community Moderator Community Moderator
    Gurobi-versary
    Thought Leader
    First Question

    You need to change the lower bound of your continuous variable. Have a look at my first answer - I modified it accordingly.

    Best regards
    Jonasz

    0
  • Charitha Heendeniya
    Gurobi-versary
    Collaborator
    Investigator

    OK, I will try that. When a continuous variable is defined, I thought (-inf, _nf) bounds are implied. I missed that the default lower bound is 0

    Thank you very much.

    0

Please sign in to leave a comment.