Solving a Two-Variable Linear Program Graphically
A linear program in two variables can be solved by drawing: shade the feasible region, draw the objective as a family of parallel contour lines, and push the contour in the improving direction until it is about to leave the region. The last point it touches is optimal, and it is always a vertex unless a whole edge is touched at once.
Definition
The graphical method solves a linear program in two variables by plotting the feasible region in the plane, plotting the objective as the family of lines
Formal statement
For
Assumptions and scope
The method applies only to two decision variables. Three variables require a spatial picture that is unreliable to read, and more than three cannot be drawn at all.
Reading a plot gives an approximate answer. The exact optimum is obtained by solving the two constraint equations that are tight at the identified corner, not by reading coordinates off the axes.
If the feasible region is empty the program is infeasible and no contour touches anything. If it is unbounded in an improving direction the program has no finite optimum, and the sliding line never loses contact.
Nonnegativity is not automatic. A variable allowed to be negative extends the region beyond the first quadrant, and the plot must be drawn accordingly.
Forms this is expressed in
The same content in several forms. Each makes something visible that the others leave implicit, so moving between them is part of understanding the topic rather than a presentation choice.
symbolic
A two-variable linear program written algebraically:
Each constraint is an inequality in two unknowns. The objective is a linear expression whose value is to be made as large as possible. Nothing in this form refers to position, direction, or area: it is a statement about which number pairs satisfy which inequalities.
Translates into: geometric
geometric
The same program drawn in the plane. Each constraint
Optimising becomes a motion: push the contour along
This form makes visible what the algebra does not, that the feasible set is convex, that an optimum occurs at a corner, and that a contour parallel to a binding edge yields a whole segment of optima. It cannot supply exact coordinates: those must be recovered by translating back to the symbolic form and solving the tight constraints.
Translates into: symbolic, tabular
tabular
The corners of the feasible region enumerated, with the constraints tight at each and the objective value there. For the worked example
| Corner | Tight constraints | |||
|---|---|---|---|---|
| origin | 0 | 0 | 0 | |
| upper left | 0 | 6 | 12 | |
| interior corner | 4 | 4 | 20 | |
| lower right | 6 | 0 | 18 |
This form is exact where the drawing is approximate, and it is the accessible equivalent of the geometric form: it states which corners exist and what the objective is worth at each, which is the instructional content the picture carries. What it loses is the motion, why pushing the contour reaches this corner rather than another, and what happens when the contour is parallel to an edge.
Translates into: geometric
Worked material
Contrast
The drawing locates the corner; algebra gives coordinates
The plot is a device for deciding which corner is optimal. It is not a measuring instrument, and treating it as one produces answers that are wrong in a way no amount of careful drawing can fix.
Take
Read from the plot. The lines cross somewhere near
Solve the tight constraints. At the crossing both hold with equality:
From the second,
Here the reading happened to be right. That is luck, not method: the intersection landed on integers.
Now shift one constraint. Replace the first with
The reliable division of labour. Use the picture to identify the optimal corner and which two constraints are tight there. Then solve those two equations. A hand-drawn axis cannot distinguish
Common errors
Common misconception
The optimal solution is whatever coordinates can be read off the plotted diagram at the corner that looks furthest in the improving direction.
Related units
Requires
- Formulating a Linear Program
- The Feasible Region of a Linear Program
- Contour Lines and the Direction of Improvement
- Plotting Linear Inequalities
Connected
- Extreme Points and Basic Feasible Solutions (represented by)
- The Four Terminal Outcomes (best taken before)