Graphical Method Linear Programming (2 Variables): Step-by-Step

Last updated: β€’ Sources β€’ Methodology

Graphical Method Linear Programming (2 Variables): Plot Constraints, Find Corner Points, and Compute the Optimal Solution

The graphical method is the fastest way to understand LP: you draw the feasible region for two variables, list its corner points, and evaluate the objective. This page also shows how to spot infeasible, unbounded, and multiple optimal cases visually.

After you solve by hand, verify your result in the Linear Programming calculator. For a full LP foundation, see Linear Programming (LP) β€” Beginner Guide.

On this page

Quick takeaway: The graphical method linear programming approach (for 2 variables) is: (1) convert each constraint into a boundary line, (2) shade the feasible side for each inequality, (3) identify the feasible region intersection, (4) compute all corner points (extreme points), and (5) evaluate the objective at those corners. If no feasible region exists, the LP is infeasible; if the feasible region allows the objective to improve forever, it’s unbounded. Use Unbounded vs Infeasible LP (Fix Checklist) for fixes.

Graphical method steps (the exact workflow)

Workflow

Step-by-step checklist you can reuse

  1. Write the LP clearly with x1, x2, objective, and constraints.
  2. Draw axes and apply x1 β‰₯ 0, x2 β‰₯ 0 (first quadrant) unless variables can be negative.
  3. For each constraint: replace ≀/β‰₯ with equality to get the boundary line.
  4. Plot the line using intercepts or two easy points.
  5. Choose the feasible side using a test point (often (0,0) if allowed).
  6. Feasible region is the intersection of all shaded half-planes.
  7. Find corner points by checking intersections of pairs of boundary lines + axis intersections.
  8. Evaluate the objective at each corner point; the best value is optimal (if bounded).
If your model includes = or β‰₯ constraints and you’re moving to simplex tableaus, see Slack / Surplus / Artificial Variables, Two Phase Simplex Method, and Big M Method.

How to plot constraints fast (intercepts + test point)

Plotting

Two reliable techniques: intercepts or two points

Intercept method (best when coefficients are simple):

ax1 + bx2 = c
x1-intercept: set x2 = 0  β†’  x1 = c/a
x2-intercept: set x1 = 0  β†’  x2 = c/b

Test point method (best for shading):

Pick a point not on the line (often (0,0) if permitted) and plug into the inequality. If it satisfies the inequality, shade the side containing that point; otherwise shade the opposite side.

If (0,0) is not allowed (e.g., because of x1 + x2 β‰₯ 5), choose another simple test point like (0,5) or (5,0).

How to find corner points (systematically)

Corner points

Corner points come from intersections

In 2D, corner points are typically found by:

  • Intersecting two boundary lines (solve a 2Γ—2 system).
  • Intersecting a boundary line with an axis (x1=0 or x2=0).

Then always check feasibility: an intersection point is only a corner if it satisfies all constraints.

Graphical diagnosis: infeasible vs unbounded vs multiple optima

Diagnosis

What each case looks like on the graph

Outcome Graphical meaning Typical cause What to do next
Optimal (bounded) Feasible region exists and is β€œclosed” in the improving direction Well-posed model with bounds/capacities Evaluate objective at corners
Infeasible No overlapping shaded region (empty feasible region) Contradictory constraints, sign/units error Use fix checklist
Unbounded Feasible region extends infinitely in improving direction Missing upper bounds or missing limiting constraint Add realistic upper bounds
Multiple optimal solutions Objective line overlaps a boundary edge (optimal β€œsegment”) Objective parallel to binding edge See multiple optimal solutions

Questions people ask about the graphical method in linear programming (PAA)

People ask

What is graphical method linear programming?

Graphical method linear programming is a way to solve an LP with two variables by plotting constraint lines, shading the feasible region, finding the corner points, and evaluating the objective at those corners.

People ask

How do you find the feasible region in the graphical method?

Convert each inequality to its boundary line, then use a test point (often (0,0)) to determine which side satisfies the inequality. The feasible region is where all shaded regions overlap.

People ask

Why do we check only corner points in the graphical method?

