Skip to content
Tactiverge

School/□ Systems Engineer/Week 30

Linear programming: why the corners win

A workshop has 24 machining hours and 30 assembly hours. Among infinitely many weekly plans, you only need to check four. Why?

About 45 min · 3 goals · Checked by automated tests

1.Why should I care?

Linear programmes schedule airlines, blend fuels and allocate cloud servers. With two variables you can see the whole thing, and the picture explains the idea every large solver relies on.

  • ◇ Draw the feasible region of a two-variable linear programme.
  • ◇ Show that a linear objective is optimised at a vertex, and find it by evaluating the corners.
  • ◇ Interpret binding constraints and the sensitivity of the optimum to a resource limit.

2.Predict

You maximise 3x + 5y over a polygon-shaped feasible region. Where can the maximum be?

Guess first. Being wrong here is how the surprise works.

3.Discover

Read the corner table and find the best corner. Move your trial plan (the square) to a point inside the region and compare its profit. Then raise the profit per chassis until the best corner jumps, and add machining hours to see how much one extra hour is worth.

Loading the interactive…

Can't use the interactive? Read a description instead

The explorer shows the feasible region for 2x + y ≤ M (machining) and x + 3y ≤ A (assembly) with x, y ≥ 0, as a shaded polygon. A table lists each corner and its profit c₁x + c₂y; the largest is marked best. With M = 24, A = 30, c₁ = 3 and c₂ = 5 the corners are (0, 0), (12, 0), (0, 10) and (8.4, 7.2), and the optimum is 61.20 at (8.4, 7.2). Adding one machining hour raises it to about 62.00.

4.Checkpoint: guided practice

Check what you just discovered before going on. Hints appear after a wrong answer.

Practice 1

Corners of a feasible region are (0, 0), (12, 0), (0, 10) and (8.4, 7.2). What is the maximum of 3x + 5y?

5.Watch

→ Follow the corner-point method: shade the constraints, list the vertices, test the objective at each.

A worked graphical linear programme: shade the constraints, find the corners, test the objective at each.

Length: see YouTube · captions on YouTube · source

Nothing loads from YouTube until you press play.

The video is optional: everything you need is also in the lesson text and the interactive.

6.Understand

Drawing the region

Turn each inequality into its boundary line (2x + y = 24 meets the axes at (12, 0) and (0, 24)), then shade the side that satisfies it (test the origin: 0 ≤ 24, so the origin's side). Non-negativity keeps you in the first quadrant. The overlap of all shaded regions is feasible.

Binding and slack constraints

At the optimum, a constraint that holds with equality is binding: that resource is fully used. One with spare capacity has slack. In the example both machining and assembly bind at (8.4, 7.2). A non-binding constraint could be loosened without changing the answer at all.

Sensitivity: what's an extra hour worth?

Raise machining from 24 to 25 hours and re-solve: the optimum rises by the shadow price of machining. In the explorer it is about £0.80 per hour. If an extra hour costs less than its shadow price, buy it. Changes to the objective coefficients can make the best corner jump to a neighbour: the plan is stable only within a range of prices.

Beyond two variables

Real problems have thousands of variables, but the theorem still holds: optima sit at vertices of a high-dimensional polytope. The simplex method walks from vertex to better neighbouring vertex; interior-point methods cut through the middle. If the variables must be whole numbers (integer programming) the corner can be fractional, and the problem becomes much harder.

Explain it another way

Imagine a ruler laid across the region at a slant set by the profits. Push it as far as it will go while still touching the region: it will last touch a corner.

Derivation: The corner-point theorem in two dimensions
  1. Maximise z = c₁x + c₂y subject to linear inequalities. Each inequality is a half-plane; their intersection is a convex polygon (the feasible region).

  2. The level sets z = k are parallel straight lines with normal vector (c₁, c₂). Increasing k slides the line in the direction (c₁, c₂).

  3. Suppose an optimum were at an interior point. A small step in direction (c₁, c₂) stays feasible and increases z, a contradiction. So the optimum is on the boundary.

  4. On an edge, z varies linearly along the edge, so it is largest at one of the edge's two endpoints (or constant, if the edge is parallel to the level lines).

  5. Therefore some vertex is optimal. Algorithm: find every vertex (intersect pairs of constraint lines, keep the feasible ones), evaluate z at each, take the largest.

  6. Example: 2x + y ≤ 24, x + 3y ≤ 30, x, y ≥ 0. Crossing: from the first y = 24 − 2x; substitute: x + 72 − 6x = 30, x = 8.4, y = 7.2. Corners (0, 0), (12, 0), (0, 10), (8.4, 7.2). With z = 3x + 5y: 0, 36, 50, 61.2. The optimum is £61.20 at (8.4, 7.2).

Worked example 1

Maximise 4x + 3y subject to x + y ≤ 10, 2x + y ≤ 16, x, y ≥ 0.

Corners: (0, 0) → 0; (8, 0) → 32; (0, 10) → 30; crossing: subtract the equations, x = 6, y = 4 → 36. Optimum 36 at (6, 4). Both constraints bind.

Common mix-ups

  • The best plan uses a bit of everything, somewhere in the middle.
    ✓ For linear objectives and constraints, the best plan is at a corner of the feasible region.
  • Adding resources always improves the optimum.
    ✓ Only binding constraints have a positive shadow price; spare capacity is worth nothing at the margin.

7.Practice on your own

Practice, not a test. Wrong answers get a hint and another try.

Practice 2 · a fresh version every time

A small factory makes x controllers and y sensor boards a day. Assembly time: 2x + 1y ≤ 18 hours. Test time: 1x + 4y ≤ 36 hours. Also x ≥ 0, y ≥ 0 (fractions allowed). Profit is 8x + 9y pounds. What is the maximum profit, in pounds? (2 decimal places.)

£

Practice 3 · a fresh version every time

A small factory makes x controllers and y sensor boards a day. Assembly time: 3x + 1y ≤ 36 hours. Test time: 1x + 3y ≤ 36 hours. Also x ≥ 0, y ≥ 0 (fractions allowed). Profit is 5x + 3y pounds. What is the maximum profit, in pounds? (2 decimal places.)

£

Practice 4

At the optimum, the assembly constraint has 6 hours of slack. What happens to the optimum if you buy 4 more assembly hours?

Practice 5

The LP optimum is 8.4 frames and 7.2 chassis, but you can only build whole items. What is true?

8.Apply it

A rover's science day: x hours of driving (needs 60 W) and y hours of imaging (needs 25 W). Energy ≤ 300 Wh, x + y ≤ 8 h, x ≤ 4 h. Science value 2x + 3y. Draw the region, find the corners and the optimum, and say which constraint you'd relax first.

9.Reflect

Concepts: Constrained optimisation and linear programming