Suppose in the 2D space we have an array of points, and each point has a weighting factor, which is a float value ranging from 0 to 1. Each point also has a coordinate in the 2D grid. The following pseduo-codes show the property of the point:
class Point
{
public:
float weightingFactor_; // [0,1].
float x_;
float y_;
}
Now my question is: given an array of points, how can we select the best point pair? The criterion for best point pair is: (1) both points should have large weighting factors; (2) the two points should be as far as possible spatially based on the Euclidean distance. For the time being, my solution is for each point pair calculate the following criterion:
Point1.weightingFactor_*Point2.weightingFactor*Distance(Point1, Point2)
Among all the point pair, then select the pair whose criterion value is the largest. I am not sure whether this is the best solution. Any ideas? Thanks.