Salam Academy
Contents · 0% complete
  1. Learning objectives
  2. Core idea
  3. Key formulae
  4. Worked examples
  5. Explore the graph
  6. Common mistakes
  7. Exam tip
  8. Guided practice
  9. Practice questions
  10. Challenge
  11. Summary
  12. Quick quiz
  13. Same topic, different board
  14. Past paper questions
Allocation problems · Subtopic 1 of 1

Allocation Problems

Assign nn workers to nn tasks at least total cost. The Hungarian algorithm reduces rows then columns so each has a zero; cover all zeros with the fewest lines; if fewer than nn lines, subtract the smallest uncovered value from uncovered cells and add it at intersections. With nn lines an optimal allocation of zeros exists.

Edexcel 9FM0 Option≈ 45 minRevision 1 · updated 2026-10-27
Section 1 of 14

Learning objectives

  • Apply row and column reduction.
  • Cover zeros and adjust the matrix.
  • Read off an optimal allocation.
  • Handle dummies, maximisation and forbidden pairings.
Pause and think

Three workers, three jobs: why not just give each worker their cheapest job?

Section 2 of 14

Core idea

Start hereWho does what?

Three workers, three jobs, and each worker charges differently for each job. Everyone may want the same cheap job. The Hungarian algorithm untangles this, finding the cheapest one-to-one allocation without checking every possibility.

The big idea

Subtracting a constant from a whole row or column doesn't change which allocation is best. Reduce until zeros appear, then adjust until nn independent zeros exist: they mark the optimal allocation.

1. The algorithm

Why reduction is allowed
  1. every allocation uses one cell per row\text{every allocation uses one cell per row}
    Each worker gets exactly one job.
  2. subtract c from a row⇒every total falls by c\text{subtract }c\text{ from a row}\Rightarrow\text{every total falls by }c
    All allocations change equally.
  3. ranking of allocations unchanged\text{ranking of allocations unchanged}
    So the optimum is the same.
Worked exampleA 3×3 problem

PP: 4,2,84,2,8; QQ: 4,3,74,3,7; RR: 3,1,63,1,6. Minimise total cost.

Goal
Allocation.
Strategy
Reduce, cover, adjust.
  1. P:2,0,6; Q:1,0,4; R:2,0,5P:2,0,6;\ Q:1,0,4;\ R:2,0,5
    Row minima 2,3,12,3,1.
  2. P:1,0,2; Q:0,0,0; R:1,0,1P:1,0,2;\ Q:0,0,0;\ R:1,0,1
    Column minima 1,0,41,0,4.
  3. 2 lines<3; m=12\text{ lines}<3;\ m=1
    Row QQ and column 2 cover all zeros.
  4. P:0,0,1; Q:0,1,0; R:0,0,0P:0,0,1;\ Q:0,1,0;\ R:0,0,0
    −1-1 uncovered, +1+1 at the intersection.
Answere.g. P→2P\to2, Q→3Q\to3, R→1R\to1: 2+7+3=122+7+3=12.
✓ CheckAll six allocations: 13,12,12,12,13,1413,12,12,12,13,14; minimum 1212 ✓.
Hungarian algorithm

Loop until enough lines are needed.

TrickMaximising Subtract each entry from the largest entry, then minimise.
Common misconceptionReport true cost Add up the original costs, not the reduced ones.
Pause and think

Why does adjusting never make an entry negative?

Summary

  • Reduce rows, columns.
  • Cover zeros; adjust.
  • Dummies, maximisation, restrictions.
Key words
Allocation
One-to-one matching of workers to tasks.
Dummy
Extra row or column of zeros to square the matrix.
HistoryKuhn and the Hungarians. Harold Kuhn published the method in 1955, naming it after Hungarian mathematicians Kőnig and Egerváry, whose 1930s work it built on.
Fun factFactorial explosion. 10 workers and 10 jobs have 3 628 8003\,628\,800 possible allocations. The Hungarian method needs only about 10310^3 steps.
Section 3 of 14

Key formulae

Reductionsubtract row minima, then column minima\text{subtract row minima, then column minima}
Optimal testfewest lines covering all zeros=n\text{fewest lines covering all zeros}=n
Adjustment−m uncovered, +m at intersections-m\ \text{uncovered},\ +m\ \text{at intersections}
TrickMaximising. To maximise (e.g. scores), subtract every entry from the largest entry first, then minimise as usual.
Section 4 of 14

Worked examples

