title: MIP/LP - Modelling "if b=1 then x=y" constraint
body: <p>I have a Mixed Integer Programming (MIP) problem, currently modelled in Python's PuLP library. My issue is however very generic, syntax doesn't play a role here. </p>
  
  <p><strong>I want to add a constraint to my model that works like this:</strong></p>
  
  <pre><code>if b=1 then x=y
  </code></pre>
  
  <p>The variable <code>b</code> is a binary variable taking values 0 or 1. <code>x</code> and <code>y</code> are variables that represent the current stock level. <code>x</code> as a continuous variable, <code>y</code> as an integer variable. </p>
  
  <p>I know constraints can only be modelled in the following format:</p>
  
  <pre><code>a*x+c &lt;= y    # a, c are constants, x, y variables
  </code></pre>
  
  <p>I hope there is some workaround how I can model the above described <code>if b then x equals y</code> constraint.</p>
  
  <p>Here are my approaches so far:</p>
  
  <pre><code>b*y &lt;= x
  y &gt;= x*b   # works in theory, but multiplication of 2 variables is not allowed
  </code></pre>
  
  <p>For 2 binary variables x and y the following is true:</p>
  
  <pre><code>M*y &gt; x    # represents: if x then y (M is a sufficient large constant)
  </code></pre>
  
  <p>I guess the solution involves a large M constant, maybe even further helper variables. </p>
  
  <p>A little background: I want to model an inventory problem, with continuous stock levels. However, order decisions should only be possible in integer numbers. I therefore need the stock level to be modelled with float numbers. At the point of order (b==1) however in integer.</p>
  
  <p>I hope someone can help here, even if this is rather theoretic than directly coding related. Hints to further resources that might help are also highly appreciated.</p>