The LPP graphical method is a technique used to solve linear programming problems (LPPs) with exactly two decision variables by plotting the constraints as lines on a graph, identifying the feasible region, and then finding the corner point that maximizes or minimizes the objective function. You input the objective function coefficients and constraint inequalities, and the method returns the optimal values of the two variables and the resulting objective value. This approach works only for two-variable problems, but it provides an intuitive visual foundation for understanding all linear programming.
Formula
The graphical method solves a system of linear inequalities. For two variables \(x\) and \(y\), the objective function is:
\(Z = c_1 x + c_2 y\)
where \(c_1\) and \(c_2\) are the coefficients (profit per unit, cost per unit, etc.). The constraints are linear inequalities of the form:
\(a_1 x + b_1 y \le c_1\) and \(a_2 x + b_2 y \le c_2\)
plus non-negativity \(x \ge 0, y \ge 0\). The optimal solution lies at a corner (vertex) of the feasible region. For two constraints, the intersection point is found by solving the two equations as equalities:
\(x = \frac{c_1 b_2 – c_2 b_1}{a_1 b_2 – a_2 b_1}\), \(y = \frac{a_1 c_2 – a_2 c_1}{a_1 b_2 – a_2 b_1}\)
This calculator solves that intersection for two constraints. For three or more constraints, you must check every corner point and compare objective values.
Worked Example
Maximize \(Z = 3x + 5y\) subject to:
- \(2x + y \le 100\)
- \(x + y \le 80\)
- \(x \ge 0, y \ge 0\)
Step 1: Find the intersection of the two constraint lines (treating them as equalities):
\(x = \frac{100 \times 1 – 80 \times 1}{2 \times 1 – 1 \times 1} = \frac{100 – 80}{2 – 1} = 20\)
\(y = \frac{2 \times 80 – 1 \times 100}{2 \times 1 – 1 \times 1} = \frac{160 – 100}{1} = 60\)
Step 2: Check this point satisfies both constraints: \(2(20) + 60 = 100\) ✓, \(20 + 60 = 80\) ✓.
Step 3: Evaluate \(Z\) at all corner points of the feasible region:
- (0,0): \(Z = 0\)
- (50,0): \(Z = 3(50) = 150\)
- (0,80): \(Z = 5(80) = 400\)
- (20,60): \(Z = 3(20) + 5(60) = 60 + 300 = 360\)
The maximum is 400 at (0,80). The calculator above gives the intersection (20,60) with objective 360, which is correct only when the intersection is the optimal corner. In this example, the corner (0,80) beats it, so the intersection alone is not enough — you must check all corners.
Assumptions
- Exactly two decision variables (x and y).
- All constraints are linear and the objective is linear.
- All variables are non-negative (standard form).
- Constraints are of the “≤” type; “≥” constraints require flipping signs or using the dual.
- The feasible region is bounded (not unbounded), otherwise the optimum may not exist.
When to Use the Graphical Method
The graphical method is taught in every operations research course because it makes the geometry of optimization visible. Use it when:
- You have exactly two decision variables (e.g., product A and product B).
- You need a quick, approximate answer without software.
- You want to understand sensitivity — how the optimal point shifts when a constraint changes.
- You are checking the result of a simplex method calculation.
For three or more variables, the graph becomes a hyperplane in higher dimensions, which is impossible to draw. That is when the simplex algorithm or interior-point methods take over. The graphical method is therefore both a learning tool and a verification tool, not a general-purpose solver.
How to Choose the Correct Corner
The optimal solution is always at a corner of the feasible region. To find it manually:
- Plot each constraint line by finding its x- and y-intercepts.
- Shade the half-plane that satisfies each inequality.
- Identify the overlapping region (the feasible region).
- List all corner points — intersections of constraint lines and axes.
- Evaluate the objective at each corner.
- Pick the largest (maximization) or smallest (minimization) value.
A common shortcut: if the objective coefficients are positive, the optimum is often at the corner farthest from the origin. But this rule fails with negative coefficients or mixed signs, so always check every corner. The calculator above automates the intersection step but not the corner comparison — that is why the worked example shows the full check.
Common Mistakes and Pitfalls
The most frequent errors in using the graphical method:
- Forgetting non-negativity: The feasible region is always in the first quadrant (x ≥ 0, y ≥ 0) unless stated otherwise.
- Shading the wrong side: Test a point like (0,0) in each inequality. If it satisfies, shade toward it; otherwise shade away.
- Using the intersection as the answer: The intersection of two constraints is only a candidate. You must compare it with axis intercepts and other corners.
- Misreading “≥” constraints: These shade the opposite side and often make the region unbounded.
- Unit mix-ups: If one constraint is in hours and another in units, convert to the same unit before plotting.
- Rounding too early: Keep fractions or three decimals until the final objective value.
Limits and Extensions
The graphical method fails when the feasible region is unbounded (the objective may grow infinitely) or when the optimal solution is not unique (the objective line is parallel to a constraint edge, giving infinitely many optimal points). It also cannot handle integer constraints — for that you need integer programming (branch and bound). For larger problems, the simplex method or software like Excel Solver, Python’s scipy.optimize.linprog, or dedicated LP solvers are the standard tools. The graphical method remains the best way to build intuition about what linear programming actually does: sliding a line (the objective) until it just touches the feasible region at a corner.
Frequently Asked Questions
Can I use the graphical method for 3 variables? No — you would need a 3D plot, and even then the feasible region becomes a polyhedron with faces and edges, not just lines. For 3+ variables, use the simplex method or a solver.
What if my constraints are “≥” instead of “≤”? The feasible region is then the area above the line. If all constraints are “≥”, the region is usually unbounded, and you need to check whether the objective is minimized (bounded below) or maximized (likely unbounded).
What does an unbounded solution mean? It means the objective can be increased (or decreased) without limit while still satisfying all constraints. In a real problem, this usually indicates a missing constraint — for example, forgetting a limit on total production hours or raw material.
How do I handle equalities (=) in constraints? An equality constraint is a single line, not a half-plane. The feasible region is then only the points on that line, which reduces the problem to a one-dimensional search along that line. The optimum will be at one of the endpoints where the line meets another constraint.
Why is the optimum always at a corner? Because the objective function is linear, its level sets are parallel lines. As you move the objective line in the direction of improvement, the last point it touches before leaving the feasible region must be a corner (or an entire edge, giving multiple optima). This is the fundamental theorem of linear programming.
Is the graphical method exact? Yes, when drawn and solved precisely, it gives the exact optimal solution. The only errors come from hand-drawing inaccuracies — which is why solving the intersection algebraically, as the calculator does, is more reliable than reading coordinates off a sketch.
Related
Formula used
in x1 | Coefficient of x in objective | - | 3 | -100 | 100 in x2 | Coefficient of y in objective | - | 5 | -100 | 100 in a1 | Constraint 1: coefficient of x | - | 2 | -100 | 100 in b1 | Constraint 1: coefficient of y | - | 1 | -100 | 100 in c1 | Constraint 1: RHS (≤) | - | 100 | -1000 | 1000 in a2 | Constraint 2: coefficient of x | - | 1 | -100 | 100 in b2 | Constraint 2: coefficient of y | - | 1 | -100 | 100 in c2 | Constraint 2: RHS (≤) | - | 80 | -1000 | 1000 out x_opt | Optimal x | units | (c1*b2 - c2*b1) / (a1*b2 - a2*b1) | 2 out y_opt | Optimal y | units | (a1*c2 - a2*c1) / (a1*b2 - a2*b1) | 2 out obj | Objective value | units | x1 * ((c1*b2 - c2*b1) / (a1*b2 - a2*b1)) + x2 * ((a1*c2 - a2*c1) / (a1*b2 - a2*b1)) | 2
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation with the constants and conversion factors written on the page, rounded as each result states. See method and constants, the disclaimer or report an error.
More in this section
- QPP Calculator Canada: How It Works & How to Use It
- PPP Calculator World Bank: How It Works & How to Use It2,000.00
- PPP Calculator: India vs USA Cost Comparison1,000.00 USD
- PPP Calculator USD to INR: How It Works2,335 INR
- PPP Calculator India vs UK: Real Cost Comparison103.63 GBP
- PPP Calculator India vs Dubai: Real Cost Comparison8,954.58 AED