The gist is... we have two sets of points A and B. Set A and B have the same number of points n.
Formal Problem:
Construct a minimum cost complete bipartite matching between points in A and B. The cost of a matching (a, b) is the distance(a, b). Does there exist an algorithm faster than O(n^3)?
Notes:
- Every point a in A and point b in B is in a matching (a, b).
- Every point a in A or B is in exactly one matching.
- sum( distance(a, b) for every (a, b) matching ) is minimized.
Example:
- Point a (0,0)
- Point b (2,0)
- Point c (0,1)
- Point d (-2,2)
- Set Z {a, d}
- Set Y {b, c}
Solution:
Matching 1: (a, b) (d, c)
sum(distance(a, b), distance(d, c)) = 2 + sqrt(5) ~ 4.23
Matching 2: (a, c) (d, b)
sum(distance(a, c), distance(d, b)) = 1 + sqrt(20) ~ 5.47
Matching 1 (a, b) (d, c) is the min cost complete bipartite matching!