Topic guide 15 · Unit 4 Topic 5 · Networks and decision mathematics 2
Assignment and the Hungarian algorithm
An assignment problem pairs each member of one group with exactly one member of another: athletes with relay legs, trucks with motorists, contractors with tasks. Each pairing has a cost, a time or a distance, and you want the pairing that makes the total as small (or as large) as possible. For a few options you can check by eye. Past that, the Hungarian algorithm finds the answer by subtracting numbers until the best assignment shows up as a set of zeros.
This guide takes you from bipartite graphs to the full algorithm, including the adjustment step that catches students out, the two Paper 2 questions that added algebra or Earth geometry on top, and maximum assignments, which the 2025 syllabus names for the first time. Every assignment question from the 2020 to 2025 externals is here, with each matrix drawn out and mark-by-mark solutions. Tick off each skill once you can do it without help.
27
short-response marks on assignment, 2020 to 2025
6 of 6
external exams with an assignment question
57.1%
of students got 2022 Paper 1 Question 7 right, the hardest multiple choice item here
Skills in this topic
Only tick a skill when you could do it in the exam. Your ticks are saved in this browser only.
Part 1
What the exam asks about assignment
Every external from 2020 to 2025 had an assignment question. I count nine: four multiple choice (2021 Paper 1 Question 5, 2022 Paper 1 Question 7, 2023 Paper 1 Question 13 and 2025 Paper 1 Question 10) and five short response worth 27 marks (2020 Paper 2 Question 5, 2021 Paper 2 Question 6, 2022 Paper 1 Question 20, 2023 Paper 2 Question 1 and 2024 Paper 2 Question 5).
Four of the five short-response questions sit in Paper 2, at 5 to 7 marks each, and every one is a single question with no parts. Nothing is broken into steps for you. Topic 5 as a whole, with flow networks, carried 45 short-response marks across the six papers. Flow networks have their own guide, Topic guide 14, Flow networks.
The multiple choice items have mostly gone well: on three of the four, 83.5% to 94.1% of students were right. The exception is 2022 Question 7, where only 57.1% could read the assignment off a finished matrix. Part 3 shows the routine that gets it right.
What the subject reports said
•2020. The report showed an effective response to Paper 2 Question 5 to demonstrate “using a matrix method, as indicated within the question, to develop a response instead of by inspection”.
•2021. Students “responded well to … using a bipartite graph to represent an assignment/allocation problem”. That is Paper 1 Question 5 (Part 2).
•2022. Students responded well to “use of the Hungarian algorithm to determine an optimal assignment”, and the report asked for “using a new drawing to show the resultant matrix after applying each step of the Hungarian algorithm”.
•2023 and 2024. Both reports asked for “separate matrices to show the outcome for each step”: row reduction, column reduction, and “continuing the algorithm until the minimum number of lines to cover all zeroes is equal to the number of assignments”.
•2025. The report confirmed the syllabus change: “the required optimum assignment could be a minimum or a maximum, and using the Hungarian algorithm is expanded to 3 x 3 up to 5 x 5 square matrices.”
What the syllabus says
Unit 4 Topic 5, sub-topic “Assigning order and the Hungarian algorithm” (7 hours), has three dot points:
•Use a bipartite graph and its tabular or matrix form to represent possible assignments for an allocation problem.
•Determine the optimum (minimum and maximum) assignment/s for small-scale practical problems by inspection.
•Use the Hungarian algorithm (3 × 3 up to 5 × 5 square matrices) to determine the optimum (minimum and maximum) assignment/s for larger practical problems.
Seven hours makes this one of the longer sub-topics in Unit 4 (three others get 8). Read “minimum and maximum” twice. Every optimisation question from 2020 to 2025 asked for a minimum, so the maximum is the part of this dot point nobody has met in an external yet. It has its own section in Part 6.
What changed in the 2025 syllabus
The 2019 syllabus gave this sub-topic 8 hours and named “the Hungarian algorithm (3 × 3)”. Its dot points did not say minimum or maximum. The 2025 syllabus gives it 7 hours, names both, and allows matrices from 3 × 3 up to 5 × 5.
Every matrix question from 2020 to 2025 was 3 × 3. (2021’s relay question was 4 × 4, but it was a bipartite graph that needed no algorithm.) Older subject reports told schools to keep the algorithm to 3 × 3. That advice belongs to the 2019 syllabus, so expect larger matrices from 2025 on. Part 6 works a 4 × 4.
What the formula book gives you
Section
Supplied
Graphs and networks
Euler’s formula $v+f-e=2$, and nothing else. There is no entry for assignment or the Hungarian algorithm.
Earth geometry
$D=111.2\times\text{angular distance}$ and $D=111.2\cos\theta\times\text{angular distance}$. 2024 Paper 2 Question 5 needed both before the matrix was complete (Part 5).
So the steps of the algorithm are memory. The good news is that they are mechanical apart from two judgement points: covering the zeros with the fewest lines, and choosing one zero in each row and column. Parts 3 and 4 give you a routine for each.
Part 2
A bipartite graph and a matrix hold the same information
A bipartite graph has two groups of vertices. Every edge joins a vertex in one group to a vertex in the other, and no edge joins two vertices in the same group. Assignment problems are bipartite by nature: workers down one side, tasks down the other.
The matrix (or table) form holds the same information. Rows are one group, columns are the other, and each entry is the weight of the edge between them: a time, a distance, a cost. When the graph only shows who can do what, with no weights, the table simply lists each person’s possible tasks.
Solving by inspection
For an unweighted graph, look for a forced move. A vertex with only one edge must use it. Make that pairing, cross out both vertices, and look again. Most of these questions fall over in two or three moves.
For a weighted problem, inspection means checking the possible assignments and totalling them. A 3 × 3 has $3\times 2\times 1=6$ assignments, which you can list in a minute. A 4 × 4 has 24 and a 5 × 5 has 120. That is why the algorithm exists.
Each person’s best is often not the best overall
In 2022 Paper 1 Question 20 (Part 3), give each flower store its shortest trip in turn. Store 1 takes B (17 km) and Store 2 takes A (15 km), which leaves Store 3 with C, its longest trip at 40 km. That totals 72 km.
The best assignment is 55 km, and it sends Store 1 on its longest trip (C, 24 km). I checked all six: 73, 57, 72, 62, 55 and 61 km. The optimal assignment often hands someone their worst option, so picking each row’s smallest value is not a method.
2021 Paper 1 Question 5
Paper 1 · Multiple choice · [1 mark]
The coach of a four-person relay team is deciding on the order of the runners. Use the bipartite graph to determine which statement is correct.
Start with the forced move. Linh has only one edge, to second runner, so Linh runs second.
With second taken, Ivan’s only remaining edge is third, so Ivan runs third. Simon’s remaining edge is fourth. That leaves first for Balal, which is one of Balal’s edges.
Balal first, Linh second, Ivan third, Simon fourth is the only order that uses every runner once. (A) and (B) are not edges at all. (D) is an edge, but if Balal runs fourth, nobody can run first. 90.3% of students chose (C).
Answer
(C) Ivan should be the third runner.
2023 Paper 1 Question 13
Paper 1 · Multiple choice · [1 mark]
Four athletes, Eoin (E), Fedir (F), Gede (G) and Hana (H), compete in three events: javelin (J), long jump (L) and sprints (S).
Athlete
Events
Eoin
L, S
Fedir
J
Gede
S
Hana
J, L
Which bipartite graph represents this information?
Every option is a bipartite graph, so the test is matching the edges to the table. The table gives six edges: E to L, E to S, F to J, G to S, H to J and H to L.
Count edges first. (B) and (D) have only five, so each is missing one: (B) has no H to L and (D) has no E to L. (A) has six, but two are wrong: E to J and H to S are not in the table. (C) has exactly the six edges. 94.1% of students chose (C).
Answer
(C)
2025 Paper 1 Question 10
Paper 1 · Multiple choice · [1 mark]
The table shows the average times (minutes) for three athletes to complete each stage of a triathlon relay.
Athlete 1
Athlete 2
Athlete 3
Swim
50
30
40
Bike
70
90
80
Run
60
70
50
Which athlete should complete each stage of a future triathlon relay to minimise the total completion time?
Look for the fastest athlete in each stage: swim is Athlete 2 (30), bike is Athlete 1 (70) and run is Athlete 3 (50). Those are three different athletes, so this is a valid assignment, and nothing can beat it because every stage already has its smallest time.
$$70+30+50=150\text{ min}$$
The other options total 170 min (A), 190 min (B) and 200 min (D). 83.5% of students chose (C).
Inspection was safe here only because the three fastest times belonged to three different athletes. When two stages share the same fastest person, as in the flower stores above, you need the algorithm.
Answer
(C) Athlete 1 bike, Athlete 2 swim, Athlete 3 run
Part 3
Reduce the rows, reduce the columns, then read the zeros
The Hungarian algorithm works on a square matrix of costs and finds the assignment with the smallest total. Learn these steps in order.
1Row reduction. Subtract the smallest value in each row from every entry in that row. Every row now has at least one zero.
2Column reduction. Subtract the smallest value in each column from every entry in that column. Every column now has at least one zero.
3Cover the zeros with the fewest possible straight lines, each through a whole row or a whole column. If the number of lines equals the size of the matrix, stop and assign (step 5). If there are fewer lines, go to step 4.
4Adjust. Find the smallest uncovered value. Subtract it from every uncovered entry, add it to every entry covered twice, then go back to step 3. (Part 4.)
5Assign. Choose one zero in each row and each column. Those positions are the optimal assignment. Add the original values in those positions for the total.
Why does it work? Every assignment uses exactly one entry from each row. Subtracting 17 from a whole row takes 17 off every possible assignment, so the best one stays the best. The same goes for columns. Once you can pick a full set of zeros, that assignment costs nothing extra in the reduced matrix, and no entry is negative, so nothing can beat it.
You can reduce the columns first. Every marking guide from 2020 to 2024 accepted either order. The matrices in between differ, the final assignment does not.
Two checkpoints
Checkpoint
How to run it
A zero in every row and column?
After the row reduction every row must have a zero, and after the column reduction every column too. If not, a reduction went wrong, for example by subtracting the smallest value in the whole matrix instead of in each row.
A new matrix for each step?
Write a fresh matrix after each reduction and each adjustment. The 2022, 2023 and 2024 subject reports all asked for exactly that.
Worked on a past question
In these tables an orange line through a row or column is a covering line. Shaded cells are covered once, darker cells are covered twice. A black box marks a zero chosen for the assignment. In the worked solutions the covering lines draw themselves in the order you would draw them (most uncovered zeros first), then the chosen zeros are boxed.
2022 Paper 1 Question 20
Paper 1 · Simple familiar · [4 marks]
The table summarises the distances in kilometres (km) between three flower stores and three delivery locations: A, B and C.
Use the Hungarian algorithm to determine the minimum total distance needed to deliver flowers to all locations if each store delivers flowers to only one location.
Every zero is in column B, so 1 line covers them all. Keep going.
3. After column reduction
A
B
C
Store 1
1
0
0
Store 2
0
0
1
Store 3
6
0
17
3 lines are needed and the matrix is 3 × 3, so assign.
1 mark · correctly reduces each row
1 mark · correctly reduces each column
Assign. Store 3 has only one zero (B), so Store 3 delivers to B. That uses column B, so Store 1 takes its other zero, C, and Store 2 takes A.
1 mark · identifies which store delivers to which location
Add the original distances, not the reduced ones:
$$24+15+16=55\text{ km}$$
1 mark · determines minimum total distance
The guide’s Method 2 reduces columns first (subtract 15, 14 and 22, then 2, 0 and 2 from the rows) and reaches the same allocation. Both later marks allow follow-through from an earlier error. Notice Store 1 is sent on its longest trip, the trap from Part 2.
Answer
Store 1 to C, Store 2 to A, Store 3 to B: 55 km
Reading the assignment off the zeros
Choosing the zeros is the second judgement point, and it decides the allocation mark. Use the same forced-move routine as a bipartite graph.
1Find a row or column with only one zero. That pairing is forced, so make it.
2Cross out that zero’s row and column. Those can’t be used again.
3Repeat with what is left until every row has a pairing.
4Check: one chosen zero in each row and in each column. Then go back to the original matrix for the values.
2022 Paper 1 Question 7
Paper 1 · Multiple choice · [1 mark]
This matrix was obtained after applying the Hungarian algorithm to determine the optimal allocation of three people, Elandra (E), Farid (F) and Grace (G), to three tasks: legal (L), monitoring (M) and verification (V).
The allocation sits on zeros, one per row and column. F has only one zero (L), so F does legal. With L gone, E’s remaining zero is M, so E does monitoring. G takes its other zero, V.
Option (A) lands on the three non-zero entries, 7, 3 and 1, which reads the matrix as if larger numbers were better. 37.1% of students chose it. Only 57.1% chose (C), the lowest result for any assignment item from 2021 to 2025.
Answer
(C) E to M, F to L and G to V.
2020 Paper 2 Question 5
Paper 2 · Complex familiar · [5 marks]
A company has three tasks to allocate to three contractors. Each of the contractors has a quote recorded for each task, shown in the table. The quotes are in thousands of dollars ($’000s).
Quotes ($’000s)
Task 1
Task 2
Task 3
A
3
3
1
B
4
7
2
C
4
4
1
Use a matrix method to determine the minimum cost if each contractor is allocated one task.
“Use a matrix method” names the method, so run the algorithm in full, even though a 3 × 3 could be done by inspection.
1. Row minimums
Task 1
Task 2
Task 3
A
3
3
1
−1
B
4
7
2
−2
C
4
4
1
−1
2. After row reduction
Task 1
Task 2
Task 3
A
2
2
0
B
2
5
0
C
3
3
0
−2
−2
0
Only 1 line is needed, so reduce the columns.
3. After column reduction
Task 1
Task 2
Task 3
A
0
0
0
B
0
3
0
C
1
1
0
3 lines are needed, so assign.
1 mark · correctly reduces each row
1 mark · correctly reduces each column
C has only one zero, so C does Task 3. B’s other zero is Task 1, which leaves Task 2 for A.
1 mark · allocates each task to one contractor
$$3+4+1=8$$
The minimum cost is $8000, with A on Task 2, B on Task 1 and C on Task 3.
1 mark · determines minimum cost
1 mark · shows logical organisation, communicating key steps
The guide lists the key steps as “appropriate mathematical vocabulary, symbols and conventions, e.g. connecting statements, lines to cover the zeros”. So draw the lines and say how many you needed. It allows the reductions in either order and follow-through on the allocation. The subject report labelled this question complex familiar and showed a response for “using a matrix method, as indicated within the question, … instead of by inspection”.
Answer
$8000 (A Task 2, B Task 1, C Task 3)
Part 4
Too few lines means adjust, then cover again
After both reductions there are not always enough zeros in the right places. The line count tells you. Fewer lines than the size of the matrix means no full set of zeros exists yet, so you adjust and try again.
Finding the fewest lines
1Count the zeros in each row and column.
2Draw a line through the row or column holding the most uncovered zeros.
3Repeat until every zero is covered.
4Check the count a second way: the fewest lines always equals the largest number of zeros you can pick with no two in the same row or column. If you can pick a full set, you are done whatever your lines say.
On a 3 × 3 the greedy count in steps 1 to 3 is nearly always right. On a 4 × 4 or 5 × 5 it can overshoot, and step 4 catches that. Write the count as a statement, the way the 2023 guide does: “2 < 3, so continue algorithm steps” or “3 = 3, so assign tasks”.
The adjustment step
1Find the smallest entry that no line covers. Call it $k$.
2Subtract $k$ from every uncovered entry.
3Add $k$ to every entry covered twice (where a row line crosses a column line).
4Leave entries covered once alone, then cover the zeros again.
This is the same as subtracting $k$ from every uncovered row and adding it back to every covered column, so it never changes which assignment is best. It creates at least one new zero, and because $k$ was the smallest uncovered value, nothing goes negative. Repeat until the lines match the size.
2023 Paper 2 Question 1
Paper 2 · [5 marks]
A triathlon relay has three sections: swim (S), cycle (C) and run (R). The matrix shows the average number of minutes for three athletes, Jane (J), Knox (K) and Levi (L), to complete each section.
Minutes
S
C
R
J
40
56
66
K
36
60
72
L
25
48
78
Use the Hungarian algorithm to predict the minimum total relay time if assigning each athlete to completing one section.
1. Row minimums
S
C
R
J
40
56
66
−40
K
36
60
72
−36
L
25
48
78
−25
2. After row reduction
S
C
R
J
0
16
26
K
0
24
36
L
0
23
53
0
−16
−26
1 mark · correctly reduces each row
3. After column reduction
S
C
R
J
0
0
0
K
0
8
10
L
0
7
27
2 < 3, so continue. The smallest uncovered value is 7.
4. After the adjustment
S
C
R
J
7
0
0
K
0
1
3
L
0
0
20
7 came off the four uncovered entries and went onto Jane’s swim entry, the one covered twice. 3 = 3, so assign.
1 mark · reduces each column
1 mark · continues algorithm steps until number of lines needed to cover all zeroes equals number of tasks
Knox has only one zero (S), so Knox swims. Levi’s remaining zero is C, so Levi cycles, and Jane runs.
1 mark · assigns athlete to complete one section
$$66+36+48=150\text{ min}$$
Assign Jane to run, Knox to swim and Levi to cycle. The predicted minimum total relay time is 150 minutes.
1 mark · predicts minimum total relay time including units
The guide accepts “equivalent times using different units”, so 2 h 30 min is fine. Its Method 1 reduces columns first (subtract 25, 48 and 66, then 6 from Knox’s row). That also needs 2 lines, the smallest uncovered value there is 5, and the adjusted matrix is different, but the assignment and the 150 minutes are the same.
Levi is the fastest swimmer by 11 minutes and does not swim. That is the kind of answer inspection misses. The 2023 report used this question to show “separate matrices drawn to show the outcome for each step” and “clear communication of the optimum assignments for the athletes and the predicted minimum total relay time, including appropriate units”.
Answer
Jane run, Knox swim, Levi cycle: 150 min
Try it yourself
Step through the Hungarian algorithm
Pick a matrix from the past questions, or make a random one, and step through the algorithm one stage at a time. The lab reduces, covers, adjusts when there are too few lines, assigns, and totals the original entries.
Matrix
Goal
Work each step on paper first, then press Next step to check it. Orange lines are covering lines, and a black box is a chosen zero.
Part 5
When the matrix needs building first, build it, then run the same algorithm
The two biggest assignment questions, 2021 Paper 2 Question 6 (7 marks) and 2024 Paper 2 Question 5 (6 marks), add a layer before or after the algorithm. 2021 gives the distances as expressions in $x$ and the minimum total, and asks for $x$. 2024 gives coordinates, so two distances have to be calculated before the matrix is complete. In both, the algorithm itself is the routine from Parts 3 and 4.
Algebraic entries: run it forwards, solve at the end
1Write the matrix with the algebraic entries.
2Run the reductions, subtracting algebraic minimums exactly as you would numbers. Where every entry in a row (or column) has the same $x$ term, it cancels on that reduction.
3Identify the optimal assignment once the reduced matrix is numeric. Finish the algorithm, including any adjustment, if the lines fall short.
4Write the total of the original entries in those positions, an expression in $x$. Set it equal to the given total and solve.
Why the $x$ terms vanish
If a row reads $x+3$, $x+7$ and $x+5$, subtracting the smallest, $x+3$, gives 0, 4 and 2. The $x$ has gone, and the differences the algorithm cares about are unchanged.
In 2021 the $2x$ entries all sat in one column, so row reduction left $x-3$ and $x+1$ in that column and the column reduction removed them. Either way, the $x$ vanished once every row and column had been reduced by its own minimum, so an algebraic matrix is no harder than a numeric one once you start.
2021 Paper 2 Question 6
Paper 2 · [7 marks]
A tow truck company has three tow trucks (A, B and C) and receives calls from three motorists (P, Q and R), who have broken down.
The network shows the distances in kilometres (km) from each of the tow trucks to each of the motorists, where $x$ represents the distance between Tow Truck C and Motorist P.
The minimum total distance travelled by the three tow trucks in order for each tow truck to visit exactly one motorist is 32 km.
Use the Hungarian algorithm to determine the distance between Tow Truck C and Motorist P.
Step 1 · Turn the network into a matrix, trucks as rows and motorists as columns.
Distances (km)
P
Q
R
A
$x+6$
$2x+3$
$x+7$
B
$x+3$
$2x+4$
$x+5$
C
$x$
$2x+1$
$x+3$
Row minimums: $x+6$, $x+3$ and $x$.
1 mark · correctly converts the network information into a matrix form
Row A’s smallest entry is $x+6$ as long as $x\ge 3$ (otherwise $2x+3$ is smaller). The answer, $x=6$, confirms it, and it is the reduction the guide uses.
Step 2 · Reduce the rows, then the columns.
After row reduction
P
Q
R
A
0
$x-3$
1
B
0
$x+1$
2
C
0
$x+1$
3
0
$-(x-3)$
−1
After column reduction
P
Q
R
A
0
0
0
B
0
4
1
C
0
4
2
The x has gone. 2 lines < 3, so adjust by the smallest uncovered value, 1.
1 mark · determines each matrix element by reducing each row
1 mark · determines each matrix element by reducing each column
After the adjustment
P
Q
R
A
1
0
0
B
0
3
0
C
0
3
1
3 lines are needed, so assign.
1 mark · correctly applies Hungarian algorithm
Step 3 · C has only one zero (P), so C goes to P. B’s other zero is R, and A takes Q.
1 mark · determines minimum allocation
Step 4 · Add the original entries for AQ, BR and CP, and set the total to 32:
1 mark · shows logical organisation communicating key steps
Check by substituting: with $x=6$ the trips are AQ 15 km, BR 11 km and CP 6 km, which total 32 km, and no other assignment is shorter. The guide accepts column reduction before row reduction and allows follow-through. Its key steps include “connecting statements, lines to cover the zeros”, so state the line count each time.
Answer
6 km (A to Q, B to R, C to P)
Entries from coordinates: Earth geometry first
2024 left two entries blank and gave coordinates instead. Two of the six marks were for those distances, so this question tests Topic guide 7, Earth geometry as much as assignment. Points on the same meridian use $D=111.2\times$ angular distance. Points on the same parallel use $D=111.2\cos\theta\times$ angular distance, with $\theta$ the latitude.
2024 Paper 2 Question 5
Paper 2 · [6 marks]
A flying doctor coordinator allocates a plane from each of three airbases, A, B and C, to fly to one of three sites, P, Q and R, to provide medical care. Distances (km) are shown in the table.
Distances (km)
P 28° S 136° E
Q
R 20° S 147° E
A 20° S 136° E
$x$
600
$y$
B
445
485
340
C
980
1170
770
Determine the optimal allocation for each plane and the minimum total distance flown.
Step 1 · $x$ is A to P. Both are on the 136° E meridian, and both latitudes are south, so the angular distance is $28^\circ-20^\circ=8^\circ$.
1 mark · correctly calculates distance $y$ in kilometres
The guide notes “Accept appropriate rounding” for both. Step 3 · Run the algorithm.
1. Row minimums
P
Q
R
A
890
600
1149
−600
B
445
485
340
−340
C
980
1170
770
−770
2. After row reduction
P
Q
R
A
290
0
549
B
105
145
0
C
210
400
0
−105
0
0
3. After column reduction
P
Q
R
A
185
0
549
B
0
145
0
C
105
400
0
3 lines are needed, so allocate.
1 mark · reduces each row
1 mark · reduces each column
A has only one zero (Q), and so does C (R). That leaves P for B. Airbase A flies to site Q, B to P and C to R.
1 mark · identifies optimal allocation for each plane
$$600+445+770=1815\text{ km}$$
1 mark · determines minimum total distance flown
The optimal allocation uses neither $x$ nor $y$, but you could not know that without them. The guide’s Method 2 reduces columns first and reaches the same allocation, and the reductions allow follow-through from wrong distances. The stem never says “Hungarian algorithm”, and the guide’s Method 3 earns the same two marks by listing all six possible allocations with their totals (1815 km is the smallest). On a 3 × 3 with no method named, either route is a complete method. When the stem names the algorithm, or the matrix is bigger, run the algorithm.
Answer
A to Q, B to P, C to R: 1815 km
Part 6
To maximise, subtract every entry from the largest one first
The algorithm only minimises. When the question wants the largest total (sales, points, profit), convert the matrix first.
1Find the largest value in the whole matrix.
2Subtract every entry from that largest value. This makes a new matrix of “shortfalls”.
3Run the algorithm as normal on the new matrix.
4Read the assignment positions, then take the totals from the original matrix.
The best entries become the smallest shortfalls, so the smallest total shortfall is the largest total. No maximum question has appeared in an external yet, but the 2025 syllabus names it, so it is fair game.
Bigger matrices change nothing in the method. A 5 × 5 needs 5 lines before you assign, and the adjustment may run more than once. The extra risk is arithmetic, so write every matrix out in full.
Worked example: a 4 × 4 maximum
A coach assigns four swimmers to the four legs of a medley relay. The table shows each swimmer’s time-trial points for each stroke, where higher is better. Find the assignment with the largest total.
Points (higher is better)
Back
Breast
Fly
Free
Ana
94
86
74
81
Ben
61
77
70
80
Cal
94
66
73
77
Dee
78
67
64
90
Ana and Cal are both best at backstroke, so “everyone does their best stroke” is impossible.
1. Converted: 94 minus each entry
Back
Breast
Fly
Free
Ana
0
8
20
13
0
Ben
33
17
24
14
−14
Cal
0
28
21
17
0
Dee
16
27
30
4
−4
2. After row reduction
Back
Breast
Fly
Free
Ana
0
8
20
13
Ben
19
3
10
0
Cal
0
28
21
17
Dee
12
23
26
0
0
−3
−10
0
3. After column reduction
Back
Breast
Fly
Free
Ana
0
5
10
13
Ben
19
0
0
0
Cal
0
25
11
17
Dee
12
20
16
0
3 < 4, so adjust. The smallest uncovered value is 5.
4. After the adjustment
Back
Breast
Fly
Free
Ana
0
0
5
13
Ben
24
0
0
5
Cal
0
20
6
17
Dee
12
15
11
0
4 = 4, so assign.
In step 4, 5 came off the six uncovered entries and went onto Ben’s backstroke and freestyle entries, the two covered twice. Other sets of 3 lines would also cover the zeros in step 3. Any of them works, and leads to the same assignment.
Assign. Cal’s only zero is backstroke and Dee’s only zero is freestyle. With those columns gone, Ana’s remaining zero is breaststroke and Ben takes butterfly. Read the points from the original table:
$$86+70+94+90=340\text{ points}$$
Ana swims breaststroke, Ben butterfly, Cal backstroke and Dee freestyle, for a maximum of 340 points. Ana, who ties for the best backstroke score, does not swim backstroke.
Part 7
Where the marks go, and how not to drop them
The marking guides from 2020 to 2024 give one mark per stage of the algorithm. The pattern barely moves from year to year.
matrix from the network, rows, columns, applying the algorithm (the adjustment), allocation, $x$, logical organisation
2022 Paper 1 Q20 (4 marks)
rows, columns, allocation, total
2023 Paper 2 Q1 (5 marks)
rows, columns, continuing until lines equal tasks, assignment, total with units
2024 Paper 2 Q5 (6 marks)
distance $x$, distance $y$, rows, columns (or, by inspection, all six allocations and their totals), allocation, total
So the reductions alone are worth two marks in every algorithm solution here. A student who reduces correctly and then stalls still banks them.
What the guides and reports reward
•A separate matrix for each step. The 2022, 2023 and 2024 reports all asked for it. Write each one out in full.
•Either order. Every guide from 2020 to 2024 accepted the columns reduced before the rows.
•The line count, stated. 2020 and 2021 named “lines to cover the zeros” as a key step for the communication mark, and 2023 wrote “2 < 3, so continue algorithm steps”. Draw the lines and write the comparison.
•The assignment in words. Name who does what (“assign Jane to run, Knox to swim and Levi to cycle”) before the arithmetic. It is a mark of its own every time.
•The total from the original matrix, with units. The reduced values mean nothing in context. 2023’s last mark said “including units”.
•Follow-through. Every guide from 2020 to 2024 allows follow-through from errors in earlier working. A slip in a reduction does not end the question, so keep going.
When the stem names the method, use it
Four of the five short-response questions name the method: 2020 says “Use a matrix method”, and 2021, 2022 and 2023 say “Use the Hungarian algorithm”. The 2020 report showed an effective response for “using a matrix method, as indicated within the question, to develop a response instead of by inspection”.
When the stem names the method, inspection can reach the right total and still miss the reduction marks. 2024 did not name a method, and its guide gave the same two marks either to the reductions or to a full list of the six allocations with their totals. Justify, don’t assert: on short response, always show a complete method, and past 3 × 3 that means the algorithm.
Self-checks to run inside the question
Checkpoint
How to run it
Minimum or maximum?
The algorithm minimises. For a maximum, subtract every entry from the largest first.
Every entry filled?
Build the matrix from a network, coordinates or algebra before you reduce anything.
A zero in every row and column?
After both reductions, yes. If not, recheck the minimums.
Enough lines?
Lines must equal the matrix size before you assign. Fewer means adjust.
One zero per row and column?
The chosen zeros must sit in different rows and different columns.
Original values?
Add the totals from the original matrix, never the reduced one.
Answered the question?
2021 wanted $x$, not the total. Give the assignment, the total, and the unit.
Game plan
Your game plan for assignment questions
1Build the matrix: one group as rows, the other as columns. If the question gives a network, coordinates or algebra, fill in every entry first.
2Decide whether you want a minimum or a maximum. For a maximum, subtract every entry from the largest entry and work on the new matrix.
3Reduce each row by its smallest value, then each column by its smallest value (either order). Write a new matrix each time and check for a zero in every row and column.
4Cover all the zeros with the fewest lines and write the count against the size: “2 < 3, so continue” or “3 = 3, so assign”.
5If there are too few lines, subtract the smallest uncovered value from every uncovered entry, add it to every entry covered twice, and cover again.
6Pick one zero in each row and column, starting from any row or column with only one zero, and state the assignment in words.
7Add the original values, not the reduced ones, and answer in context with units. If a value was unknown, set the total equal to the given total and solve.
I wrote these four to the QCAA format and checked every answer in Python. The marking shown is my suggested marking, in the style of the QCAA guides. Question 4 has the shape of 2021 Paper 2 Question 6, so attempt it as one question with no parts and give yourself about 17 minutes.
Question 1 of 4
Skill 3: Cover the zeros and adjust · Simple familiar · [1 mark]
A 3 × 3 cost matrix has been row reduced and column reduced. Every row and every column contains a zero, but all the zeros can be covered by only two lines. The next step is to
Two lines is fewer than the size of the matrix, 3, so no full set of zeros exists yet. The algorithm continues with the adjustment step, then covers the zeros again.
(A) reads off an answer too early. (C) does nothing, because every row already has a zero, so its smallest value is 0. (D) is the conversion for a maximum problem, which happens before any reduction.
Answer
(B)
Question 2 of 4
Skill 2: Reduce, then read the zeros · Simple familiar · [4 marks]
Three delivery vans must each be assigned to one of three depots, P, Q and R. The travel times in minutes are shown in the table.
Travel time (min)
P
Q
R
Van 1
22
19
31
Van 2
27
25
34
Van 3
18
24
29
Use the Hungarian algorithm to determine the minimum total travel time if each van is assigned to only one depot. [4 marks]
1. Row minimums
P
Q
R
Van 1
22
19
31
−19
Van 2
27
25
34
−25
Van 3
18
24
29
−18
2. After row reduction
P
Q
R
Van 1
3
0
12
Van 2
2
0
9
Van 3
0
6
11
0
0
−9
3. After column reduction
P
Q
R
Van 1
3
0
3
Van 2
2
0
0
Van 3
0
6
2
3 lines are needed, so assign.
1 mark · reduces each row (subtract 19, 25 and 18)
1 mark · reduces each column (subtract 9 from R only)
Van 1 has only one zero (Q), and so does Van 3 (P). Van 2 takes R.
1 mark · assigns Van 1 to Q, Van 2 to R and Van 3 to P
$$19+34+18=71\text{ min}$$
1 mark · determines the minimum total travel time, 71 minutes
Van 2 goes to its slowest depot, R (34 minutes), which inspection would avoid. Read the times from the original table.
Answer
Van 1 to Q, Van 2 to R, Van 3 to P: 71 min
Question 3 of 4
Skill 5: Convert a maximum problem · Simple familiar · [4 marks]
Three sales staff can each be assigned to one of three regions. The expected sales, in thousands of dollars, are shown in the table.
Expected sales ($’000s)
Region 1
Region 2
Region 3
Ari
42
35
50
Bo
30
44
38
Cass
36
47
29
Determine the allocation that maximises total expected sales, and state that maximum. [4 marks]
This is a maximum, so convert first. The largest entry is 50, so subtract every entry from 50.
1. Converted: 50 minus each entry
Region 1
Region 2
Region 3
Ari
8
15
0
0
Bo
20
6
12
−6
Cass
14
3
21
−3
2. After row reduction
Region 1
Region 2
Region 3
Ari
8
15
0
Bo
14
0
6
Cass
11
0
18
−8
0
0
1 mark · converts the matrix by subtracting each entry from 50
3. After column reduction
Region 1
Region 2
Region 3
Ari
0
15
0
Bo
6
0
6
Cass
3
0
18
2 < 3, so adjust. The smallest uncovered value is 3.
4. After the adjustment
Region 1
Region 2
Region 3
Ari
0
18
0
Bo
3
0
3
Cass
0
0
15
3 = 3, so assign.
1 mark · reduces rows and columns correctly
Bo has only one zero (Region 2). Cass’s remaining zero is Region 1, and Ari takes Region 3.
1 mark · continues the algorithm and allocates Ari to Region 3, Bo to Region 2 and Cass to Region 1
$$50+44+36=130$$
1 mark · determines the maximum total expected sales, $130 000
The diagonal allocation (Ari 1, Bo 2, Cass 3) gives only $115 000. Take the totals from the original sales, not the converted matrix.
Answer
Ari Region 3, Bo Region 2, Cass Region 1: $130 000
Question 4 of 4
Skill 4: Build the matrix first · Complex unfamiliar · [7 marks]
A council must assign three maintenance crews (A, B and C) to three worksites (P, Q and R). The distances in kilometres are: Crew A travels $y+4$ to P, $y+9$ to Q and $y+2$ to R. Crew B travels $y+6$ to P, $y+5$ to Q and $y+11$ to R. Crew C travels $y+12$ to P, $y+3$ to Q and $y+8$ to R.
Each crew is assigned exactly one worksite. The minimum total distance travelled is 44 km, and crews are paid $2.80 per kilometre travelled.
Ronan claims Crew B will be paid less than $45 for its trip in the optimal assignment. Evaluate the reasonableness of Ronan’s claim.
Every entry in a row shares the same $y$, so the row reduction removes it.
1. Distances (km), with row minimums
P
Q
R
A
$y+4$
$y+9$
$y+2$
$-(y+2)$
B
$y+6$
$y+5$
$y+11$
$-(y+5)$
C
$y+12$
$y+3$
$y+8$
$-(y+3)$
2. After row reduction
P
Q
R
A
2
7
0
B
1
0
6
C
9
0
5
−1
0
0
3. After column reduction
P
Q
R
A
1
7
0
B
0
0
6
C
8
0
5
3 lines are needed, so assign.
1 mark · reduces each row
1 mark · reduces each column
A has only one zero (R), and so does C (Q). B takes P.
1 mark · identifies the optimal assignment: A to R, B to P, C to Q
Calculate, compare, conclude: $47.60 is more than $45, so Ronan’s claim is not reasonable. Crew B will be paid $2.60 more than his figure.
1 mark · evaluates the reasonableness of the claim, comparing $47.60 with $45
1 mark · shows logical organisation, communicating key steps
Check: the three trips are 13, 17 and 14 km, which total 44 km. The verdict needs the comparison written out, not just the number.
Answer
Not reasonable: Crew B travels 17 km and is paid $47.60, more than $45
Sources: QCAA General Mathematics external assessment question books, multiple choice books and marking guides, 2020 to 2025. General Mathematics 2025 v1.3 general senior syllabus, Unit 4 Topic 5, and the 2019 v1.2 syllabus for comparison. QCAA General Mathematics subject reports, 2020 to 2025. General Mathematics formula book. Every matrix on this page, including each reduction, covering and adjustment, was recomputed in Python and every optimal assignment checked against all possible assignments.