0
$\begingroup$

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.

$\endgroup$
7
  • 1
    $\begingroup$ What relationship to statistics, data visualization, etc, does this question have? $\endgroup$ Commented Aug 26, 2014 at 15:19
  • 1
    $\begingroup$ Without knowing more about your problem it is hard to know how to select the best, or what really constitutes the best, point pair. For example, You could just as easily use Point1.weightingFactor_+Point2.weightingFactor+Distance(Point1, Point2)... or square the Z scored distances prior to multiplying by the weighting factors, etc, etc, etc. $\endgroup$ Commented Aug 26, 2014 at 15:23
  • $\begingroup$ As a tool to think about your problem... imagine you had a pair of points with distance 2 and a pair of points with distance four. Given that one of the points in each pair has a weighting factor of .5, what weighting factor would the second point in the distance 2 pair need in order to be as "good" as the distance four pair? $\endgroup$ Commented Aug 26, 2014 at 15:24
  • $\begingroup$ The criteria in this question are not sufficiently quantitative or specific to allow for an objective answer: "have large weighting factors" is too vague. Assuming you want these factors to be as large as possible, it would appear you are trying to maximize three objectives simultaneously: each of the two factors, together with the distance. Somehow you will need to identify a way to make trade-offs among these objectives, as asked at stats.stackexchange.com/q/9358. Is this the kind of thing you are after? $\endgroup$
    – whuber
    Commented Aug 26, 2014 at 15:36
  • 1
    $\begingroup$ @whuber Thanks for your comments. The link is very helpful, and my problem is very similar to the problem in the link. I have to admit that I have vague knowledge about the effect of these three factors when it comes to the problem of selecting the best point pair. $\endgroup$
    – feelfree
    Commented Aug 26, 2014 at 16:28

0

Browse other questions tagged or ask your own question.