Stellar Grove · Concrete Mathematical Modelling
The workshop's product mix
A workshop makes tables and chairs with limited carpentry and finishing time. What should it make, and what is an extra hour of each worth?
Chapter 12 · Further optimization. A worked example rebuilt from the chapter's topic in Mike Mesterton-Gibbons, *A Concrete Approach to Mathematical Modelling*; the scenario and numbers are our own illustration, not the book's text.
Headline: Make 20 tables and 60 chairs for $1,800 a week. An extra carpentry hour is worth $10, an extra finishing hour $10, and more chair demand $0: that constraint has 10 chairs of slack.
- $1,800weekly profit from 20 tables + 60 chairs
- $10/hshadow price of carpentry time
- +20%profit over making only the more profitable product (tables)
The problem
A table earns $30 and needs 2 hours of carpentry and 1 of finishing; a chair earns $20 and needs 1 of each. Each week there are 100 carpentry hours and 80 finishing hours, and the market takes at most 70 chairs. What mix maximises profit?
The model
Every constraint is a straight line, so the feasible set is a polygon and a linear objective is maximised at a corner. There are 5 corners; evaluating each:
| Corner (tables, chairs) | Profit |
|---|---|
| (0, 0) | $0 |
| (50, 0) | $1,500 |
| (20, 60) | $1,800 |
| (10, 70) | $1,700 |
| (0, 70) | $1,400 |
The simplex method walks from corner to better corner; for large problems it (or an interior-point method) is the only practical route. Its by-product is the dual: one shadow price per constraint, the rate at which the optimum improves as that constraint is relaxed:
Its solution has the same value, $1,800 (strong duality). Check: 10 more carpentry hours raise profit to $1,900, +$100.
Try it
Product-mix explorer
Change the profits or the carpentry hours: the best corner jumps when the profit line tilts past a constraint.
Key findings
- The best plan mixes products: making only tables (the higher-profit item) earns $1,500; the mix earns $1,800, because chairs use the scarce carpentry time more sparingly.
- Shadow prices guide investment: pay up to $10 for an extra carpentry hour (overtime, a second saw) and up to $10 for finishing; marketing more chairs is worth $0 until demand binds.
- Shadow prices hold only locally: the $10 value of a carpentry hour holds from 90 to 160 hours; outside that range a different corner is best and the price changes (try the carpentry slider).
from books.concrete_mathematics import optimization as op
r = op.linear_program(c=[30.0, 20.0], A=[[2.0, 1.0], [1.0, 1.0], [0.0, 1.0]], b=[100.0, 80.0, 70.0])
print(r.x.round(2).tolist(), r.value, r.shadow_prices.round(2).tolist(), r.binding.tolist())
# → [20.0, 60.0] 1800.0 [10.0, 10.0, 0.0] [True, True, False]
Assumptions and extensions
- Divisible, linear and certain. Half-tables are allowed and profits don't fall with volume; integer programming and nonlinear programming relax each.
- Shadow prices are marginal: they price the next hour, not the hundredth.
- The same formulation scales to diets, refinery blends, shift rosters and transport networks with thousands of variables.