How to find the farthest point (from a set of points) from a given point efficiently?

橙三吉。 提交于 2021-02-07 06:00:22

问题


I'm looking for an algorithm or data structure to solve the following problem: You are given a set of points S. And you are given Q queries in form of another point. For every query, find the farthest point in the set from the given point.

There are at most 10^5 points in the set and 10^5 queries. All the coordinates for points are in range from 0 to 10^5.

I am wondering if there is a way to store the set of points such that we can answer the queries in O(log n) or O(log^2 n) if necessary.


回答1:


A quote from "Approximate Furthest Neighbor with Application to Annulus Query":

In two dimensions the furthest neighbor problem can be solved in linear space and logarithmic query time using point location in a furthest point Voronoi diagram (see, for example, de Berg et al. [5]).

where [5] refers to the "Marks textbook":

Berg, Mark de, Otfried Cheong, Marc van Kreveld, and Mark Overmars. Computational geometry: algorithms and applications. Springer-Verlag TELOS, 2008.


         
          Farthest-Neighbor Voronoi diagram for a set of eight points.
Image from Jacometti, Welson. "A Note on Primitives for the Manipulation of General Subdivisions and the Computation of Voronoi Diagrams." (1992).



来源:https://stackoverflow.com/questions/54153637/how-to-find-the-farthest-point-from-a-set-of-points-from-a-given-point-efficie

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!