Sungsy
Sungsy

Reputation: 124

MIP (mixed integer problem) Build Constraint with OR

I have an MIP where I want to assign at least two variables (binary) from the same location.

How to implement the or in this case. I want something like this:

x1 + x2 + x3 + x4 >= 2 or
x5 + x6 + x7 + x8 + x9 >= 2 or
x10 + x11 + x12 >= 2

x1,...,x12 are binary variables.

How could it be implemented?

I had a look here but could not work it out to my case.

Upvotes: 0

Views: 160

Answers (1)

Erwin Kalvelagen
Erwin Kalvelagen

Reputation: 16724

x1 + x2 + x3 + x4 >= 2⋅δ1
x5 + x6 + x7 + x8 + x9 >= 2⋅δ2
x10 + x11 + x12 >= 2⋅δ3
δ1+δ2+δ3 = 1 
δ1,δ2,δ3 ∈ {0,1}

If you want, you can replace δ1+δ2+δ3=1 by δ1+δ2+δ3>=1.

Upvotes: 3

Related Questions