Try our new documentation site (beta).
GRBModel.computeIIS()
Compute an Irreducible Inconsistent Subsystem (IIS). An IIS is a subset of the constraints and variable bounds with the following properties:
- It is still infeasible, and
- If a single constraint or bound is removed, the subsystem becomes feasible.
IIS results are returned in a number of attributes: IISConstr, IISLB, IISUB, IISSOS, IISQConstr, and IISGenConstr. Each indicates whether the corresponding model element is a member of the computed IIS.
The IIS log provides information about the progress of the algorithm, including a guess at the eventual IIS size.
If an IIS computation is interrupted before completion, Gurobi will return the smallest infeasible subsystem found to that point.
The IISConstrForce, IISLBForce, IISUBForce, IISSOSForce, IISQConstrForce, and IISGenConstrForce attributes allow you mark model elements to either include or exclude from the computed IIS. Setting the attribute to 1 forces the corresponding element into the IIS, setting it to 0 forces it out of the IIS, and setting it to -1 allows the algorithm to decide.
To give an example of when these attributes might be useful, consider the case where an initial model is known to be feasible, but it becomes infeasible after adding constraints or tightening bounds. If you are only interested in knowing which of the changes caused the infeasibility, you can force the unmodified bounds and constraints into the IIS. That allows the IIS algorithm to focus exclusively on the new constraints, which will often be substantially faster.
Note that setting any of the Force
attributes to 0 may make the
resulting subsystem feasible, which would then make it impossible to
construct an IIS. Trying anyway will result in a
GRB_ERROR_IIS_NOT_INFEASIBLE
error. Similarly, setting this
attribute to 1 may result in an IIS that is not irreducible. More
precisely, the system would only be irreducible with respect to the
model elements that have force values of -1 or 0.
This method populates the
IISConstr,
IISQConstr, and
IISGenConstr
constraint attributes,
the
IISSOS,
SOS attribute, and the
IISLB and
IISUB
variable attributes.
You can
also obtain information about the results of the IIS computation by
writing a .ilp
format file (see
GRBModel.write). This file
contains only the IIS from the original model.
Use the IISMethod parameter to adjust the behavior of the IIS algorithm.
Note that this method can be used to compute IISs for both continuous and MIP models.
void | computeIIS ( ) |