メインコンテンツへスキップ

Infeasibility of model due to new constraints

回答済み

コメント

1件のコメント

  • Jaromił Najman
    • Gurobi Staff

    Your issue is not reproducible because variable \(\texttt{y[plant]}\) is not defined.

    After computing the IIS, you can write it to a file

    model.write(iis.ilp)

    and open the IIS file \(\texttt{iis.ilp}\) in any standard text editor. You can then analyze the constraints in the IIS and try to find out why they together are infeasible.

    You are saying that the 2 constraint found by the IIS algorithm are demand and singleflag

    model.addConstr(gp.quicksum(x[plant, warehouse] for plant in plants) >= warehouse_demands[warehouse])
    model.addConstr(gp.quicksum(x[plant, warehouse] for plant in plants) == 1

    These 2 constraint are incompatible because \(\texttt{warehouse_demands[warehouse] > 1}\).

    I guess your \(\texttt{y}\) variable is a binary assignment constraint which you wanted to use in the singleflag constraint instead of \(\texttt{x}\).

    0

サインインしてコメントを残してください。