Example 1 · Hungarian0 / 3 steps
Costs: PP: 4,2,84,2,8; QQ: 4,3,74,3,7; RR: 3,1,63,1,6 for jobs 1,2,31,2,3. Find the minimum cost.
    Section 5 of 14

    Explore the graph

    Brute force vs Hungarian
    Loading the interactive graph…
    Try this
    1. x3x^3 is roughly the Hungarian method's work for an x×xx\times x matrix.
    2. 2x2^x is already explosive, and checking all x!x! allocations grows faster still.

    Polynomial beats exponential.

    In the real worldRide-hailing. Taxi apps assign nearby drivers to passengers in batches using assignment algorithms to cut total waiting time.
    Section 6 of 14

    Common mistakes

    IncorrectColumn-reduce first
    CorrectRows first (unless told otherwise)
    Follow the standard order; answers can differ in steps.
    IncorrectUsing the reduced values as the cost
    CorrectUse the original costs
    Reduced numbers aren't costs.
    IncorrectNon-square matrix
    CorrectAdd a dummy row or column of zeros
    The algorithm needs n×nn\times n.

    Three workers want job 2

    Hungarian algorithm: calm down, everyone.

    Section 7 of 14

    Exam tip

    Exam tipForbidden pairings. Replace a forbidden cost with a very large number so that cell is never chosen.
    Section 8 of 14

    Guided practice

    SA-DM-AS-G011 markL1 FoundationNon-calculatorHungarian
    Row PP of a cost matrix is 4,2,84,2,8. After row reduction, what is the entry in column 3?

    Sign in or create a free account to check answers, get hints and track your progress.

    Salam Academy Original Practice · Proposed mark scheme
    Section 9 of 14

    Practice questions

    SA-DM-AS-0013 marksL3 ExamNon-calculatorHungarian
    Costs: PP: 4,2,84,2,8; QQ: 4,3,74,3,7; RR: 3,1,63,1,6 (jobs 1–3). Find the minimum total cost.

    Sign in or create a free account to check answers, get hints and track your progress.

    Salam Academy Original Practice · Proposed mark scheme
    SA-DM-AS-0021 markL1 FoundationNon-calculatorVariants
    Three workers are to be assigned to four jobs. How many dummy workers (rows) are needed?

    Sign in or create a free account to check answers, get hints and track your progress.

    Salam Academy Original Practice · Proposed mark scheme
    SA-DM-AS-0031 markL2 StandardNon-calculatorVariants
    To maximise, entries are subtracted from the largest entry, 2020. What does an entry of 1414 become?

    Sign in or create a free account to check answers, get hints and track your progress.

    Salam Academy Original Practice · Proposed mark scheme

    More questions on every skill in this subtopic are in the question bank under Practise.

    Section 10 of 14

    Challenge

    SA-DM-AS-0042 marksL3 ExamNon-calculatorHungarian
    After reduction a 4×44\times4 matrix has all zeros covered by 33 lines, and the smallest uncovered entry is 22. A cell covered by two lines had value 11. What is its value after adjustment?

    Sign in or create a free account to check answers, get hints and track your progress.

    Salam Academy Original Practice · Proposed mark scheme
    Section 11 of 14

    Summary

    • Reduce rows, columns.
    • Cover zeros with fewest lines.
    • Adjust if fewer than nn.
    • Dummies; maximise by subtracting from max.
    Section 12 of 14

    Quick quiz

    Q1 · SA-DM-AS-Q011 markL1 FoundationNon-calculatorHungarian
    An optimal allocation can be read from an n×nn\times n reduced matrix when
    Choose one option

    Sign in or create a free account to check answers, get hints and track your progress.

    Salam Academy Original Practice · Proposed mark scheme
    Section 13 of 14

    Same topic, different board

    Specification
    A level Further Mathematics 9FM0
    Where
    Decision 2 · Allocation (assignment) problems
    Expected
    Hungarian algorithm with row then column reduction; covering zeros; adjusting; dummy rows or columns; maximising by subtracting from the largest; incomplete data; formulating as a linear programme.
    Calculator
    Permitted; show enough working to earn the method marks.
    Typical style
    Edexcel often opens with a routine part and builds to a "show that" or "prove" part.
    Open in
    9FM0 · Option
    Section 14 of 14

    Past paper questions

    No past paper questions are tagged to this subtopic yet. We add papers every week.

    Browse past papers

    Salam Academy original content · Content status: reviewed and published. Syllabus mapping: Pearson Edexcel 9FM0, First teaching 2017 (official specification).