Solution
This is the cost matrix.
| 89 | 79 | 69 | 22 | 31 |
| 79 | 61 | 44 | 43 | 38 |
| 34 | 60 | 56 | 79 | 57 |
| 56 | 60 | 13 | 56 | 9 |
| 9 | 98 | 8 | 7 | 4 |
Subtract row minima
For each row, the minimum element is subtracted from all elements in that row.
| 67 | 57 | 47 | 0 | 9 | (-22) |
| 41 | 23 | 6 | 5 | 0 | (-38) |
| 0 | 26 | 22 | 45 | 23 | (-34) |
| 47 | 51 | 4 | 47 | 0 | (-9) |
| 5 | 94 | 4 | 3 | 0 | (-4) |
Subtract column minima
For each column, the minimum element is subtracted from all elements in that column.
| 67 | 34 | 43 | 0 | 9 |
| 41 | 0 | 2 | 5 | 0 |
| 0 | 3 | 18 | 45 | 23 |
| 47 | 28 | 0 | 47 | 0 |
| 5 | 71 | 0 | 3 | 0 |
| (-23) | (-4) | | |
Cover all zeros with a minimum number of lines
A total of 5 lines are required to cover all zeros.
| 67 | 34 | 43 | 0 | 9 | x |
| 41 | 0 | 2 | 5 | 0 | x |
| 0 | 3 | 18 | 45 | 23 | x |
| 47 | 28 | 0 | 47 | 0 | x |
| 5 | 71 | 0 | 3 | 0 | x |
The optimal assignment
Because there are 5 lines required, an optimal assignment exists among the zeros.
| 67 | 34 | 43 | 0 | 9 |
| 41 | 0 | 2 | 5 | 0 |
| 0 | 3 | 18 | 45 | 23 |
| 47 | 28 | 0 | 47 | 0 |
| 5 | 71 | 0 | 3 | 0 |
This corresponds to the following optimal assignment in the original cost matrix.
| 89 | 79 | 69 | 22 | 31 |
| 79 | 61 | 44 | 43 | 38 |
| 34 | 60 | 56 | 79 | 57 |
| 56 | 60 | 13 | 56 | 9 |
| 9 | 98 | 8 | 7 | 4 |
The total minimum cost is 134.