# How to add OR operator on constraints in a Cplex model

 0 Dear All, I use CPLEX concert technology in C++. I have a problem which goes like this. There is a model which has two constraints say C1 and C2. If both these constraints are added to the model, the model will become infeasible. I need to let choose CPLEX one of the constraint only at a time. Essentially it is like an OR condition like : C1 + C2 = 1. Is there a way on CPLEX I could do this. Thanks. asked 20 Aug '15, 00:04 Prasanna 7●2●3 accept rate: 0% First of all, C1 + C2 = 1 is a XOR constraint -- or did you mean to write C1 + C2 >= 1? Second, is "branching" to be performed on basis of a parameter -- or a variable value? (20 Aug '15, 04:34) fbahr ♦ Thank you fbahr, Branching is to be done on a variable and I have found a way to do C1 + C2 = 1 in Cplex. model.add(C1 || C2) (20 Aug '15, 04:37) Prasanna
Be the first one to answer this question!
 toggle preview community wiki

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "Title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

Tags:

×191
×27
×21