Skip to main content

Integrating OR operator without losing linearity

Answered

Comments

2 comments

  • Ryuta Tamura
    Gurobi Staff Gurobi Staff

    Hi,

    By using SOS-1 constraint, it can be solved as MILP. For example, the constraint that the variables x and y cannot be nonzero at the same time can be written as follows:

    model.addSOS(GRB.SOS_TYPE1, [x, y])

    Thanks,
    Ryuta

    1
  • Adam Lakatos
    First Comment
    First Question

    Hi Ryuta,

    Apologies for the late response, I just got around to trying your suggestion. It worked great, thank you very much. 

    Best,

    Adam

    0

Please sign in to leave a comment.