4

I am using Pyomo together with Gurobi (and other solvers such as cbc). I am trying to compute an Irreducible Infeasible Set (ISS).

In Pyomo documentation, get_model_attr takes an attribute, among which 'IISMinimal'. On the other hand Gurobi documentation states that "this attribute is only available after you have computed an IIS on an infeasible model". However I haven't found how to actually compute an IIS for a given infeasible model.

To give more context to this question, I am trying to determine which constraints make my problem infeasible. I've read about the subject (here and there for example) but as several users user state in their comments, I haven't been able to make it work so far.

RobPratt
  • 32,006
  • 1
  • 44
  • 84
Meth
  • 424
  • 2
  • 17
  • 1
    Very old, so no idea whether there is an easier way to do it now in Pyomo: https://groups.google.com/g/pyomo-forum/c/9n5KAg2nKDk and https://github.com/Pyomo/pyomo/blob/main/examples/pyomo/suffixes/gurobi_ampl_iis.py . I found this by random googling, so can't offer any assistance. – Mark L. Stone Feb 08 '22 at 16:39
  • @MarkL.Stone Thanks for your comment, but the references use AMPL, and I'd like to access gurobi solver directly – Meth Feb 09 '22 at 11:59
  • That;s why it's a comment, not an answer. – Mark L. Stone Feb 09 '22 at 12:13

2 Answers2

4

The Gurobi documentation states how you can compute and inspect the IIS:

model.computeIIS()
model.write("model.ilp")

I am not certain how to call the computeIIS() method from Pyomo, though. This related question might also be helpful.

mattmilten
  • 1,633
  • 8
  • 12
  • Thanks for your answer. I've read this doc, but indeed it doesn't help to make it work from pyomo. I'll check the related question and come back to you – Meth Feb 09 '22 at 12:00
  • The related question indeed provides an answer to my initial question. Caveats are: 1/ working with gurobi, not working with cbc and 2/ *.ilp file is difficult to read because all variabless and constraints names in the initial model are replaced by x and c_u_x, c_l_x and c_e_x. – Meth Feb 09 '22 at 14:48
  • 2
    The variable names are actually preserved when writing out a Gurobi ILP file. I can only assume that the variable names have been changed when transferring the model from Pyomo to Gurobi. You might want to try saving the Pyomo model to a file and then using Gurobi directly to compute the IIS. – mattmilten Feb 11 '22 at 11:17
-1

An excellent reference on infeasibility analysis is the book: Chinneck, John (2008) "Feasibility and Infeasibility in Optimization Algorithms and Computational Methods" Springer. Looks like it may be downloadable as a pdf.

LINDO Systems
  • 509
  • 2
  • 2
  • 1
    Thanks for your answer, I'll have a look. I doubt the book answers to ma initial question though (the book doesn't make any reference to pyomo or gurobi it seems). – Meth Feb 09 '22 at 11:07