There are two sets of points in 3-Dimensional space both contain n points. For example:
A={p1,p2,…pn} pi={pxi,pyi,pzi} (i from 1 to n)
B={q1,q2,…qn} qi={qxi,qyi,qzi} (i from 1 to n)
I want to find a match of points between A and B such that the sum of the distance between each pair of points has minimal value.
How to solve it in Mathematica?
Some days ago, I found the problem can be solved by Kuhn-Munkres algorithm. But it seems that there are no Built-in functions in Mathematica contain Kuhn-Munkres algorithm.
So I turn the problem into an equivalent problem which can be solved by DistanceMatrix and FindMinimumCostFlow.
It did work, but still too slow. So I try to find other ways.
Yesterday, I found Built-in functions: NearestNeighborGraph and Nearest.
If the points in A and B meet certain conditions than NearestNeighborGraph may give right answer in a very fast speed, but not always right or it need further processing.
So I wonder whether the problem can be solved in Mathematica in some clever ways? (Maybe use Nearest, NearestNeighborGraph or some other built-in functions)

