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

The "infeasible" model is feasible with pen and paper.

回答済み

コメント

4件のコメント

  • 正式なコメント
    Simranjit Kaur
    • Gurobi Staff Gurobi Staff
    This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?.
  • Eli Towle
    • Gurobi Staff Gurobi Staff

    Hi Ehsan,

    Q_HI_0_0 is a binary variable, and A22_HI_0 is a nonnegative integer variable. The two constraints in question are:

    D_HI_0:          - 17 Q_HI_0_0 + D_HI_0 = 0
    A22_HI_cnst_0:   A22_HI_0 - D_HI_0 = -50

    If we add these together, we have the new (valid) constraint

    - 17 Q_HI_0_0 + A22_HI_0 = -50

    This constraint cannot be satisfied, because A22_HI_0 is nonnegative.

    How are you adding these variables to the model? For example, in the Python API, variables added with Model.addVar() are nonnegative by default, though a different lower bound can be specified using the lb keyword argument (e.g., lb=-GRB.INFINITY).

    Does this help? Thanks!

    Eli

    0
  • Ehsan Aerabi
    • Gurobi-versary
    • First Comment
    • First Question

    Thanks Eli for your time.

     

    That's exactly answered my problem! I use python and addVar. Also A22_HI_0  values are always negative.

     

    Thanks again. 

    Ehsan

    0
  • Sandhya Giri
    • Gurobi-versary
    • First Comment

    Thanks Eli for this suggestion: 

    "

    in the Python API, variables added with Model.addVar() are nonnegative by default, though a different lower bound can be specified using the lb keyword argument (e.g., lb=-GRB.INFINITY).

    "

    This solved a "model is infeasible" problem for me :)

    0

投稿コメントは受け付けていません。