Linear
Programming
Linear programming is a mathematical
method used to find the best outcome
(maximum or minimum) of a problem
subject to a set of constraints
expressed as linear inequalities.
Three key components:
Decision Variables - the unknown quantities you are trying to find
e.g. let x = number of chairs made, y = number of tables made
Objective Function - the expression you want to maximise or minimise
e.g. Maximise P = 30x + 40y
Constraints - the restrictions limiting the decision variables
e.g. x + y
10
≤
Common mistake:
Forgetting to define decision variables at the start. Examiners award
marks specifically for this
FORMULATING CONSTRAINTS
1. Read the problem and identify every restriction
2. Write each as a linear inequality in terms of your decision variables
3. Simplify where possible
4. Always include x, y
0
≥
Example:
“Maximum 18 hours available. Chairs take 1 hour, tables take 2 hours”
x + 2y
18
→
≤
“Four drying zones each providing 6 hours = 24 hours. Chairs take 3 hours,
tables take 2 hours”
3x + 2y
24
→
≤
Formal layout:
Maximise P = 30x + 40y
subject to:
x+y
10
x + 2y
18
3x + 2y
24
x, y
≤
≤
≤
≥0
Objective Function
What is it?
The expression you want to maximise or minimise - always written in
terms of decision variables only
Convention:
• Use P for maximisation (profit)
• Use C for minimisation (cost)
Examples:
“£30 profit per chair, £40 per table, maximise profit”
Maximise P = 30x + 40y
“Chair costs £5, table costs £8, minimise cost”
Minimise C = 5x + 8y
→
→
⚠ Examiner flags:
• Always state whether you are maximising or minimising
• Objective function must only contain decision variables
• Do not confuse the objective function with a constraint
The Feasible Region
What is it?
The area on a graph satisfying ALL constraints simultaneously — including nonnegativity
Step by step:
1. Treat each inequality as an equation and plot the straight line
2. Easiest method — set x=0 to find one point, set y=0 to find another
3. Draw solid lines for
or
4. Shade the unwanted side of each line
5. The unshaded area remaining = feasible region
6. Label it R
7. Label every line clearly
≤ ≥
⚠ Examiner flags:
• Shading the wanted region instead of the unwanted region is one of the most common
errors
• Unlabelled lines lose marks automatically
• Always use a ruler — examiners specifically flag messy lines
• Don’t forget x
≥ 0 and y ≥ 0 form boundaries too (the axes themselves)
Finding the Optimal Solution
Method 1 — Objective Line Method
1. Choose a value of P that is a multiple of both coefficients
2. Plot the objective line P = ax + by
3. Slide your ruler parallel to this line away from origin (maximise) or towards
origin (minimise)
4. The last vertex your ruler passes through = optimal solution
5. Draw objective lines each time you pass through a vertex to show
working
Finding the Optimal Solution
Method 2 — Vertex Testing
1. Find coordinates of every vertex of feasible region
2. For non-obvious vertices solve boundary lines simultaneously
3. Substitute each vertex into objective function
4. Highest value = maximum, lowest = minimum
Example table:
Vertex
P= 2x + 5y
(0,0)
(0,2)
(8,0)
(1,4)
(5,3)
0
10
16
22
25
Finding the Optimal Solution
⚠ Examiner flags:
• Never read vertex coordinates from
the graph - always solve simultaneously
• Test ALL vertices including the origin
• State final answer clearly with the
value of P
Integer Solutions
When do you need them?
When the context involves countable objects - you cannot make
3.65 chairs or produce 2.7 tins of beans
⚠ Questions won’t always tell you - use common sense and think
about the context
Step by step:
1. Find optimal solution as normal
2. If non-integer, identify the four surrounding integer points
e.g. optimal = (3.2, 4.7)
check (3,4), (3,5), (4,4), (4,5)
3. Check each point satisfies ALL constraints
4. Evaluate objective function at each valid point
→
5. Choose the one giving the best value
Integer Solutions
⚠ Examiner flags:
• Never just round the optimal solution - it may not be
feasible
• Must check ALL four surrounding points and verify
each satisfies the constraints
• The integer solution found may not be truly
optimal - there could be a better integer point
elsewhere in the feasible region. You won’t be
asked to find it but you should acknowledge it
Full Worked Example
Question:
A furniture manufacturer makes chairs (x) and tables (y).
• Maximum 10 items per day: x + y
10
• Maximum 18 production hours: x + 2y
18
• Maximum 24 drying hours: 3x + 2y
24
• Profit: £30 per chair, £40 per table
• Maximise profit. Integer solutions required.
≤
≤
≤
Step 1 — Define variables:
Let x = chairs per day, y = tables per day
Step 2 — Formulate:
Maximise P = 30x + 40y
subject to: x + y
10, x + 2y
18, 3x + 2y
≤
≤
≤ 24, x,y ≥ 0
Full Worked Example
Step 3 — Find vertices by solving simultaneously:
Vertex
P= 30x + 40y
(0,0)
(8,0)
(2,8)
0
240
380
360
(0,9)
Optimal solution: x = 2, y = 8, P=£380
Both are integers
- no further checking needed
Exam Cheat Sheet
Define decision variables clearly
Always include x, y
0
Simplify all inequalities
Label every line on your graph
Shade the UNWANTED region
Use a ruler — always
Solve vertices simultaneously — never read from graph
Test ALL vertices
For integers — check all four surrounding feasible points, never
just round
State final answer clearly with value of P
Show ALL working — correct answers with no method get zero
≥