Suppose I have a binary variables $b$ and two real variables $x$ and $y$ is there a way to assign $z_1=\min(x,y)$ and $z_2=\max(x,y)$ using mixed integer linear programming?
This is my attempt. Assume $-M<x,y<M$. Then let $$-bM\leq x'\leq bM$$ $$x-(1-b)M\leq x'\leq x+ (1-b)M$$
$$-(1-b)M\leq x''\leq (1-b)M$$ $$x-bM\leq x''\leq x+ bM$$
$$-(1-b)M\leq y'\leq (1-b)M$$ $$y-bM\leq y'\leq y+ bM$$
$$-bM\leq y''\leq bM$$ $$y-(1-b)M\leq y''\leq y+ (1-b)M$$
$$z_1=x'+y'$$ $$z_2=x''+y''$$ $$z_1\leq z_2.$$
Is there anything simpler than this?