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's gravatar image

Ximenes
3045
accept rate: 0%

edited 22 Aug '12, 10:45

Paul%20Rubin's gravatar image

Paul Rubin ♦♦
14.6k412


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

link

answered 22 Aug '12, 01:54

erwin's gravatar image

erwin
40113
accept rate: 10%

edited 22 Aug '12, 07:15

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

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. :)

link

answered 22 Aug '12, 00:18

ksphil's gravatar image

ksphil
66717
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

Thank you all. You are so helpful.

link

answered 22 Aug '12, 09:00

Ximenes's gravatar image

Ximenes
3045
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • 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

Asked: 21 Aug '12, 22:58

Seen: 2,548 times

Last updated: 22 Aug '12, 10:55

OR-Exchange! Your site for questions, answers, and announcements about operations research.