Solution
This is the cost matrix.
| 90 | 36 | 5 | 86 |
| 76 | 51 | 64 | 53 |
| 72 | 44 | 28 | 27 |
| 54 | 67 | 52 | 90 |
Subtract row minima
For each row, the minimum element is subtracted from all elements in that row.
| 85 | 31 | 0 | 81 | (-5) |
| 25 | 0 | 13 | 2 | (-51) |
| 45 | 17 | 1 | 0 | (-27) |
| 2 | 15 | 0 | 38 | (-52) |
Subtract column minima
For each column, the minimum element is subtracted from all elements in that column.
| 83 | 31 | 0 | 81 |
| 23 | 0 | 13 | 2 |
| 43 | 17 | 1 | 0 |
| 0 | 15 | 0 | 38 |
| (-2) | | | |
Cover all zeros with a minimum number of lines
A total of 4 lines are required to cover all zeros.
| 83 | 31 | 0 | 81 | x |
| 23 | 0 | 13 | 2 | x |
| 43 | 17 | 1 | 0 | x |
| 0 | 15 | 0 | 38 | x |
The optimal assignment
Because there are 4 lines required, an optimal assignment exists among the zeros.
| 83 | 31 | 0 | 81 |
| 23 | 0 | 13 | 2 |
| 43 | 17 | 1 | 0 |
| 0 | 15 | 0 | 38 |
This corresponds to the following optimal assignment in the original cost matrix.
| 90 | 36 | 5 | 86 |
| 76 | 51 | 64 | 53 |
| 72 | 44 | 28 | 27 |
| 54 | 67 | 52 | 90 |
The total minimum cost is 137.