title: How to set an equality constraint like y = max(x1,x2,x3) in our MIP problem with or-tools?
body: <p>I work with or-tools to solve an MIP problem and I would like to add a constaint where a variable y is equal to the maximum among other variables Xi. For example : y = max(x1,x2,x3). Is there any max function in or-tools to do this?</p>
  
  <p>I could add 4 constraints like :</p>
  
  <pre><code>y &gt;= x1
  y &gt;= x2
  y &gt;= x3
  y &lt;= MAX  # where MAX is the upper bound of y.
  </code></pre>
  
  <p>But there could be a wrong situation where </p>
  
  <pre><code>x3 &gt;= y.
  </code></pre>