Yao graphs are geometric spanners that connect each point of a given point set to its nearest neighbor in each of $k$ cones drawn around it. Yao graphs were introduced to construct minimum spanning trees in $d$ dimensional spaces. Moreover, they are used for instance in topology control in wireless networks. An optimal \Onlogn time algorithm to construct Yao graphs for given point set has been proposed in the literature but -- to the best of our knowledge -- never been implemented. Instead, algorithms with a quadratic complexity are used in popular packages to construct these graphs. In this paper we present the first implementation of the optimal Yao graph algorithm. We develop and tune the data structures required to achieve the O(n log n) bound and detail algorithmic adaptions necessary to take the original algorithm from theory to practice. We propose a priority queue data structure that separates static and dynamic events and might be of independent interest for other sweepline algorithms. Additionally, we propose a new Yao graph algorithm based on a uniform grid data structure that performs well for medium-sized inputs. We evaluate our implementations on a wide variety synthetic and real-world datasets and show that our implementation outperforms current publicly available implementations by at least an order of magnitude.
翻译:Yao图是一种几何支撑图,它将给定点集中的每个点连接到以其为中心绘制的$k$个锥形区域中的最近邻点。Yao图最初被引入用于在$d$维空间中构造最小生成树。此外,它们还应用于无线网络中的拓扑控制等领域。文献中已提出一种最优的\Onlogn时间复杂度的Yao图构造算法,但据我们所知,该算法从未被实现过。相反,主流软件包中通常使用二次复杂度的算法来构造此类图。本文首次实现了最优Yao图算法。我们开发并优化了实现$O(n \log n)$时间复杂度所需的数据结构,并详细描述了将原始算法从理论转化为实践所需的关键性调整。我们提出了一种将静态事件与动态事件分离的优先队列数据结构,该结构可能对其他扫描线算法具有独立的研究价值。此外,我们还提出了一种基于均匀网格数据结构的新Yao图算法,该算法在处理中等规模输入时表现良好。我们在多种合成数据集和真实世界数据集上评估了我们的实现,结果表明,我们的实现性能比当前公开可用的实现至少高出一个数量级。