Solution
This is the cost matrix.
| 91 | 92 | 55 | 44 | 3 | 53 | 6 |
| 61 | 67 | 77 | 20 | 7 | 3 | 42 |
| 56 | 57 | 74 | 78 | 93 | 76 | 65 |
| 14 | 84 | 24 | 14 | 33 | 43 | 5 |
| 97 | 71 | 67 | 20 | 24 | 87 | 71 |
| 91 | 4 | 65 | 10 | 72 | 11 | 89 |
| 31 | 80 | 14 | 99 | 1 | 58 | 30 |
Subtract row minima
For each row, the minimum element is subtracted from all elements in that row.
| 88 | 89 | 52 | 41 | 0 | 50 | 3 | (-3) |
| 58 | 64 | 74 | 17 | 4 | 0 | 39 | (-3) |
| 0 | 1 | 18 | 22 | 37 | 20 | 9 | (-56) |
| 9 | 79 | 19 | 9 | 28 | 38 | 0 | (-5) |
| 77 | 51 | 47 | 0 | 4 | 67 | 51 | (-20) |
| 87 | 0 | 61 | 6 | 68 | 7 | 85 | (-4) |
| 30 | 79 | 13 | 98 | 0 | 57 | 29 | (-1) |
Subtract column minima
For each column, the minimum element is subtracted from all elements in that column.
| 88 | 89 | 39 | 41 | 0 | 50 | 3 |
| 58 | 64 | 61 | 17 | 4 | 0 | 39 |
| 0 | 1 | 5 | 22 | 37 | 20 | 9 |
| 9 | 79 | 6 | 9 | 28 | 38 | 0 |
| 77 | 51 | 34 | 0 | 4 | 67 | 51 |
| 87 | 0 | 48 | 6 | 68 | 7 | 85 |
| 30 | 79 | 0 | 98 | 0 | 57 | 29 |
| | (-13) | | | | |
Cover all zeros with a minimum number of lines
A total of 7 lines are required to cover all zeros.
| 88 | 89 | 39 | 41 | 0 | 50 | 3 | x |
| 58 | 64 | 61 | 17 | 4 | 0 | 39 | x |
| 0 | 1 | 5 | 22 | 37 | 20 | 9 | x |
| 9 | 79 | 6 | 9 | 28 | 38 | 0 | x |
| 77 | 51 | 34 | 0 | 4 | 67 | 51 | x |
| 87 | 0 | 48 | 6 | 68 | 7 | 85 | x |
| 30 | 79 | 0 | 98 | 0 | 57 | 29 | x |
The optimal assignment
Because there are 7 lines required, an optimal assignment exists among the zeros.
| 88 | 89 | 39 | 41 | 0 | 50 | 3 |
| 58 | 64 | 61 | 17 | 4 | 0 | 39 |
| 0 | 1 | 5 | 22 | 37 | 20 | 9 |
| 9 | 79 | 6 | 9 | 28 | 38 | 0 |
| 77 | 51 | 34 | 0 | 4 | 67 | 51 |
| 87 | 0 | 48 | 6 | 68 | 7 | 85 |
| 30 | 79 | 0 | 98 | 0 | 57 | 29 |
This corresponds to the following optimal assignment in the original cost matrix.
| 91 | 92 | 55 | 44 | 3 | 53 | 6 |
| 61 | 67 | 77 | 20 | 7 | 3 | 42 |
| 56 | 57 | 74 | 78 | 93 | 76 | 65 |
| 14 | 84 | 24 | 14 | 33 | 43 | 5 |
| 97 | 71 | 67 | 20 | 24 | 87 | 71 |
| 91 | 4 | 65 | 10 | 72 | 11 | 89 |
| 31 | 80 | 14 | 99 | 1 | 58 | 30 |
The total minimum cost is 105.