Linear Programming

Work in progress. This note is still being written and incomplete.

Linear programming is constrained optimization where the objective function and every constraint are linear.

Standard Form

Objective function

z=f(x)=a1x1+a2x2+⋯+anxnz = f(x) = a_1 x_1 + a_2 x_2 + \cdots + a_n x_n

Constraints

ai1x1+ai2x2+⋯+ainxn≤bia_{i1} x_1 + a_{i2} x_2 + \cdots + a_{in} x_n \leq b_i

or with ≥\geq in place of ≤\leq.

Graphical Solution

For 2 design variables, the problem can be solved graphically

  • Plot each constraint as a boundary line
  • Shade the feasible region satisfying all constraints
  • Move the objective function line, zz constant, across the feasible region
  • The optimum occurs at a vertex of the feasible region

Worked Example

A factory produces heaters of types SS and LL, sold wholesale at $40 and $88 respectively. Machine M1M_1 needs 2 minutes per SS heater and 8 minutes per LL heater. Machine M2M_2 needs 5 minutes per SS heater and 2 minutes per LL heater. Both machines run 60 minutes per hour. Find the hourly production rates x1x_1 (SS) and x2x_2 (LL) maximizing hourly revenue.

Objective function

z=f(x)=40x1+88x2z = f(x) = 40x_1 + 88x_2

Constraints

2x1+8x2≤605x1+2x2≤60x1≥0x2≥0\begin{aligned} 2x_1 + 8x_2 &\leq 60 \\ 5x_1 + 2x_2 &\leq 60 \\ x_1 &\geq 0 \\ x_2 &\geq 0 \end{aligned}

The optimum occurs at the vertex (x1,x2)=(10,5)(x_1, x_2) = (10, 5), the intersection of the 2 machine-time constraints.

zmax⁡=40(10)+88(5)=840z_{\max} = 40(10) + 88(5) = 840
Written by September 28, 2026 1 min read
Was this helpful?