About the graphical method
What is the graphical method?
The graphical method solves linear programming problems with two decision variables by drawing them. Each constraint is a half-plane bounded by a straight line; the points that satisfy all of them form the feasible region, a convex polygon. A fundamental theorem of linear programming says that if an optimal solution exists, one is found at a corner point (vertex) of that region.
Corner-point method and objective-line method
There are two ways to finish. The corner-point method computes the objective at every vertex and keeps the best value. The objective-line (iso-profit or iso-cost) method draws the line c₁x₁ + c₂x₂ = z for some value of z and moves it parallel to itself in the direction that improves z; the last vertex it touches is optimal. This page shows both, and the slider lets you move the line yourself.
Special cases
Infeasible: the constraints have no common point, so there is no feasible region. Unbounded: the region extends without limit in a direction that improves z. Alternative optima: the objective line is parallel to an edge of the region, so every point of that edge is optimal. Redundant constraint: a constraint that does not touch the region and can be removed without changing it.
When to use the simplex method
The graphical method only works with two variables (three at most, in a 3D drawing). For larger problems use the simplex method, which moves from corner to corner algebraically. Both methods give the same answer, and the simplex calculator on this site opens any two-variable problem from this page with one click.
Frequently asked questions
Why is the optimum always at a corner point?
The objective is linear, so on any edge of the feasible region its value changes steadily from one end to the other. The best value is therefore reached at an end of an edge, a corner point, unless the whole edge ties, which is the case of alternative optima.
How do I know which side of a line is feasible?
Substitute a test point that is not on the line, usually the origin (0, 0). If it satisfies the inequality, the feasible side is the one containing the test point; otherwise it is the opposite side.
Can it solve minimization problems and ≥ constraints?
Yes. Choose Minimize for cost problems, and use ≤, ≥ or = for each constraint. For minimization the optimum is the corner with the smallest value of z.
What happens with more than two variables?
The graphical method needs a two-dimensional drawing, so it is limited to two variables. Use the simplex method calculator for three or more.