Блог пользователя jlcastrillon

Автор jlcastrillon, 13 лет назад, По-английски

Here is the problem Given a set of N points and some query points, What is the farthest point from the set to each of the query points. Here are a couple of questions: Is it the same time complexity when finding the nearest neighbor? Where can I find some theory about this?

If there is a better way (with the same or less time complexity) to solve this problem using a suitable amount of code please let me know...

  • Проголосовать: нравится
  • +17
  • Проголосовать: не нравится

»
13 лет назад, скрыть # |
Rev. 7  
Проголосовать: нравится 0 Проголосовать: не нравится

How about computing the convex hull for this as the farthest point will always lie on the convex hull.

Complexity O(nlogn + qh) = O(nlogn) (using graham scan) where h = no. of points on the convex hull ,and q = no. of queries

Edit: Worst Case complexity for the above is o(nq). But on the average it should be much faster.

  • »
    »
    13 лет назад, скрыть # ^ |
    Rev. 3  
    Проголосовать: нравится 0 Проголосовать: не нравится

    Convex Hull will only work for small polygons with many points inside, and for two dimensional space, for bigger dimensional space it is a real pain. What I am looking for is an O(q logn + n logn) or O(q sqrt(n) + n sqrt(n)) worst case complexity algorithm

»
13 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Will be there any difference when the distance is euclidean or manhattan?