Skip to main content

Gurobi states problem is infeasible when solution certainly exists

Answered

Comments

2 comments

  • Maliheh Aramon
    Gurobi Staff Gurobi Staff

    Hi, 

    The behaviour you described can occur if the solution returned by the first problem is not "clean." Due to the finite precision of floating-point arithmetic, the optimal solution returned by Gurobi may exhibit constraint or bound violations beyond the feasibility tolerance, especially if your model includes problematic numerical properties. These might include large objective and RHS values or a wide range of matrix coefficients. Do you see any warning messages in the log of the first model indicating a violation beyond the default feasibility tolerance of 1e-6 for the optimal solution?

    To confirm whether this is a numerical issue, you can fix the lower and upper bounds of the variables in the second model to the values from the first model's solution and then optimize the model. As you pointed out, this would render the model infeasible. You can then call the method model.computeIIS() to generate an IIS  file, which can help identify the source of the infeasibility. For more details on diagnosing an infeasible model, see the article "How do I determine why my model is infeasible?".

    I imagine that tweaking the feasibility tolerance or objective tolerance would help, but I would like to have them set to the same tolerance in both problems

    If acceptable for your application, you can set the FeasibilityTol parameter to a larger value for both models. Additionally, you could experiment with parameters such as NumericFocus=1|2|3 and ScaleFlag=2 when solving the first model to see if enforcing stricter numerical precautions helps produce a cleaner solution.

    It also seems that your application involves solving an optimization model with two hierarchical objective functions. You might want to explore Gurobi's multi-objective feature, which provides a convenient API for handling such models.

    Best regards,

    Maliheh

    0
  • Alexandre Granzer-Guay
    First Comment
    Gurobi-versary
    First Question

    Thank you Maliheh. This confirms my suspicion. I will give your recommendations a try and see what the results are.

    Best,

    Alex

    0

Please sign in to leave a comment.