Solution
This is the cost matrix.
| 36 | 63 | 11 | 7 |
| 15 | 22 | 34 | 57 |
| 36 | 50 | 54 | 85 |
| 61 | 49 | 50 | 33 |
Subtract row minima
For each row, the minimum element is subtracted from all elements in that row.
| 29 | 56 | 4 | 0 | (-7) |
| 0 | 7 | 19 | 42 | (-15) |
| 0 | 14 | 18 | 49 | (-36) |
| 28 | 16 | 17 | 0 | (-33) |
Subtract column minima
For each column, the minimum element is subtracted from all elements in that column.
| 29 | 49 | 0 | 0 |
| 0 | 0 | 15 | 42 |
| 0 | 7 | 14 | 49 |
| 28 | 9 | 13 | 0 |
| (-7) | (-4) | |
Cover all zeros with a minimum number of lines
A total of 4 lines are required to cover all zeros.
| 29 | 49 | 0 | 0 | x |
| 0 | 0 | 15 | 42 | x |
| 0 | 7 | 14 | 49 | x |
| 28 | 9 | 13 | 0 | 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.
| 36 | 63 | 11 | 7 |
| 15 | 22 | 34 | 57 |
| 36 | 50 | 54 | 85 |
| 61 | 49 | 50 | 33 |
The total minimum cost is 102.