Plotting linear inequalities
Plotting Linear Inequalities
A linear inequality in two variables represents a half-plane.
The boundary of the half-plane is a line.
General Form
A linear inequality has the form:
\[a_1x_1+a_2x_2\le b\]or:
\[a_1x_1+a_2x_2\ge b\]The associated boundary line is obtained by replacing the inequality with equality:
\[a_1x_1+a_2x_2=b\]Step 1: Draw the Boundary Line
To draw:
\[x_1+2x_2\le 10\]first draw:
\[x_1+2x_2=10\]Find two points on the line.
If $x_1=0$:
\[2x_2=10\] \[x_2=5\]so one point is:
\[(0,5)\]If $x_2=0$:
\[x_1=10\]so another point is:
\[(10,0)\]Draw the line through $(0,5)$ and $(10,0)$.
Step 2: Choose the Correct Side
The line divides the plane into two half-planes.
Only one side satisfies the inequality.
Use a trial point not on the line.
The easiest trial point is usually:
\[(0,0)\]For:
\[x_1+2x_2\le 10\]substitute $(0,0)$:
\[0+2(0)\le 10\] \[0\le 10\]This is true.
Therefore, the feasible side is the side containing $(0,0)$.
If the Trial Point Fails
For:
\[x_1+2x_2\ge 10\]substitute $(0,0)$:
\[0\ge 10\]This is false.
Therefore, the feasible side is the side opposite $(0,0)$.
Nonnegativity Constraints
The constraint:
\[x_1\ge 0\]means the point must be on or to the right of the vertical axis.
Its boundary is:
\[x_1=0\]The constraint:
\[x_2\ge 0\]means the point must be on or above the horizontal axis.
Its boundary is:
\[x_2=0\]Together:
\[x_1,x_2\ge 0\]restrict the graph to the first quadrant.
Equality Constraints
An equality constraint such as:
\[x_1+2x_2=10\]is only the line itself.
There is no side to choose.
Any feasible point must lie exactly on the line.
Strict vs Non-Strict Inequalities
Most LP problems use:
\[\le,\qquad \ge\]These include the boundary line.
If a strict inequality appears:
\[a_1x_1+a_2x_2<b\]then the boundary line is not included.
Standard LP usually avoids strict inequalities.
Example with Several Constraints
Consider:
\[x_1+2x_2\le 10\] \[2x_1+x_2\le 16\] \[-x_1+x_2\le 3\] \[x_1,x_2\ge 0\]For each inequality:
| Inequality | Boundary line |
|---|---|
| $x_1+2x_2\le 10$ | $x_1+2x_2=10$ |
| $2x_1+x_2\le 16$ | $2x_1+x_2=16$ |
| $-x_1+x_2\le 3$ | $-x_1+x_2=3$ |
| $x_1\ge 0$ | $x_1=0$ |
| $x_2\ge 0$ | $x_2=0$ |
The feasible region is the common overlap of all chosen half-planes.
Choosing Intercepts Quickly
For a line:
\[a_1x_1+a_2x_2=b\]The $x_1$-intercept is found by setting $x_2=0$.
The $x_2$-intercept is found by setting $x_1=0$.
This works especially well when both intercepts are easy to compute.
When Intercepts Are Awkward
If intercepts are fractions or the line does not cross one axis conveniently, choose any two values.
Example:
\[-x_1+x_2=3\]If $x_1=0$:
\[x_2=3\]If $x_1=1$:
\[x_2=4\]So the line passes through $(0,3)$ and $(1,4)$.
Checklist
To plot a linear inequality:
- replace the inequality by equality
- draw the boundary line
- choose a trial point
- test the inequality
- keep the side that satisfies it
- repeat for every constraint
See Also
Exam checkpoint
For graphical questions, first check whether nonnegativity is explicitly stated. Then draw half-planes, list vertices, evaluate the objective, and state finite optimum, infeasibility, multiple optima, or unboundedness.