1. Why Plot Constraints on a Graph
In a linear programming problem, constraints are usually written as inequalities in two variables, like \( 2x + y \le 8 \). To understand all possible solutions at once, it is very helpful to draw these constraints on a coordinate plane.
Each constraint splits the plane into two parts. One part satisfies the inequality and the other part does not. The overlapping region formed by all constraints is called the feasible region, and plotting is the first step towards finding it.
2. Step 1: Write the Constraint as an Equation
Every linear inequality can be turned into an equation by replacing the inequality sign with an equality sign. This gives the boundary line of the constraint.
For example, the constraint
\( 2x + y \le 8 \)
has the boundary line
\( 2x + y = 8 \)
This line will be drawn first, and then we decide which side of it to shade.
3. Step 2: Find Two Points (Intercept Method)
To draw the boundary line, it is enough to find any two points on it. The easiest way is often to use intercepts.
3.1. Finding the x-Intercept
To find the x-intercept, put \( y = 0 \) in the equation and solve for \( x \).
For the line \( 2x + y = 8 \):
\( 2x + 0 = 8 \Rightarrow x = 4 \)
So the x-intercept is the point \( (4, 0) \).
3.2. Finding the y-Intercept
To find the y-intercept, put \( x = 0 \) in the equation and solve for \( y \).
For the line \( 2x + y = 8 \):
\( 2 \cdot 0 + y = 8 \Rightarrow y = 8 \)
So the y-intercept is the point \( (0, 8) \).
3.3. Drawing the Line
Now plot the points \( (4, 0) \) and \( (0, 8) \) on the coordinate plane and join them with a straight line. This is the boundary line of the constraint.
4. Step 3: Choose Solid or Dashed Line
The type of line drawn depends on the inequality symbol in the original constraint:
- If the constraint is \( \le \) or \( \ge \), the boundary is included, so a solid line is used.
- If the constraint is \( < \) or \( > \), the boundary is not included, so a dashed line is used.
For example, for \( 2x + y \le 8 \), the boundary line \( 2x + y = 8 \) is drawn as a solid line.
5. Step 4: Decide Which Side to Shade (Half-Plane)
Once the boundary line is drawn, we need to decide which side of the line satisfies the inequality. This shaded region is the half-plane representing the constraint.
A simple method is the test point method.
5.1. Using a Test Point
Take any point that is not on the line, usually \( (0, 0) \) is the easiest choice if it is not on the line.
Substitute this point into the original inequality:
- If the inequality is true, shade the region containing the test point.
- If the inequality is false, shade the opposite side of the line.
5.2. Example with Test Point
For the constraint \( 2x + y \le 8 \), test the point \( (0, 0) \):
\( 2 \cdot 0 + 0 = 0 \le 8 \)
The inequality is true, so the region containing \( (0, 0) \) is shaded.
6. Example: Plotting Two Constraints Together
Consider the constraints:
\( x + y \le 6 \)
\( x \ge 0 \)
\( y \ge 0 \)
6.1. Step-by-Step Plotting
- First constraint: \( x + y \le 6 \)
Boundary line: \( x + y = 6 \).
Intercepts: when \( x = 0 \), \( y = 6 \); when \( y = 0 \), \( x = 6 \). Draw a solid line through \( (0, 6) \) and \( (6, 0) \). Test point \( (0, 0) \): \( 0 + 0 \le 6 \) is true, so shade the side containing \( (0, 0) \). - Second constraint: \( x \ge 0 \). This means the region on or to the right of the y-axis.
- Third constraint: \( y \ge 0 \). This means the region on or above the x-axis.
The common shaded region in the first quadrant that satisfies all three constraints is part of the feasible region.