Graphical Solution of 2-Variable LPs

Solve a linear program in two variables by graphing the feasible region, enumerating its vertices, and evaluating the objective at each vertex to identify the optimum.

Step 1 of 157%

Tutorial

The Feasible Region and Its Vertices

A 2-variable linear program (LP) has the form

maximize (or minimize)z=c1x+c2y\text{maximize (or minimize)} \quad z = c_1 x + c_2 y

subject to a list of linear constraints ai1x+ai2ybia_{i1} x + a_{i2} y \,\square\, b_i (where each \square is \le, \ge, or ==), and usually x,y0x, y \ge 0.

Each linear inequality cuts the plane into two half-planes. The feasible region is the intersection of all these half-planes — a convex polygon, possibly bounded, unbounded, or empty.

A vertex (or corner point) of the feasible region is a point where two boundary lines meet and every other constraint is satisfied. The boundary lines come from replacing each \le or \ge with ==.

To find every vertex:

  1. List all boundary lines (including x=0x=0 and y=0y=0).
  2. Solve each pair of boundary lines for their intersection.
  3. Discard any intersection that violates some other constraint.
  4. What survives is the set of vertices.

For instance, with x+y4x + y \le 4, x0x \ge 0, y0y \ge 0, the three boundary lines x+y=4x+y=4, x=0x=0, y=0y=0 intersect pairwise at (0,0)(0,0), (4,0)(4,0), (0,4)(0,4). All three satisfy every constraint, so the feasible region is the triangle with these vertices.

navigate · Enter open · Esc close · ⌘K/Ctrl K toggle