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

How to write if condition in python gurobi 9.5?

回答済み

コメント

1件のコメント

  • Jaromił Najman
    • Gurobi Staff Gurobi Staff

    \(\texttt{if}\)-statements cannot be directly implemented into Gurobi when using optimization variables. Thus, one has to model an \(\texttt{if}\)-condition with the help of binary variables and additional constraints. I think that the KB article How do I model conditional statements in Gurobi? is what you are looking for.

    Best regards, 
    Jaromił

    0

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