I need to formulate the following as linear constraints using binary variables. Can someone help me out?

If A <= 3, then B >= 6, else B <= 4 (Assume A & B are integers)

asked 17 Sep '15, 15:10

Shyam's gravatar image

Shyam
1
accept rate: 0%


You want to model \[ (\underline{A} \le A \le 3 \text{ and } 6 \le B \le \overline{B}) \text{ xor } (4 \le A \le \overline{A} \text{ and } \underline{B} \le B \le 4) \]

Let \(x=0\) correspond to the left half of the exclusive disjunction and \(x=1\) correspond to the right half. Here's a way to organize the needed constraints so that it is easy to visually check their correctness: \begin{align} 4x + \underline{A} (1-x) \le &A \le \overline{A} x + 3 (1-x) \\ \underline{B}x + 6 (1-x) \le &B \le 4x + \overline{B}(1-x) \end{align}

link

answered 17 Sep '15, 17:58

Rob%20Pratt's gravatar image

Rob Pratt
1.2k26
accept rate: 28%

edited 18 Sep '15, 10:47

\begin{gather*} A \le 3 + \text{UB}(A) * x\\ B \ge 6 - \text{LB}(B) * x\\ B \le 4 + \text{UB}(B) * (1 - x)\\ x ~\textrm{binary} \end{gather*}

link

answered 17 Sep '15, 15:39

fbahr's gravatar image

fbahr ♦
4.6k716
accept rate: 13%

edited 17 Sep '15, 18:05

Paul%20Rubin's gravatar image

Paul Rubin ♦♦
14.6k412

1

I think you also need \(A \ge 4 - LB(A)*(1 - x)\). Otherwise \(A \le 3\) and \(B \le 4\) (with \(x = 1\)) satisfies the constraints.

(17 Sep '15, 18:12) Paul Rubin ♦♦

I had asked a similar question last year about this time. You may find this link helpful.

link

answered 15 Oct '15, 04:20

crypto's gravatar image

crypto
6727
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:

×101
×21

Asked: 17 Sep '15, 15:10

Seen: 944 times

Last updated: 15 Oct '15, 04:20

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