Critical path practice › Hungarian algorithm

Hungarian algorithm practice

New four by four allocation tables every time: reduce the rows and columns, cover the zeros with the fewest lines, adjust, and allocate. Check each answer or print a key.

Question types
Question types
Conventions

Set

    Your answers save on this device as you type.

    What you practice

    Each set makes new tables of times or costs for four people and four tasks. Reduce the rows, then the columns, and give numbers from the reduced table; count the fewest lines that cover every zero; then finish the algorithm, allocate on the zeros and read the minimum total from the original table. The key shows every table along the way, with the covered cells shaded.

    Example: one adjustment

    In set TASK2N (VCE) four volunteers share four jobs. After the row and column steps, 3 lines cover every zero, such as the row for Jade and the columns for Jobs 2 and 4, so the table needs another step. The smallest uncovered number is 2: subtract it from the uncovered numbers and add it where two lines cross. Now 4 lines are needed, and the allocation is Ivo Job 2, Kiri Job 3, Omar Job 4 and Jade Job 1: 13 + 37 + 8 + 19 = 77 minutes. Open set TASK2N

    Questions

    What are the steps of the Hungarian algorithm?

    Subtract the smallest number in each row from that row, then the smallest in each column from that column. Cover every zero with as few lines as possible. With fewer lines than rows, adjust the table and cover again. When the lines equal the number of rows, allocate on the zeros.

    Do you reduce the rows or the columns first?

    VCE solutions reduce the rows first, then the columns. Doing only one of the two steps, or the columns first, can give a different table. The wrong options in the 2025 VCE exam question on this step were exactly those three slips.

    How do you adjust the table when there are too few lines?

    Find the smallest number not covered by a line. Subtract it from every uncovered number and add it to each number where two lines cross. Numbers covered by one line stay the same. Then cover the zeros again.

    How do you allocate after the Hungarian algorithm?

    Start with a row or column that has only one zero and allocate there, then cross out that row and column. Repeat until every person has one task. Read the total from the original table, not the reduced one.

    Is the Hungarian algorithm in HSC Mathematics Standard 2?

    No. It is part of Networks and decision mathematics in VCE General Mathematics. HSC Mathematics Standard 2 covers spanning trees, shortest paths and network flow, which have their own pages here.

    Sources, read October 28, 2026: NESA HSC Mathematics Standard 2 papers, marking guidelines and feedback, 2025, 2024 and 2023; NSW Department of Education, Year 12 Mathematics Standard 2 networks resources; VCE General Mathematics study design; VCAA General Mathematics examinations and reports, 2023 to 2025.