Constrained optimization and level curves

constraintsoptimization

I'm currently working on this Optimization problem:

$\min \max (|x-2|,|y+1|)$

Subject to

$x,y\geq0$

We have been asked to show the optimal solutions graphically using the fact:

$\max (|x-2|,|y+1|) = ||\boldsymbol m-\boldsymbol c||_\infty$

How do I draw level curves from $z = ||\boldsymbol m-\boldsymbol c||_\infty$ for different values of z?

Also, let's say $z=\max (|x-2|,|y+1|)$ if I was to generate the objective function:

$\min z$

How would I extract the matrix $c^T$ that comes from the standard form:

$\min c^T \boldsymbol x$

Best Answer

Follows a plot for $\max\left(|x-2|,|y+1|\right)$

enter image description here

as well as the correspondent level curves

enter image description here

EDIT

Attached the plotting script. (in MATHEMATICA)

Plot3D[Max[Abs[x - 2], Abs[y + 1]], {x, 0, 5}, {y, 0, 5}, Mesh -> False, PlotStyle -> Directive[Orange, Opacity[0.5],Specularity[White, 30]]]
gr1 = ContourPlot[Max[Abs[x - 2], Abs[y + 1]], {x, 0, 5}, {y, 0, 5}, Contours -> 15, ContourShading -> None, ContourStyle -> Black];
gr2 = ParametricPlot[{1, 0} + t {-1, 1}, {t, 0, 1}, PlotStyle -> {Dashed, Red}];
gr3 = ParametricPlot[{3, 0} + t {1, 1}, {t, 0, 2}, PlotStyle -> {Dashed, Red}];
Show[gr1, gr2, gr3]
Related Question