linear program formulation

progli

New member
Joined
Aug 6, 2012
Messages
5
Hi everyone,

Could you help me to model the following constraint in a LP

z=1 if x!=y
z=0 if x=y

knowing that x,y and z are binary decision variables (0/1)

we can also express it as:

z=x+y case1
z=x-y case2

Thank you in advance.
 
Hi everyone,

Could you help me to model the following constraint in a LP

z=1 if x!=y
z=0 if x=y

knowing that x,y and z are binary decision variables (0/1)

we can also express it as:

z=x+y case1
z=x-y case2

Thank you in advance.
I'm not understanding the constraints. If x and y are binary decision variables, then x! (assumed x factorial) is always 1. Therefore there case of (x,y)=(1,0), y is neither equal to x nor is it equal to x!, so what is z? In the case of (1,1), y is equal to both x and x! which means z is both 0 and 1. So, I would think something would have to be changed.
 
Thank you Ishuda for your reply.

I mean X<>y (x different from y) not factorial.

If you have any idea please let me know.
 
Thank you Ishuda for your reply.

I mean X<>y (x different from y) not factorial.

If you have any idea please let me know.
Yes, makes more sense. I may should have seen that.

Seems to me you answered the question when you said either z=x+y [modular arithmetic I assume] or z=x-y. So I'm still not sure about the problem. What is statement of the complete problem as given?
 
Actually, the LP has to minimise some function over a set of solutions by comparing them. Each solution is a vector of 0/1 bits. to be sure that it will generate and compare different solutions, I need to add a constraint in the form:
zi.png
and

zi=1 if xi<>yi

zi=0 if xi=yi
 
Top