For LPs, if a finite optimum exists it occurs at an extreme point (corner) of the feasible region. That’s why evaluating the objective at corners is enough to find the optimum.

People ask

How do you know if a graphical LP is unbounded?

If the feasible region extends infinitely in the direction that improves the objective (for maximization, toward increasing objective values), then the LP is unbounded. Missing variable bounds is a common causeβ€”see Upper Bounds in LP.

People ask

How do you know if a graphical LP is infeasible?

If there is no overlap between the shaded regions of all constraints (the feasible region is empty), the LP is infeasible. Use Unbounded vs Infeasible LP (Fix Checklist) to debug sign and unit errors.

People ask

Can the graphical method solve LPs with more than 2 variables?

Not practically. The graphical method is mainly for two variables (sometimes three with difficulty). For larger LPs, use simplex or interior-point methodsβ€”start with LP beginner guide and verify using the LP calculator.

Worked examples (fully solved)

Worked examples

Expand only the example you need

Each example below is collapsible (collapsed by default) to keep the page scannable while remaining fully indexable. Verify results in the LP calculator.

Example 1 β€” Graphical method linear programming (maximize; corner-point evaluation)

LP (maximize):

maximize   z = 3x1 + 2x2
subject to x1 +  x2 ≀ 4
           x1 + 2x2 ≀ 6
           x1, x2 β‰₯ 0

Step 1: Plot boundary lines using intercepts

Constraint (1): x1 + x2 = 4

Intercepts:
x2=0 β†’ x1=4  β‡’ point (4,0)
x1=0 β†’ x2=4  β‡’ point (0,4)

Constraint (2): x1 + 2x2 = 6

Intercepts:
x2=0 β†’ x1=6  β‡’ point (6,0)
x1=0 β†’ x2=3  β‡’ point (0,3)

Step 2: Shade the feasible side (≀ means β€œbelow” the line in the first quadrant)

Since both are ≀ constraints and we also have x1,x2 β‰₯ 0, the feasible region is the intersection β€œbelow” both lines in the first quadrant.

Step 3: Find corner points

Corner candidates:

  • (0,0)
  • (4,0) from (1) with x2=0
  • (0,3) from (2) with x1=0
  • Intersection of (1) and (2)

Compute intersection:

x1 +  x2 = 4
x1 + 2x2 = 6
Subtract β†’ x2 = 2
Then x1 = 2
Intersection: (2,2)

Step 4: Evaluate objective at corner points

Corner (x1, x2) z = 3×1 + 2×2
(0,0)0
(4,0)12
(0,3)6
(2,2)10

Optimal solution (Example 1): (x1,x2)=(4,0) with z*=12.

Example 2 β€” Graphical method linear programming (minimize; feasible region with β‰₯ constraints)

LP (minimize):

minimize   z = 2x1 + x2
subject to x1 +  x2 β‰₯ 2
           x1 + 2x2 β‰₯ 3
           x1, x2 β‰₯ 0

Step 1: Plot boundary lines

Line (1): x1 + x2 = 2

Intercepts: (2,0), (0,2)

Line (2): x1 + 2x2 = 3

Intercepts: (3,0), (0,1.5)

Step 2: Shade feasible side for β‰₯ constraints

For β‰₯ constraints, the feasible region is β€œabove” each line (away from the origin), intersected with the first quadrant.

Step 3: Identify likely optimal corners for minimization

Minimization typically occurs at the β€œclosest” boundary corner in the direction of decreasing objective. Check these candidates:

  • Intersection of the two boundary lines
  • Axis boundary points that satisfy both constraints

Intersection:

x1 +  x2 = 2
x1 + 2x2 = 3
Subtract β†’ x2 = 1
Then x1 = 1
Point: (1,1)
z = 2(1) + 1 = 3

Axis point with x1 = 0:

0 + x2 β‰₯ 2 β‡’ x2 β‰₯ 2
0 + 2x2 β‰₯ 3 β‡’ x2 β‰₯ 1.5
Smallest feasible is (0,2)
z = 2(0) + 2 = 2

