title: Minimum of a variable and a constant in PULP python integer programming
body: <p>I am stuck with a problem in Integer Programming constraint using PULP in python. I have 2 variables x1, x2 and a constant y. How do i write a constraint on x1 = min(x2 ,y1).</p>
  
  <p>I have written below two condition:
  x1 &lt; y1;</p>
  
  <p>x1 &lt; x2</p>
  
  <p>But it is giving me x1 = 0 for my problem.
  It should take one of the values from x2 and y1</p>
  
  <p>Thanks in advance. Will really appreciate your help. </p>
  
  <p><strong>Code used:</strong></p>
  
  <pre><code>*import pandas as pd
  from pulp import *
  
  data = pd.read_csv("Test.csv")
  limit = LpVariable("limit",0, 1000, cat='Integer')
  sales = LpVariable.dicts("Sales", (i for i in data.index), lowBound=0,  cat="Integer")
  
  ####### Defining the Problem
  prob = pulp.LpProblem("Profit", pulp.LpMaximize)
  prob += pulp.lpSum((1-data.loc[i,'Prize']) * sales[i] for i in data.index)
  
  ####### Constraints
  for idx in data.index:
      max_sales = data.loc[idx, 'Sales'] + data.loc[idx, 'Rejec']
      prob += sales[idx] &lt;= max_sales
      prob += sales[idx] &lt;= limit
  
  ###### Getting the output    
  prob.solve()
  for v in prob.variables():
      print v.name,v.varValue
  
  print value(prob.objective)
  </code></pre>
  
  <p><strong>Data Used (try.csv)</strong> 
  <a href="https://i.stack.imgur.com/QLYtP.png" rel="nofollow noreferrer">enter image description here</a></p>