title: How do I encode Manhattan distance in Mixed Integer Programming
body: <p>Lets have two points, (x1, y1) and (x2,y2)</p>
  
  <p>dx = |x1 - x2|</p>
  
  <p>dy = |y1 - y2|</p>
  
  <p>D_manhattan = dx + dy where dx,dy >= 0</p>
  
  <p>I am a bit stuck with how to get x1 - x2 positive for |x1 - x2|, presumably I introduce a binary variable representing the polarity, but I am not allowed multiplying a polarity switch to x1 - x2 as they are all unknown variables and that would result in a quadratic. </p>