Axis point with x2 = 0:

x1 β‰₯ 2 and x1 β‰₯ 3 β‡’ x1 β‰₯ 3
Point (3,0)
z = 2(3) + 0 = 6

Optimal solution (Example 2): (x1,x2)=(0,2) with z*=2.

Example 3 β€” Multiple optimal solutions (graphical test: objective overlaps an edge)

LP (maximize):

maximize   z = x1 + x2
subject to x1 + x2 ≀ 4
           x1 ≀ 3
           x2 ≀ 3
           x1, x2 β‰₯ 0

Step 1: Upper bound the objective

Since x1 + x2 ≀ 4, we have z = x1 + x2 ≀ 4. So the best possible value is at most 4.

Step 2: Find all feasible points with z = 4

Achieving z=4 requires x1 + x2 = 4. Along that line:

x2 = 4 βˆ’ x1

Apply the bounds:

x1 ≀ 3 β‡’ x1 ∈ [0,3]
x2 ≀ 3 β‡’ 4 βˆ’ x1 ≀ 3 β‡’ x1 β‰₯ 1

Therefore, the optimal set is the line segment:

(x1, x2) = (t, 4 βˆ’ t) for 1 ≀ t ≀ 3

Multiple optimal solutions (Example 3): z*=4, achieved by every point from (1,3) to (3,1). For what to do next (tie-break objectives), see Multiple Optimal Solutions in LP.

Check your answer (calculator + next guides)

Tooling + learning path

Verify quickly, then scale beyond 2 variables

Confirm any example using the Linear Programming calculator. If you need to model more than two variables, the graphical method won’t scaleβ€”use standard LP methods (simplex/interior-point) and see Linear Programming (LP) β€” Beginner Guide.

If your graph suggests unbounded or infeasible, use Unbounded vs Infeasible LP (Fix Checklist). If it suggests alternate optima, use Multiple Optimal Solutions in LP.

Troubleshooting (common graphing mistakes)

Troubleshooting

Symptom β†’ likely cause β†’ fix

What you observe Likely mistake Fix
Your feasible region is on the wrong side of a line Shading direction error Use a test point (e.g., (0,0) if allowed) to decide which side satisfies the inequality
Intercepts don’t match the line you drew Arithmetic error computing intercepts Recompute with x2=0 and x1=0; plot both points and draw through them
You β€œlose” the origin but still test with (0,0) (0,0) isn’t feasible because of β‰₯ constraints Choose another test point not on the line (e.g., (0,5) or (5,0))
Solver says unbounded but your sketch looks bounded Missing x β‰₯ 0 restrictions or a constraint typed incorrectly Re-check nonnegativity and constraints; see Upper Bounds in LP
Two different corners give the same objective value Multiple optimal solutions Check if the objective line overlaps a boundary edge; see Multiple optimal solutions

Glossary

Glossary

  • Feasible region: all points that satisfy every constraint.
  • Boundary line: the equality form of an inequality constraint (e.g., x1+x2=4).
  • Corner point (extreme point): a vertex of the feasible region polygon in 2D.
  • Binding constraint: a constraint satisfied with equality at a point (often defines corners/edges).
  • Unbounded LP: feasible region exists, but objective can improve forever.
  • Infeasible LP: no feasible region exists (constraints contradict).
  • Multiple optimal solutions: more than one feasible point achieves the best objective value (often an optimal edge segment).

Disclaimer

This article and the associated calculators are provided for educational and informational purposes only. Optimization outcomes depend on modeling assumptions and input data and may not reflect real-world constraints unless you encode them correctly. This is not legal, financial, operational, or safety advice. For high-stakes decisions, validate results against domain requirements and consult a qualified professional. For details, read our full disclaimer.

Sources
  1. Dr. Hiba G. Fareed – Linear Programing (LP) GRAPHICAL METHOD
  2. Khan Academy β€” Linear programming (graphical method intuition)
  3. OpenStax β€” Linear inequalities (graphing feasible regions)
  4. Wolfram MathWorld β€” Linear Programming
  5. Google OR-Tools β€” Linear Programming documentation