I didn't make this, but there is a numpy implementation of this algorithm available through scikit-learn in sklearn/utils/linear_assignment_.py . I'm glad I found it, as it seems to be about 4 times faster than the munkres package from PyPI (on which it is based, and which is the python implementation that comes up the most on google).
Reference:
http://stackoverflow.com/questions/1398822/the-assignment-problem-a-numpy-function
GREAT
ReplyDeleteThe Munkres Hungarian Matching Algorithm, also known as the Hungarian Algorithm or Kuhn-Munkres Algorithm, is an optimization technique used to find the best one-to-one matching between two groups while minimizing the total assignment cost. In Python, it can be implemented using NumPy and the scipy.optimize.linear_sum_assignment() function. It uses a cost matrix in which rows represent workers and columns represent jobs, and each value indicates the cost of assigning a particular worker to a job.Numpy Course. The algorithm identifies the optimal combination with the minimum total cost. It is widely used in data science, job scheduling, resource allocation, image processing, object tracking, and machine learning
ReplyDelete