hungarian algorithm python

Solutions on MaxInterview for hungarian algorithm python by the best coders in the world

showing results for - "hungarian algorithm python"
Liah
30 Jan 2019
1>>> cost = np.array([[4, 1, 3], [2, 0, 5], [3, 2, 2]])
2>>> from scipy.optimize import linear_sum_assignment
3>>> row_ind, col_ind = linear_sum_assignment(cost)
4>>> col_ind
5array([1, 0, 2])
6>>> cost[row_ind, col_ind].sum()
75
8