I've been stuck with this problem for hours, so I'd be really grateful if anyone could give me a hand. I need to turn the following nonlinear function into a set of linear constraints:
Y3 = 0, IF Y1=0 and Y2=0 OR Y1=1 and Y2=1;
Y3 = 1, IF Y1=0 and Y2=1 OR Y1=1 and Y2=0
Where Y3 is a binary variable with values 0 or 1.
I have just taken a mathematical programming module so I'm not even sure what I'm asking for is even possible, but any opinions would be appreciated. Thank you!
Realized all I needed to do was to apply the XOR constraints:
Y3<=Y1+Y2 Y3>=Y1-Y2 Y3>=Y2-Y1 Y3<=2-Y1-Y2 0<=Y3<=1
Many thanks to Math1000 and to Willie for pointing me in the right direction!