4

How can one model the following condition in an integer linear program?

$$A = \begin{cases} 1 & \text{if } B > C\\ 0 & \text{otherwise}\end{cases}$$

where $A \in \{0,1\}$ and $B, C \in \mathbb N$. We have upper and lower bounds on both $B$ and $C$.

Salah
  • 91
  • 1
  • 6
  • It's a completely different question. I've already searched for linked questions before posting. – Salah Jan 30 '17 at 11:16
  • There is no "conversion to binary". An equation A=B-C means just that - that A equals B-C. – Yuval Filmus Jan 30 '17 at 13:18
  • Do you know an upper bound on $|B-C|$? If you do, you can use the techniques at http://cs.stackexchange.com/q/12102/755 ("cast to boolean"). If you don't, it's much harder (and neither of the existing answers works). Can you edit the question to clarify? 2. When you say "binary integer", do you possibly mean that its value is either 0 or 1? When you say "non-binary integer", do you mean that its value is not limited to 0 or 1? If so, you should probably include that definition in the question, as it probably won't be obvious (it's easy to assume you mean "in binary representation").
  • – D.W. Jan 30 '17 at 17:30
  • You say that B and C are positive integers. In that case B > C is equivalent to B ≥ C + 1, which makes it a lot easier. – gnasher729 Jan 30 '17 at 20:20