The five moves, in order
- Graph each constraint as a line, then shade the permitted side of it
- Find the feasible region as the intersection of all shaded half-planes
- Identify every corner point, including the points where two boundary lines cross
- Evaluate the objective function at each corner point
- Read off the largest or smallest value, and test it if the region is unbounded
Each move has a characteristic failure. Drawing the line but never choosing a side produces a picture that cannot be read back. Intersecting the sides one pair at a time and forgetting a constraint keeps a vertex that the problem forbids. Evaluating only the corners where an axis is involved misses the crossing of the two real constraints, which is very often the optimum. And stopping at step four when the region is unbounded risks reporting a value that some far-away point already beats. The order matters because each move consumes the output of the previous one, and an error early on is invisible by the time the arithmetic starts.
Sketching the region with intercepts only
A straight line with both and non-zero is fully determined by its two intercepts: set to get , and set to get . For those are and ; for only a vertical line is possible and the intercept idea degenerates into the line itself. Two points and a ruler are therefore enough for every boundary in a two-variable problem.
Choosing the side takes one substitution. The origin is the usual test point unless it lies on the line, in which case pick any point clearly off it. For the origin gives , a true statement, so the shaded side contains the origin; for the origin gives , false, so the shaded side is the one away from it. The boundary line itself belongs to the region whenever the inequality is non-strict, which is why the corner points, sitting on boundaries, are feasible. The feasible region is the overlap of all shaded areas, and in a bounded problem that overlap is a polygon whose vertices are exactly the surviving intersections of boundary lines.
Example: Solve LP Problem Graphically
Maximize subject to:
Two vertices in that list deserve a second look. The point is the crossing of and , but it violates because , so it is not in the region and never enters the table. The winning point sits on two boundaries at once, and , which is the normal situation: the optimum of a bounded problem is a corner, and a corner is where two constraints are simultaneously tight.
Example: Minimization Problem
Minimize subject to:
Why the optimum lands on a corner
Fix a value of and the equation draws one straight line; changing slides that line without ever tilting it, because the tilt is decided by the ratio of to and only the intercept moves. The whole question of optimisation therefore becomes: how far can the line be pushed in the improving direction before it leaves the region for good? Since the region is convex, the last point of contact as the line sweeps outward must be a vertex, and if the sweeping line happens to run along an edge, every point of that edge is the last point of contact at once.
The numbers in the first example show the mechanism. The objective has slope , the boundary has slope , and the line is horizontal with slope . Because is steeper than , which is steeper than , the level line leaves the region at the vertex where those two boundaries meet, giving . Had the objective been , its level line would have been parallel to and the answer would have been spread along that whole edge instead of pinned to a single point.
The extra test for unbounded regions
A bounded region automatically has a largest and a smallest objective value, so the corner table alone settles the answer. An unbounded region does not: the table lists only the vertices, and some non-vertex point escaping to infinity may do better than any vertex. The missing question is whether the region contains a direction in which the objective keeps improving.
For the minimization example the claimed answer is , so the test is whether any feasible point satisfies . It does not, and there is a short certificate of that fact. The two constraints give and ; multiply the first by and the second by and add:
Because both multipliers are non-negative, the combination is legitimate for inequalities, and it produces the objective on the left and the claimed value on the right. The certificate exists because is a non-negative combination of the normals and , and that is exactly the condition that makes a minimization problem bounded. For a maximization over an unbounded region the same kind of certificate does not exist, and the correct answer is that can be made arbitrarily large.
Corner Point Method Summary
Multiple Optimal Solutions
Writing the test as a cross product, , avoids dividing by a coefficient that may be zero, and it is the same computation as comparing slopes: two lines are parallel exactly when their normals are proportional. Parallelism alone is not enough, the edge in question must also belong to the feasible region, so the check always ends by confirming that both endpoints of the edge satisfy every constraint.
Example: Multiple Solutions
Maximize subject to:
Confirming the picture numerically
The grid sweep below is the computational version of scanning the sketch: evaluate the objective at every lattice point that survives all constraints and record the extremes. The bounded example returns a stable pair, while the unbounded example returns a minimum that never moves and a maximum that grows with the window, which is what an unbounded region looks like from any finite sheet of graph paper.
import numpy as np
def scan(lines_le, objective, window=10.0, step=0.25):
"""Evaluate the objective on every grid point of the window that
satisfies every constraint written as a*x + b*y <= c."""
xs = np.arange(0, window + step / 2, step)
ys = np.arange(0, window + step / 2, step)
lo, hi = None, None
for x in xs:
for y in ys:
if all(a * x + b * y <= c + 1e-9 for a, b, c in lines_le):
z = objective(x, y)
lo = z if lo is None or z < lo else lo
hi = z if hi is None or z > hi else hi
return round(lo, 6), round(hi, 6)
bounded = [(1, 1, 4), (1, 0, 2), (0, 1, 3)] # x+y<=4, x<=2, y<=3
unbounded = [(-1, -2, -8), (-3, -1, -9)] # x+2y>=8, 3x+y>=9
print("bounded (min, max):", scan(bounded, lambda x, y: 3 * x + 4 * y))
# bounded (min, max): (0.0, 15.0)
print("unbounded (min, max):", scan(unbounded, lambda x, y: 2 * x + 3 * y,
window=12.0, step=0.5))
# unbounded (min, max): (13.0, 60.0)
Both maxima and minima reported by the grid agree with the corner tables, and the second call makes the asymmetry explicit: is a property of the region, while is a property of the chosen window and would be larger with a bigger window.
Detecting a whole optimal edge
When the objective is parallel to a binding constraint the answer is a segment, and that can be detected without solving anything twice. The function compares the two normals by cross multiplication, then sweeps the edge to show that the objective value does not move.
import numpy as np
def edge_is_optimal(obj, boundary, tol=1e-9):
"""a*x + b*y is parallel to a2*x + b2*y = c when a*b2 - a2*b vanishes."""
a, b = obj
a2, b2 = boundary
return abs(a * b2 - a2 * b) < tol
print("2x+2y against x + y = 6 :", edge_is_optimal((2, 2), (1, 6))) # True
print("3x+4y against x + y = 6 :", edge_is_optimal((3, 4), (1, 6))) # False
edge = [(t, 6 - t) for t in np.linspace(0, 6, 13)]
values = [2 * x + 2 * y for x, y in edge]
print("distinct values on edge :", sorted(set(np.round(values, 9)))) # [12.0]
The first two lines separate the two cases that the slope test decides, and the sweep confirms the geometric claim: thirteen samples along the segment from to all return , so the solution set really is the entire edge. A single distinct value is the numerical signature of multiple optima, and it is the check worth running before writing the answer down.
Common Mistakes
Keeping a vertex that violates one of the constraints because it looked like a corner on the sketch
Fix: Test every candidate intersection against every inequality before it enters the corner table, including the two candidates that cross outside the shaded overlap.
Stopping at the smallest corner value when the feasible region is unbounded
Fix: Run the extra test: show that the open half-plane beyond the claimed value contains no feasible point, using a non-negative combination of the constraints as a certificate.
Giving a single point as the answer when the objective is parallel to a binding constraint
Fix: State the whole segment with both endpoints, and confirm the parallelism with the cross product of the two coefficient pairs.
Evaluating the objective only at the intercepts of each boundary with the axes
Fix: Include the crossing of the two constraint lines, which is where the optimum most often sits when both resources are scarce.
Key Takeaways
- Every boundary is drawn from two intercepts and every shaded side from one substitution, so the feasible polygon can be produced without trial and error.
- The objective is a family of parallel level lines, and the optimum is the last point of contact as that line sweeps across a convex region, which is why a vertex or a whole edge answers the question.
- A corner table settles bounded problems outright, but an unbounded region needs a second test, and a non-negative combination of the constraints that reproduces the objective is a complete certificate for a minimum.
- Parallelism between the objective and a binding constraint turns the unique answer into a segment, detected by the cross product of coefficients and confirmed by sweeping the edge for a constant value.