Solution
This is the cost matrix.
| 3 | 68 | 20 | 5 |
| 36 | 42 | 27 | 41 |
| 23 | 86 | 27 | 14 |
| 66 | 96 | 21 | 43 |
Subtract row minima
For each row, the minimum element is subtracted from all elements in that row.
| 0 | 65 | 17 | 2 | (-3) |
| 9 | 15 | 0 | 14 | (-27) |
| 9 | 72 | 13 | 0 | (-14) |
| 45 | 75 | 0 | 22 | (-21) |
Subtract column minima
For each column, the minimum element is subtracted from all elements in that column.
| 0 | 50 | 17 | 2 |
| 9 | 0 | 0 | 14 |
| 9 | 57 | 13 | 0 |
| 45 | 60 | 0 | 22 |
| (-15) | | |
Cover all zeros with a minimum number of lines
A total of 4 lines are required to cover all zeros.
| 0 | 50 | 17 | 2 | x |
| 9 | 0 | 0 | 14 | x |
| 9 | 57 | 13 | 0 | x |
| 45 | 60 | 0 | 22 | x |
The optimal assignment
Because there are 4 lines required, an optimal assignment exists among the zeros.
This corresponds to the following optimal assignment in the original cost matrix.
| 3 | 68 | 20 | 5 |
| 36 | 42 | 27 | 41 |
| 23 | 86 | 27 | 14 |
| 66 | 96 | 21 | 43 |
The total minimum cost is 80.