Convert the maximisation to a minimisation
M=9,cij′=M−cij:W1W2W3W4W5J124129J225789J388649J444379J522709 Subtracting every profit from the largest profit M makes the problem a minimisation.
Add a dummy row/column of equal costs
add 1 dummy rows of 0 cost The dummy has equal (zero) costs and squares the matrix without affecting the real assignment.
Row reduction: subtract the smallest entry of each row
W1W2W3W4W5J102020J203680J366540J422270J500600 This creates at least one zero in every row.
Column reduction leaves the matrix unchanged
each column already contains a 0 Every column already has a zero, so nothing is subtracted.
Cover the zeros with the fewest lines (iteration 1)
rows {1,3,5}, cols {5}, lines=4<5 Fewer than n lines means the matrix is not yet optimal.
Augment: subtract θ from uncovered entries, add at intersections
θ=2:W1W2W3W4W5J100000J201660J364520J420250J520802 This creates a new zero while keeping every entry non-negative.
Check optimality: n lines are now needed
minimum covering lines=5=n When the minimum number of covering lines equals n, a complete assignment of zeros exists.
Select a complete set of zeros, one in each row and column
W1→J2, W2→J4, W3→J1, W4→J5, W5→J3 These zeros give an assignment of zero reduced cost, which is optimal.
Confirm no assignment does better
W1→J2, W2→J1, W3→J4, W4→J5, W5→J3: 27 ≤ 29 The next best assignment is strictly worse, so the optimum is unique.
Compute the total from the original table
7+5+8+9+0=29 The reductions found the assignment; its profit is the sum of the original entries.
Recall what the Hungarian algorithm does
Hungarian algorithm⇒minimum-cost assignment It finds an assignment of each worker to exactly one job that minimises the total cost.
Recall the row-reduction step
cij→cij−jmincij Subtracting the smallest entry of each row from that row creates a zero in every row.
Recall the column-reduction step
cij→cij−imincij Subtracting the smallest entry of each column from that column creates a zero in every column.
Recall the optimality test
minimum covering lines=n⟺optimal assignment exists An assignment of zero reduced cost exists exactly when n lines are needed to cover the zeros.
Recall the augmenting step
subtract θ from uncovered, add θ at intersections Here theta is the smallest uncovered entry; this creates a new zero while keeping every entry non-negative.
State the maximum total profit
maximum total profit=29 The dummy assignments cost nothing, so this is the real optimum.