Loading [MathJax]/jax/output/CommonHTML/jax.js

Tuesday, October 18, 2016

MIP Modeling: if constraint

From http://cs.stackexchange.com/questions/51025/cast-to-boolean-for-integer-linear-programming/51089#51089

could you please explain the your logic with binary variable delta, for more general case, for instance, if y={a: x>0, b: x<0}.

If we assume y can be either a or b (constants) when x=0, and x[L,U]  (with L<0 and U>0) then we can write

y={ax0bx0L(1δ)xUδy=aδ+b(1δ)δ{0,1}

I am not sure if the left part is formulated mathematically correctly. May be I should say:

y={ax>0bx<0a or bx=0

If we want to exclude x=0 then we need to add some small numbers:

y={ax>0bx<0ε+(Lε)(1δ)xε+(U+ε)δy=aδ+b(1δ)δ{0,1}ε=0.001
Of course in many cases we can approximate UU+ε (similar for L), I was a bit precise here.

If a and b are variables (instead of constants) things become somewhat more complicated. I believe the following is correct:

ε+(Lε)(1δ)xε+(U+ε)δa+M1(1δ)ya+M2(1δ)b+M3δyb+M4δδ{0,1}ε=0.001M1=bLOaUPM2=bUPaLOM3=aLObUPM4=aUPbLO

I used here a[aLO,aUP] and b[bLO,bUP].

No comments:

Post a Comment