Maximum Distance of 2 sets of points with a 2-factor approximation

193 Views Asked by At

given a set of n points , i take k points randomly. I need to compute in the most efficient way the maximum distance of the k points from the n points with a 2-approx factor (exploiting in some way the triangular inequality). A first idea I had was to use the Manhattan distance instead of the Euclidean Distance, but this does not reduce complexity as it is still O(n*k). What could be some ideas?

EDIT: what if i first compute the 2 farthest point in the k points and then calculate the distance of the 2 points from all the n points?

1

There are 1 best solutions below

0
On

enter image description here

Technically, if you are only looking for the points with maximum distance, you can build a polygon (convex hull) with the points, the maximum distance should be the ones in the border.

You can calculate convex hull in O(k.log(k))

https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.ConvexHull.html

After that, you need to just test points on the border.

This is the deterministic approach, you can apply heuristic, randomized search to do it faster but they are not guaranteed to provide the correct solution.

Here's a paper which discusses the topic with another algorithm: https://arxiv.org/ftp/arxiv/papers/1708/1708.02758.pdf