The Hungarian algorithm
The Hungarian algorithm reduces an assignment table until independent zero entries identify an optimum one-to-one allocation. The selected rows and columns are then mapped back to the original table to calculate the objective total
- Set the objective first For a maximum score, let M be the largest original entry and replace x by M minus x. \(\displaystyle x'_{ij}=M-x_{ij}\)
- Reduce each row Subtract the smallest entry in a row from every entry in that row \(\displaystyle \min(10,7,12)=7,\quad(10,7,12)-7=(3,0,5)\)
- Reduce each column After row reduction, subtract the smallest entry in each column from that column \(\displaystyle \min(4,7,1)=1,\quad4-1=3\)
- Select independent zeros Choose one zero in each row and column, then use the original entries for the total \(\displaystyle A\to J_2,\ B\to J_3,\ C\to J_1:\quad7+6+7=20\)
- Eligibility is not an assignment A bipartite graph separates resources and tasks. An eligibility edge permits a pair; a matching chooses edges with no repeated endpoint. A complete assignment needs one permitted pair for every required task and resource in the square model
- State the objective and the model A sum of machine processing times is total active machine-time, not automatically elapsed project duration. Zero dummy entries represent a precisely defined unused resource or optional task, never free real work or permission to omit required work
Worked example
The entries in a 3 by 3 assignment table are costs to minimise. Find an optimum allocation and its original total
- \(\displaystyle \min(10,7,12)=7,\quad\min(8,11,6)=6,\quad\min(7,13,9)=7\)The row minima are 7, 6 and 7.
- \(\displaystyle \begin{bmatrix}10-7&7-7&12-7\\8-6&11-6&6-6\\7-7&13-7&9-7\end{bmatrix}=\begin{bmatrix}3&0&5\\2&5&0\\0&6&2\end{bmatrix}\)Subtract each row minimum from every entry in its row
- \(\displaystyle A\to J_2,\quad B\to J_3,\quad C\to J_1\)These zero entries use each row and each column exactly once
- \(\displaystyle 7+6+7=20\)Return to the original table, where the optimum total is 20.
Common mistakes
Difficulty levels
Questions about this topic
Why are row and column reductions allowed?+
Subtracting a constant from every entry in one row or column changes every complete assignment total by the same amount. It therefore preserves which assignments are optimum while creating zeros
Why must the final total use the original table?+
The reduced table is a working table for locating an optimum allocation. The original entries are the actual costs, distances, durations or scores being totalled
How is a maximum assignment handled?+
Let M be the largest original entry and replace each score x with M minus x. Minimising the transformed total then gives the maximum original score total
Can I just choose the smallest entry in each row?+
Only if the selected columns are all different. Row minima can repeat a job and then fail the one-to-one constraint
Why must I use the original table for the final total?+
The reduced table preserves the best assignment under the stated transformation, but its zeros are not the original costs or benefits
Does a dummy row make an impossible required workload feasible?+
No. A dummy assignment is not real work. State explicitly which task can remain undone or whether an extra real resource is needed
Can I use a calculator?+
A calculator is allowed unless a question is marked no calculator
Which year level and chapter is this?+
Year 12, VCE Units 3 & 4, General Mathematics, chapter 14: Flow, matching and scheduling