A levels Further Mathematics · Decision mathematics
Linear programming
1Formulating a problem
A linear programming problem asks you to maximise or minimise an objective function subject to constraints that are linear inequalities.
To formulate:
- Define the decision variables clearly (e.g. "$x$ = number of chairs made per day").
- Write the objective: "maximise $P = \ldots$" or "minimise $C = \ldots$".
- Write each constraint as an inequality, including non-negativity ($x, y \geq 0$).
A workshop
- Chairs ($x$) and tables ($y$) earn £30 and £50 profit. A chair takes 1 hour of carpentry and 3 hours of finishing; a table 2 hours and 2 hours. There are 16 carpentry hours and 24 finishing hours a day.
- Maximise $P = 30x + 50y$.
- Subject to $x + 2y \leq 16$, $3x + 2y \leq 24$, $x \geq 0$, $y \geq 0$.
Check yourself
What is the objective function?
Show the answer
The expression to be maximised or minimised
For example, profit.
2The feasible region
Draw each constraint as a line and shade the side that is not wanted (unless told otherwise). The region left is the feasible region: every point in it satisfies all the constraints.
The objective line (dashed) slid outwards last touches the feasible region at (4, 6): 4 chairs and 6 tables.
Drawing the region
- $x + 2y \leq 16$: line through $(16, 0)$ and $(0, 8)$.
- $3x + 2y \leq 24$: line through $(8, 0)$ and $(0, 12)$.
- The feasible region has vertices $(0, 0)$, $(8, 0)$, $(4, 6)$ and $(0, 8)$.
- $(4, 6)$ comes from solving $x + 2y = 16$ and $3x + 2y = 24$: subtracting gives $2x = 8$.
Check yourself
What is the feasible region?
Show the answer
The set of points satisfying every constraint
Each point is a possible plan.
3Finding the optimal point
The optimal solution lies at a vertex of the feasible region. Two methods:
- Vertex testing: evaluate the objective at every vertex.
- Objective line: draw a line $30x + 50y = k$ and slide it parallel across the region; the last vertex it touches is optimal.
Vertex testing
- $(8, 0)$: $P = 240$. $(0, 8)$: $P = 400$. $(4, 6)$: $P = 120 + 300 = 420$.
- Maximum profit £420, making 4 chairs and 6 tables.
For a minimisation problem, the optimum is the first vertex the objective line meets.
Check yourself
Where does the optimal solution of a linear programme lie?
Show the answer
At a vertex of the feasible region
The objective is linear, so it is extreme at a corner.
4Integer solutions
Often the variables must be whole numbers (you cannot make 2.5 tables). If the optimal vertex is not at integer values, test the integer points near it that lie inside the feasible region.
Rounding with care
- Suppose the optimal vertex were $(3.6, 5.2)$.
- Test nearby integer points such as $(3, 5)$, $(4, 5)$, $(3, 6)$ and $(4, 4)$, checking each one satisfies every constraint.
- Choose the one giving the best value of the objective.
Simply rounding the vertex can give a point outside the feasible region.
Check yourself
Why can't you simply round a non-integer optimal vertex?
Show the answer
The rounded point might break a constraint, or not be the best integer point
Check each nearby point.
5The simplex method
For problems with more variables, the simplex algorithm is used. Each inequality $\leq$ is turned into an equation using a slack variable.
Setting up a tableau
- Maximise $P = 2x + 3y$ subject to $x + y \leq 4$, $x + 3y \leq 6$.
- With slack variables $s, t \geq 0$: $x + y + s = 4$, $x + 3y + t = 6$, and $P - 2x - 3y = 0$.
- Initial tableau rows: $s$: 1, 1, 1, 0 | 4; $t$: 1, 3, 0, 1 | 6; $P$: −2, −3, 0, 0 | 0.
Slack variables measure unused resources, such as spare hours.
Check yourself
What does a slack variable represent?
Show the answer
The unused amount of a resource in a constraint
It turns ≤ into =.
6Pivoting
Each iteration of simplex:
- Pivot column: the most negative value in the objective row.
- Pivot row: the smallest non-negative ratio of value to pivot column entry ($\theta$ values).
- Divide the pivot row by the pivot, then use row operations to make every other entry in the pivot column zero.
- Stop when there are no negative values in the objective row.
Solving
- Pivot column $y$ ($-3$). Ratios: $4 \div 1 = 4$, $6 \div 3 = 2$, so pivot on the $t$ row.
- After one iteration the objective row is $-1, 0, 0, 1 \mid 6$: still a negative, so pivot on $x$.
- After the second iteration: $P + 1.5s + 0.5t = 9$, with $x = 3$, $y = 1$.
- Maximum $P = 9$ at $(3, 1)$. Both slacks are 0, so both resources are fully used.
Check yourself
How is the pivot row chosen in the simplex method?
Show the answer
Smallest non-negative ratio of value to pivot column entry
It keeps all variables non-negative.
Now test yourself
This lesson has a 8-question quiz and 5 exam-style questions with mark schemes in Impera. Free, with your progress saved.
Practise in Impera