Using OR in a Gurobi Expression

482 views
Skip to first unread message

TR

unread,
Mar 30, 2019, 3:11:41 AM3/30/19
to Gurobi Optimization
Is there a ways in Gurobi to add an OR in the expression?

a1, b1,  c1,  d1 are Binary decision variables.

A constraint: a1 + b1 + c1 + d1 <= an integer

Would like to modify the above constraint as

    a1 + b1 + (c1 OR d1) <= an integer

Of course this can be done by adding another decision variable, which will make the model size to increase.

Thanks GUROBI.

Michael Winkler

unread,
Apr 1, 2019, 4:38:18 AM4/1/19
to Gurobi Optimization
You need to add an extra constraint for this, namely c1 + d1 <= 1. (As a result you have two constraints, a1 + b1 + c1 + d1 <= some integer, and  c1 + d1 <= 1.)

Best,
Michael

Dr Michael F

unread,
Apr 4, 2019, 3:15:45 AM4/4/19
to Gurobi Optimization
I suggest two constraints:

a1+b1+c1<= an integer
a1+b1+d1<= an integer
Reply all
Reply to author
Forward
0 new messages