Answers for "hungarian algorithm python"

0

hungarian algorithm python

>>> cost = np.array([[4, 1, 3], [2, 0, 5], [3, 2, 2]])
>>> from scipy.optimize import linear_sum_assignment
>>> row_ind, col_ind = linear_sum_assignment(cost)
>>> col_ind
array([1, 0, 2])
>>> cost[row_ind, col_ind].sum()
5
Posted by: Guest on November-23-2020

Python Answers by Framework

Browse Popular Code Answers by Language