Optimization · Module 7 of 10
Linear Programming
When the objective and every constraint are linear, the feasible region is a polygon and the optimum sits at a corner. That single fact turns a search over infinitely many points into a check of a few vertices.
Readiness check
This module optimises linear problems. Tick only what you can do closed-notes.
- Graph a line and shade an inequality.
- Find where two lines intersect.
- Evaluate a linear function at a point.
- Recall a feasible region as an intersection of half-planes.
- Recall that an optimum can lie on a constraint boundary.
The core idea
A linear program has a linear objective and linear constraints. Its feasible region is a convex polygon, and the optimum always lies at a vertex, so the solution is found by evaluating the objective at the corners.
minimise (or maximise) cTxsubject to Ax ≤ b, x ≥ 0optimum is at a vertex of the feasible polygonA linear program (LP) optimises a linear objective cTx over a feasible region defined by linear inequalities Ax ≤ b and bounds x ≥ 0. Because every constraint is linear, the feasible region is a convex polytope, a polygon in two variables, and because the objective is linear, its contours are straight lines. Sliding a contour as far as it will go in the improving direction, it last touches the region at a corner. This is the fundamental theorem of linear programming: an optimum, if one exists, is attained at a vertex. In two variables you can therefore solve an LP graphically, by finding the feasible polygon's corners and evaluating the objective at each. The simplex method generalises this to many variables: it walks from vertex to adjacent vertex, always improving, until no neighbour is better. Every LP also has a dual problem whose optimal values are the shadow prices of the constraints, linking back to the multipliers of the previous module.
The skills, taught in order
Five skills build the LP, its feasible polygon, the vertex principle, and the simplex idea.
7.1 The linear program
An LP minimises or maximises a linear objective subject to linear equalities and inequalities. Writing it in a standard form, minimise cTx subject to Ax ≤ b and x ≥ 0, makes it ready for a solver and clarifies the structure.
7.2 The feasible region
Each linear inequality cuts the plane into a half-plane; their intersection is the feasible region, a convex polygon (or polytope). It may be bounded, unbounded, or empty, and its shape is entirely determined by the constraints.
7.3 Vertices and the fundamental theorem
The corners of the feasible polygon are its vertices, each the intersection of two active constraints. The fundamental theorem of LP guarantees that an optimum, when it exists, occurs at a vertex, so evaluating the objective at every corner solves the problem.
| Feature | Linear program |
|---|---|
| Objective | linear, cTx |
| Feasible region | convex polygon |
| Optimum location | at a vertex |
| Solution method | simplex or interior point |
The structure of an LP. Linearity makes the region convex and forces the optimum to a corner.
7.4 The simplex method
The simplex method starts at a feasible vertex and moves along an edge to an adjacent vertex that improves the objective, repeating until no neighbour is better. It visits only corners, and in practice reaches the optimum in a modest number of steps.
7.5 Duality and shadow prices
Every LP has a dual LP; at the optimum their objectives are equal, and the dual variables are the shadow prices of the primal constraints. A binding constraint's shadow price says how much the optimum would improve per unit of relaxation, the LP form of a Lagrange multiplier.
Engineering connection: allocating limited material, machine time, or power to maximise output is a linear program, and the shadow prices tell you which resource to buy more of.
Worked example 1: a graphical linear program
Maximise P = 3x + 4y subject to x + y ≤ 4, x + 3y ≤ 6, and x, y ≥ 0. Find the optimal vertex and value.
- ProblemMaximise P over the feasible region in Figure 1.
- Given / findMaximise P = 3x + 4y subject to x + y ≤ 4, x + 3y ≤ 6, x, y ≥ 0. Find the optimal vertex.
- AssumptionsBounded feasible region; the optimum is at a vertex.
- ModelFind every corner, then evaluate P at each and take the largest.
- Equationscorners: (0,0), (4,0), (0,2), and x+y=4 ∩ x+3y=6intersection: 2y = 2 ⇒ (3, 1)
- SolveP(0,0) = 0; P(4,0) = 12; P(0,2) = 8; P(3,1) = 9 + 4 = 13. The maximum is 13 at (3, 1).
- Check(3, 1) is feasible: x + y = 4 ≤ 4 and x + 3y = 6 ≤ 6, both active. No corner gives a higher P, so it is optimal.
- ConclusionThe optimum is x = 3, y = 1 with P = 13, where both slanted constraints bind. Only the vertices needed checking.
Worked example 2: a minimisation linear program
Minimise the cost C = 2x + 3y subject to x + y ≥ 4 and x ≥ 1 (with y ≥ 0). Find the optimal vertex and value.
- ProblemMinimise C over the feasible region in Figure 2.
- Given / findMinimise C = 2x + 3y subject to x + y ≥ 4, x ≥ 1, y ≥ 0. Find the optimal vertex.
- AssumptionsThe minimum is attained at a vertex of the feasible region.
- ModelIdentify the corners where the active constraints meet, then evaluate C at each.
- Equationscorner (1, 3): x = 1 ∩ x + y = 4corner (4, 0): y = 0 ∩ x + y = 4
- SolveC(1, 3) = 2 + 9 = 11. C(4, 0) = 8 + 0 = 8. The minimum is 8 at (4, 0).
- Check(4, 0) is feasible: x + y = 4 ≥ 4 and x = 4 ≥ 1. Moving along the boundary away from it only raises C, so it is optimal.
- ConclusionThe cheapest feasible plan is x = 4, y = 0 with C = 8. Even for an unbounded region, the optimum sits at a corner.
Misconceptions and diagnostics
| Mistake | Symptom | Diagnostic question | Correction |
|---|---|---|---|
| Searching the interior | Checking points inside the region | "Where must the LP optimum be?" | An LP optimum is at a vertex; check the corners. |
| Infeasible corner used | A vertex violates a constraint | "Does this point satisfy all constraints?" | Only feasible vertices are candidates. |
| Missing unboundedness | Objective improves without limit | "Is the region bounded in this direction?" | An LP can be unbounded; check the improving direction. |
| Ignoring shadow prices | No sense of which constraint binds | "What is each constraint's dual value?" | Read shadow prices to see what to relax. |
Practice ladder
Find where x + y = 4 and x = 1 intersect.
Show answer
x = 1, so y = 3: the point (1, 3).
Maximise P = x + y over x + y ≤ 4, x, y ≥ 0. What is the optimum?
Show answer
Any point on x + y = 4 gives P = 4; the whole edge is optimal, so the maximum is 4 (attained at vertices like (4, 0) and (0, 4)).
Maximise P = 5x + 4y over x + y ≤ 5, x ≤ 3, x, y ≥ 0. Find the optimal vertex.
Show answer
Corners: (0,0)=0, (3,0)=15, (3,2)=23, (0,5)=20. Maximum is 23 at (3, 2), where x = 3 and x + y = 5 are both active.
You allocate limited machine hours and material to two products to maximise profit. Explain how the shadow prices guide which resource to expand.
What good work looks like
Solve the LP, then read the dual value on each binding resource constraint: the resource with the highest shadow price yields the most extra profit per added unit, so it is the one to expand first.
Working with AI, and proving it yourself
Use AI as an examiner, not a solver
Portfolio task
Model a real allocation problem as an LP, solve it graphically or with a solver, identify the binding constraints, and interpret their shadow prices.
Retrieval and spaced review
Closed notes. Answer out loud, then reveal.
1. What shape is an LP feasible region?
A convex polygon (polytope), the intersection of half-planes.
2. Where does the LP optimum occur?
At a vertex of the feasible region, by the fundamental theorem.
3. How does the simplex method work?
It walks from vertex to improving adjacent vertex until none is better.
4. What are the dual variables?
The shadow prices of the constraints, equal at optimum to the primal value.
5. When does an LP have no optimum?
When it is infeasible, or unbounded in the improving direction.
Textbook mapping
This module follows Nocedal and Wright, Numerical Optimization, 2nd edition. Use these references to read further.
| Topic in this module | Where to read more |
|---|---|
| Linear programming and the feasible region | Nocedal & Wright, Chapter 13 |
| The simplex method | Nocedal & Wright, Chapter 13 |
| Duality and shadow prices | Nocedal & Wright, Chapter 13 |
Chapter numbers refer to the 2nd edition. The linear-programming theory is standard, so any recent edition will align closely.