简体   繁体   English

为nlogn算法提供下限

[英]FInding a lower bound for a nlogn algorithm

The original problem was discussed in here: Algorithm to find special point k in O(n log n) time 这里讨论了原始问题: 在O(n log n)时间内找到特殊点k的算法

Simply we have an algorithm that finds whether a set of points in the plane has a center of symmetry or not. 简单地说,我们有一个算法可以找出平面中的一组点是否具有对称中心。

I wonder is there a way to prove a lower bound (nlogn) to this algorithm? 我想知道有没有办法证明这个算法的下界(nlogn)? I guess we need to use this algorithm to solve a simplier problem, such as sorting, element uniqueness, or set uniqueness, therefore we can conclude that if we can solve eg element uniqueness by using this algorithm, it can be at least nlogn. 我想我们需要使用这个算法来解决一个简单的问题,例如排序,元素唯一性或集唯一性,因此我们可以得出结论,如果我们可以通过使用这个算法来解决例如元素唯一性,那么它至少可以是nlogn。

It seems like the solution is something to do with element uniqueness, but i couldn't figure out a way to manipulate this into center of symmetry algorithm. 似乎解决方案与元素唯一性有关,但我无法想出一种方法将其操纵到对称算法的中心。

Check this paper 检查这篇论文

The idea is if we can reduce problem A to problem B, then B is no harder than A. 我们的想法是,如果我们可以将问题A减少到问题B,那么B就不比A更难。

That said, if problem B has lower bound Ω(nlogn), then problem A is guaranteed the same lower bound. 也就是说,如果问题B具有下限Ω(nlogn),那么问题A保证具有相同的下限。

In the paper, the author picked the following relatively approachable problem to be B: given two sets of n real numbers, we wish to decide whether or not they are identical. 在论文中,作者选择了以下相对平易近人的问题为B:给定两组n个实数,我们希望决定它们是否相同。

It's obvious that this introduced problem has lower bound Ω(nlogn). 很明显,这个引入的问题具有下限Ω(nlogn)。 Here's how the author reduced our problem at hand to the introduced problem (A, B denote the two real sets in the following context): 以下是作者如何将我们的问题简化为引入的问题(A,B表示以下上下文中的两个实际集合):

在此输入图像描述

First observe that that your magical point k must be in the center. 首先要注意你的魔法点k必须在中心。

  • build a lookup data structure indexed by vector position (O(nlog n)) 构建一个由向量​​位置索引的查找数据结构(O(nlog n))
  • calculate the centroid of the set of points (O(n)) 计算点集的质心(O(n))
  • for each point, calculate the vector position of its opposite and check for its existence in the lookup structure (O(log n) * n) 对于每个点,计算其相反的向量位置并检查其在查找结构中的存在(O(log n)* n)

Appropriate lookup data structures can include basically anything that allows you to look something up efficiently by content, including balanced trees, oct-trees, hash tables, etc. 适当的查找数据结构基本上可以包含允许您通过内容高效查找内容的任何内容,包括平衡树,八叉树,哈希表等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM