# how to make my constraint solvable in cplex?

 2 I don't know how deal with following constraint: x(m,h)=t(m,h)*[1-t(m,m+1)]*[1-t(m,m+2)]*...[1-t(m,h-1)], of which t() are all boolean variables. Such as x(1,7)=t(1,7)*[1-t(1,2)][1-t(1,3)]...*[1-t(1,6)] A model including such a constraint can not be solved by cplex. So I want to ask can you help me to make a change to the constraint so that it can be extracted by cplex. Thank you. asked 21 Aug '12, 22:58 Ximenes 30●4●5 accept rate: 0% Paul Rubin ♦♦ 14.6k●4●12

 5 In general: x(m,h) <= t(m,h) x(m,h) <= 1-t(m,m+1) x(m,h) <= 1-t(m,m+2) ... x(m,h) <= 1-t(m,h-1) x(m,h) >= t(m,h) - t(m,m+1) - t(m,m+2)... - t(m,h-1) x(m,h) binary (or continuous between 0 and 1 if that performs better)  There may be possibilities to improve the formulation depending on the rest of the model. Erwin answered 22 Aug '12, 01:54 erwin 401●1●3 accept rate: 10% 4 @ximenes The key to @erwin answer is that the product of Boolean variables is equivalent to their conjunction. Hence x = b1.b2 where all variables are binary is stated as x <= b1 x <= b2 x >= b1 + b2 -1 (22 Aug '12, 04:25) jfpuget
 0 I am not a deterministic guy, which means I am not using cplex. Correct me if I am wrong. You have to list all the possible constraints as far as I know. Yes, it is not an easy job. and not efficient. That's why people use front-end interface softwares (I am not sure it is the right term for the software), such as GAMS. There must be a lot, but GAMS is the only thing I've ever used. I heard even MATLAB can be a front end of CPLEX. These software will prepare all the constraints. Of cause, you have to code it properly. You need to find the right one and learn how to use. Don't ask me which one. :) answered 22 Aug '12, 00:18 ksphil 667●1●7 accept rate: 14% 1 I'm not sure if any of the major modeling languages will automatically linearize the product of binary terms. (22 Aug '12, 10:47) Paul Rubin ♦♦ I misunderstood the point of the question. :) (22 Aug '12, 10:55) ksphil
 0 Thank you all. You are so helpful. answered 22 Aug '12, 09:00 Ximenes 30●4●5 accept rate: 0%
 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
×37
×6