Skip to main content

Infeasible because of numerical issues?

Answered

Comments

4 comments

  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi Axel,

    Numerical issues during the solution process can occur even if there is no explicit Warning about it. The Warnings printed by Gurobi about numerical issues are very high level and don't catch every single possible issue.

    Did you try to find the reason for the infeasibility of your model, see How do I determine why my model is infeasible?

    Note that Gurobi sets lower bounds of all variables to \(0\) on default. This means that if you want to allow for negative variables, you have to explicitly set their lower bound value to a negative value, e.g., \(-\infty\).

    Best regards, 
    Jaromił

    0
  • Axel Bruck
    Gurobi-versary
    Conversationalist
    First Question

    Hi Jaromil,

     

    thanks for your quick answer!

    But looking at the coefficient statistics I would not assume any numerical issues. And if it becomes infeasible it literally takes a couple of seconds to know it.

    I set all lower boundaries to 0 too.

    I tried to do what was behind the link but I don't understand how I can run it in the python consol and pyomo.

    I used this instead:

    from pyomo.util.infeasible import log_infeasible_constraints
    import logging

    log_infeasible_constraints(m, log_expression=True, log_variables=True)
    logging.basicConfig(filename='example.log', encoding='utf-8', level=logging.INFO)

    But it basically never finishes...

    0
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi Axel,

    I don't know whether Pyomo supports Gurobi's IIS computation. This OR stackexchange post discusses a similar issue.

    Note that compute an IIS can take quite some time so you should not be discouraged by long runtimes.

    If you cannot compute an IIS through Pyomo, you could consider writing an MPS or LP file for your model and switching to Gurobi's native Python API to compute an IIS.

    Best regards, 
    Jaromił

    0
  • Axel Bruck
    Gurobi-versary
    Conversationalist
    First Question

    Thanks a lot for your help Jaromil!
    I figured out the problem. I accidentally introduced some negative demand values in the model as an input that however couldn't be supplied since I don't allow negative values :D.

    Thanks and sorry for the confusion!

     

    Cheers

     

    Axel

    0

Please sign in to leave a comment.