title: Converting conditional constraints to linear constraints in Linear Programming
body: <p>I have two variables: x>= 0 and y binary (either 0 or 1), and I have a constant z >= 0. How can I use linear constraints to describe the following condition:</p>
  
  <pre><code>If x = z then y = 1 else y = 0.
  </code></pre>
  
  <p>I tried to solve this problem by defining another binary variable i and a large-enough positive constant U and adding constraints</p>
  
  <pre><code>y - U * i = 0;
  x - U * (1 - i) = z;
  </code></pre>
  
  <p>Is this correct?</p>