Solution
This is the cost matrix.
| 99 | 35 | 3 | 23 |
| 66 | 80 | 11 | 85 |
| 56 | 30 | 72 | 86 |
| 72 | 30 | 51 | 93 |
Subtract row minima
For each row, the minimum element is subtracted from all elements in that row.
| 96 | 32 | 0 | 20 | (-3) |
| 55 | 69 | 0 | 74 | (-11) |
| 26 | 0 | 42 | 56 | (-30) |
| 42 | 0 | 21 | 63 | (-30) |
Subtract column minima
For each column, the minimum element is subtracted from all elements in that column.
| 70 | 32 | 0 | 0 |
| 29 | 69 | 0 | 54 |
| 0 | 0 | 42 | 36 |
| 16 | 0 | 21 | 43 |
| (-26) | | | (-20) |
Cover all zeros with a minimum number of lines
A total of 4 lines are required to cover all zeros.
| 70 | 32 | 0 | 0 | x |
| 29 | 69 | 0 | 54 | x |
| 0 | 0 | 42 | 36 | x |
| 16 | 0 | 21 | 43 | x |
The optimal assignment
Because there are 4 lines required, an optimal assignment exists among the zeros.
| 70 | 32 | 0 | 0 |
| 29 | 69 | 0 | 54 |
| 0 | 0 | 42 | 36 |
| 16 | 0 | 21 | 43 |
This corresponds to the following optimal assignment in the original cost matrix.
| 99 | 35 | 3 | 23 |
| 66 | 80 | 11 | 85 |
| 56 | 30 | 72 | 86 |
| 72 | 30 | 51 | 93 |
The total minimum cost is 120.