Solution
This is the cost matrix.
53 | 81 | 63 | 33 |
6 | 81 | 89 | 55 |
2 | 98 | 58 | 60 |
64 | 90 | 91 | 94 |
Subtract row minima
For each row, the minimum element is subtracted from all elements in that row.
20 | 48 | 30 | 0 | (-33) |
0 | 75 | 83 | 49 | (-6) |
0 | 96 | 56 | 58 | (-2) |
0 | 26 | 27 | 30 | (-64) |
Subtract column minima
For each column, the minimum element is subtracted from all elements in that column.
20 | 22 | 3 | 0 |
0 | 49 | 56 | 49 |
0 | 70 | 29 | 58 |
0 | 0 | 0 | 30 |
| (-26) | (-27) | |
Cover all zeros with a minimum number of lines
A total of 3 lines are required to cover all zeros.
20 | 22 | 3 | 0 | x |
0 | 49 | 56 | 49 | |
0 | 70 | 29 | 58 | |
0 | 0 | 0 | 30 | x |
x | | | | |
Create additional zeros
The number of lines is smaller than 4. The smallest uncovered element is 29. We subtract this value from all uncovered elements and add it to all elements covered twice.
49 | 22 | 3 | 0 |
0 | 20 | 27 | 20 |
0 | 41 | 0 | 29 |
29 | 0 | 0 | 30 |
Cover all zeros with a minimum number of lines
A total of 4 lines are required to cover all zeros.
49 | 22 | 3 | 0 | x |
0 | 20 | 27 | 20 | x |
0 | 41 | 0 | 29 | x |
29 | 0 | 0 | 30 | x |
The optimal assignment
Because there are 4 lines required, an optimal assignment exists among the zeros.
49 | 22 | 3 | 0 |
0 | 20 | 27 | 20 |
0 | 41 | 0 | 29 |
29 | 0 | 0 | 30 |
This corresponds to the following optimal assignment in the original cost matrix.
53 | 81 | 63 | 33 |
6 | 81 | 89 | 55 |
2 | 98 | 58 | 60 |
64 | 90 | 91 | 94 |
The total minimum cost is 187.