Formulate as a linear optimization problem. For given numbers a and b find two numbers x and y whose difference is at most 1, such that |x −a|+|y −b| is minimal.
So far I know that |x −y| $\le$ 1 but I am not sure where to go next.
Formulate as a linear optimization problem. For given numbers a and b find two numbers x and y whose difference is at most 1, such that |x −a|+|y −b| is minimal.
So far I know that |x −y| $\le$ 1 but I am not sure where to go next.
$$ \mbox{Minimize }\; Z=\omega_1+\omega_2 $$ subject to $$ x-y\le 1\\ -x+y \le 1 \\ x-a\le \omega_1 \\ -x+a \le \omega_1\\ y-b\le \omega_2 \\ -y+b \le \omega_2\\ $$