Skip to main content

How to set ComputIIS attributes and check the GRB_ERROR_IIS_NOT_INFEASIBLE error?

Answered

Comments

6 comments

  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    IISConstrForce is a constraint attribute. Thus, you have to set this value for each constraint of interest. An example would be

    expr = new GRBLinExpr();
    expr.addTerm(1.0, x); expr.addTerm(2.0, y); expr.addTerm(3.0, z);
    GRBConstr c0 = model.addConstr(expr, GRB.LESS_EQUAL, 4.0, "c0");
    c0.set(GRB.IntAttr.IISConstrForce, 1);

    From the documentation of computeIIS

    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. 

    The above means that if you exclude a constraint \(c\) from IIS computation via setting its IISConstrForce attribute to \(0\) or \(1\), it is possible that no IIS can be computed. This means that \(c\) is responsible for infeasibility or irreducibility but is not allowed or is forced to be used resulting in the IIS which ultimately throws the GRB_ERROR_IIS_NOT_INFEASIBLE error. If you get this error, you should try to not set any IIS Force attributes for constraints/variables.

    Best regards, 
    Jaromił

    0
  • Zhenchen Liao
    Gurobi-versary
    First Comment
    First Question

    Thanks for your reply. I followed the example and writed constr.set(GRB.IntAttr.IISConstrForce, 0) which try to exlude this constraint from the subsystem. But there is syntax error "IISConstrForce cannot be resolved or in a Field". 

    Best regards,

    0
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Can you please post a minimal reproducible example showing the issue? The call itself looks fine.

    0
  • Zhenchen Liao
    Gurobi-versary
    First Comment
    First Question

    I think the error is caused by there is no "IISConstrForce" attribute under GRB.IntAttr. It cannot be recognised.

     

    0
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    It is difficult to help without any snippet of the issue. Could you please post a minimal reproducible example showing the issue?

    Which version of Gurobi are you using? The IIS Force attributes are only available with version 9.5.x.

    0
  • Zhenchen Liao
    Gurobi-versary
    First Comment
    First Question

    Thanks for your reply. I think the problem is caused by the Gurobi version so that it cannot recognise IIS Force.

     

    Best regards,

    0

Please sign in to leave a comment.