2
$\begingroup$

I having formulating the following (what should be fairly simple) ilp constraint. Basically let $p$ be a binary variable and $s$ be an integer that is greater than or equal to 0.

The constraint is simply:

if(p==1) then s=0.

I do not care what s is when p is 0. Any ideas or resources to check? I feel like this shouldn't be too hard.

$\endgroup$

1 Answer 1

3
$\begingroup$

Nowing that $s \ge 0$, I think you'd better take $s \le M\, (1-p)$, where $M$ is a large enough value. When $p=1$, then $s=0$. Is $p=0$, than $s$ can be any value between $0$ and $M$.

$\endgroup$
1
  • $\begingroup$ Wow, thanks for your answer. This was exactly what I was looking for. I would upvote if I could. $\endgroup$ Commented Jun 20, 2013 at 20:45

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.