Stellar Grove · Research

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.

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

max30x+20ys.t.2x+y≤100,x+y≤80,y≤70,x,y≥0

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:

min100u1+80u2+70u3s.t.2u1+u2≥30,u1+u2+u3≥20,u≥0

Its solution u=(10,10,0) has the same value, $1,800 (strong duality). Check: 10 more carpentry hours raise profit to $1,900, +$100.

Feasible mixes (shaded), the constraints, and the best iso-profit line touching the corner
Feasible mixes (shaded), the constraints, and the best iso-profit line touching the corner

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

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