Solution
This is the cost matrix.
| 45 | 69 | 13 | 45 |
| 89 | 89 | 86 | 88 |
| 76 | 63 | 77 | 41 |
| 18 | 70 | 98 | 19 |
Subtract row minima
For each row, the minimum element is subtracted from all elements in that row.
| 32 | 56 | 0 | 32 | (-13) |
| 3 | 3 | 0 | 2 | (-86) |
| 35 | 22 | 36 | 0 | (-41) |
| 0 | 52 | 80 | 1 | (-18) |
Subtract column minima
For each column, the minimum element is subtracted from all elements in that column.
| 32 | 53 | 0 | 32 |
| 3 | 0 | 0 | 2 |
| 35 | 19 | 36 | 0 |
| 0 | 49 | 80 | 1 |
| (-3) | | |
Cover all zeros with a minimum number of lines
A total of 4 lines are required to cover all zeros.
| 32 | 53 | 0 | 32 | x |
| 3 | 0 | 0 | 2 | x |
| 35 | 19 | 36 | 0 | x |
| 0 | 49 | 80 | 1 | 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.
| 45 | 69 | 13 | 45 |
| 89 | 89 | 86 | 88 |
| 76 | 63 | 77 | 41 |
| 18 | 70 | 98 | 19 |
The total minimum cost is 161.