Given 2N-points in a 2D-plane, you have to group them into N pairs such that the overall sum of distances between the points of all of the pairs is the minimum possible value.The desired output is only the sum.
In other words, if a1,a2,..an are the distances between points of first, second...and nth pair respectively, then (a1+a2+...an) should be minimum.
Let us consider this test-case, if the 2*5 points are : {20,20}, {40, 20}, {10, 10}, {2, 2}, {240, 6}, {12, 12}, {100, 120}, {6, 48}, {12, 18}, {0, 0}
The desired output is 237.
This is not my homework,I am inquisitive about different approaches rather than brute-force.