-
Notifications
You must be signed in to change notification settings - Fork 87
Description
According to the kuhn_munkres docs, the maximum weight matching has the restriction, between two disjoint sets. With respect to maximum weight matching, this is a special case of the assignment problem:
A special case of it is the assignment problem, in which the input is restricted to be a bipartite graph, and the matching constrained to be have cardinality that of the smaller of the two partitions.
The hungarian algorithm has a complexity of
Essentially, you can think of the vertices on the left side of a bipartite graph as agents, and the vertices on the right side are tasks. Then, you hold an auction where agents bid for tasks, and then you assign the winners to their desired task.
Note, this is not an exact algorithm for the assignment problem, whereas the hungarian algorithm will always provide an optimal solution.
With that being said, running an auction can lead to various pathological scenarios (e.g., bidding wars). The solution this algorithm utilizes is making each round of the auction increment prices by some value,
Why does this matter? Well, if you set
The input to this function is a cost (i.e., weight) matrix -- the Matrix included in pathfinding is perfect).
The function returns either a HashMap or a Vec of the assignments.
If this is of interest, I can create a PR with preliminary benchmarks and tests for correctness (against the current solver).