Skip to main content

some problem about adding SOS constraint

Answered

Comments

3 comments

  • Official comment
    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?.
  • Tobias Achterberg
    • Gurobi Staff

    A constraint x1 + ... + xn <= 1 with xj being binary variables says that at most one them can be non-zero. This is equivalent to forming the SOS1 constraint SOS1(x1,...,xn). But the SOS1 constraint doesn't help you here, because the linear constraint is stronger in terms of the LP relaxation. This is why Gurobi would immediately translate the SOS1 constraint back into the linear constraint during presolve.

    Your constraint is an equality. This is not equivalent to an SOS constraint, because for an SOS, setting everything to zero is feasible.

    Regards,

    Tobias

    0
  • Yuan Jiawei Yuan Jiawei
    • Gurobi-versary
    • Curious
    • First Comment

    Thank you very much, best wishes to you.

    0

Post is closed for comments.