Skip to main content

Model infeasible but not sure why, formulation is sound

Answered

Comments

6 comments

  • Simranjit Kaur
    • Gurobi Staff Gurobi Staff

    You can run the Model.computeIIS() method on your model to examine why your model is infeasible. It will provide a minimal subset of constraints and variable bounds that, if isolated from the rest of the model, is still infeasible. You can obtain information about these constraints and variable bounds by writing an .ilp format file.

    model.compteIIS()
    model.write("model.ilp")

    Please refer to the article How do I determine why my model is infeasible for more details.

    0
  • D
    • Gurobi-versary
    • Investigator
    • Conversationalist

    This is the result I got: 

    which based on my understanding to IIS means none of the constraints is causing infeasibility

    IIS computed: 0 constraints, 2 bounds
    IIS runtime: 0.04 seconds
    0
  • Simranjit Kaur
    • Gurobi Staff Gurobi Staff

    This means that there are two variables whose bounds are causing the infeasibility in your model. You can get information about these variables by writing the results in an .ilp format file.

    model.write("model.ilp")
    0
  • Simranjit Kaur
    • Gurobi Staff Gurobi Staff

    You can open this file using any text editor and check the variables that have conflicting bounds.

     

    0
  • D
    • Gurobi-versary
    • Investigator
    • Conversationalist

    So, I got the following:

    Minimize
      0 CostPattern[T0] + 1.1283033680279922e+10 Constant
    Subject To
    Bounds
     CostPattern[T0] >= 1e+100
     Constant = 1
    End

     

    I think when I was defining the variable CostPattern, I added lower bound as lb=GRB.INFINITY,, which apparently corresponds to the positive infinity only. 

     

    How can I update this variable only without constructing the whole model again?

    I tried using model.update() 

    then adding the variable again and objective function and corresponding constraints, didn't work. 

    Does it overwrite the old variables or constraints or add them on top of each other?  because I did notice that my variables numbers increased. 

    0
  • Simranjit Kaur
    • Gurobi Staff Gurobi Staff

    There is no need to add a new variable, you can simply update the lower bound of the existing variable. For instance,

    x.lb = 1

    will set the lower bound of variable x to 1. The next model.optimize() call will pick up the change.

     

    0

Please sign in to leave a comment.