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

SOS Constraint with sum

回答済み

コメント

3件のコメント

  • 正式なコメント
    Simranjit Kaur
    • 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?.
  • Richard Oberdieck
    • Gurobi Staff

    Hi Alexander,

    I would not use SOS constraints in this case, but big-M. Specifically, let M1 be the big-M value of y and M2 be the big-M value of the sum(x_i). Then I would introduce a binary variable z such that:

    y <= M1z
    sum(x_i) <= M2(1-z)

    Then, if z=1, you have sum(x_i)<=0 which due to the non-negativity means x_i=0 for all x_i. Equally, if z=0, then you have y<=0 which due to the non-negativity means y=0. You can check some slides I made about this here (page 15).

     

    Hope this helps

    Richard

     

     

    1
  • Alexander Haberman
    • Gurobi-versary
    • Curious
    • First Comment

    Thanks Richard, that is very helpful!

    0

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