Skip to main content

How to get the cause of infeasibility shown on the log file and save it

Answered

Comments

2 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 why not try our AI Gurobot?.
  • Eli Towle
    • Gurobi Staff

    Try setting the logging level to \( \texttt{INFO} \):

    logging.basicConfig(filename='info.log', level=logging.INFO)

    Note that identifying the source of infeasibility can be a complex issue. One common approach to determining which constraints contribute to the infeasibility is to compute an irreducible inconsistent subsystem (IIS). An IIS is a subset of your model's constraints and variable bounds that together form an infeasible subsystem, but removing any one of the constraints or bounds from the subsystem makes it feasible. You can compute an IIS with Model.computeIIS(), then save the result to an ILP file with Model.write() for visual inspection:

    DSR.computeIIS()
    DSR.write('dsr.ilp')

    Another approach is to construct a so-called "feasibility relaxation" of the model. The goal of a feasibility relaxation is to compute the minimal change(s) you need to make to the model's right-hand sides and variable bounds in order to recover feasibility. You can construct a feasibility relaxation with Model.feasRelax() or Model.feasRelaxS().

    For more details, I recommend the article How do I determine why my model is infeasible?.

    0

Post is closed for comments.