Example 1. For the independent variables $\mathrm{x}$, $\mathrm{y}$, under the constraints $x+1 \geqslant 0, y+1 \geqslant 0, x-2 y+2 \geqslant 0, \quad x+y \leqslant 2$, find the maximum and minimum values of the function $z=2 x+y$.
Solve: First, determine the range of values for $x$ and $y$. It is the closed region of a quadrilateral with vertices $\mathrm{A}(-1,-1)$, $\mathrm{B}(3,-1)$, $\mathrm{C}\left(\frac{2}{3}\right.$, $\left.\frac{4}{3}\right)$, and $\mathrm{D}\left(-1, \frac{1}{2}\right)$ (Figure 1).

Let $\mathrm{k}=2 \mathrm{x}+\mathrm{y}$, i.e., $\mathrm{y}=-2 \mathrm{x}+\mathrm{k}$. From analytic geometry, it is known that when the parameter $k$ is fixed, $y=-2 x+k$ represents

a line on the plane with a slope of
-2 and a y-intercept of $\mathrm{k}$. Therefore, the maximum and minimum intercepts of the moving line with a slope of -2 as it passes through region D are the maximum and minimum values of the function $z=2 x+y$.

From the characteristics of the region, it is easy to see that the moving line with a slope of -2 has the maximum y-intercept when it passes through point $\mathrm{B}$, and the minimum y-intercept when it passes through point $\mathrm{A}$.
$$
\begin{array}{l}
\therefore z_{\text {max }}=2(3)+(-1)=5, \\
z_{\text {min }}=2(-1)+(-1)=-3 .
\end{array}
$$