These days I try to build a Gurobipy optimization model by Pyomo and I met a problem about outputing IIS file. I use
opt = SolverFactory("gurobi", solver_io="python")
option = {"MIPGAP":0.001, "TimeLimit":300}
obj = ...
for k, v in option.items():
opt.options[k] = v
result = opt.solve(model, warmstart=True, tee=True, options_string="ResultFile=iis_{}.ilp".format("model"))
When model comes IIS, I find that the variables in IIS's constrains have no variable name or index I coded but some numeric serial number only like
x95729: -x36195 - 1.71 x40465 = 0
I can't figure out which constraint it is. Then I try to use
log_infeasiable_constraints(model, log_expression=True, log_variables=True)
to find out which constraints and variables issue the IIS, and I get a lot of constraints, the number of them far exceeds the number of constraints I got through the last approach (maybe I would have gotten a few with the last approach, whereas with log_infeasiable I would have gotten dozens) And I find that some variables' value in constraints is "None".
Are there some solutions that could calculate the minimum IIS constraints with variables' names and indexes? And where do these variables that turn into None values come from?