论文标题
用质心树快速近似搜索树在树上
Fast approximation of search trees on trees with centroid trees
论文作者
论文摘要
在树上的搜索树(STT)概括了基本的二进制搜索树(BST)数据结构:在STTS中,基础搜索空间是一个任意树,而在BST中,这是一条路径。可以计算出$ o(n^2)$ time [Knuth 1971]的给定查询分布的最佳bst $ n $,而Centroid BST提供了几乎完美的替代方案,可计算在$ O(N)$ TIME [MEHLHORN 1977]中。 相比之下,最佳的STT在多项式时间内不可计算,并且最快的常量符号算法以$ O(n^3)$时间运行[Berendsohn,Kozma 2022]。可以针对BST类似的STT定义质心树,并且已在广泛的算法应用中使用。在未加权的情况下(即,对于查询的均匀分布),可以以$ o(n)$时间计算质心树[Brodal等。 2001; Della Giustina等。 2019]。但是,这些算法不容易扩展到加权情况。此外,在未加权或加权病例中,以前尚无对质心树的近似保证。 在本文中,我们在一般,加权的环境中重新审视质心树,并解决了构建它们的算法复杂性及其近似质量的算法复杂性。为了构建加权质心树,我们给出了一个对输出敏感的$ O(n \ log H)\ subseteq o(n \ log n)$ time算法,其中$ h $是所得质心树的高度。如果权重是多项式复杂性,则运行时间为$ O(n \ log \ log n)$。在一般决策树的计算模型中,我们表明这些界限是最佳的。为了进行近似,我们证明了质心树的成本最多是最佳的两倍,并且在加权和未加权的情况下,这种保证是最好的。我们还在有限的树木和更通用的$α$ centroid树的近似值(近似值)上给出了近似值的紧密,细粒度的边界。
Search trees on trees (STTs) generalize the fundamental binary search tree (BST) data structure: in STTs the underlying search space is an arbitrary tree, whereas in BSTs it is a path. An optimal BST of size $n$ can be computed for a given distribution of queries in $O(n^2)$ time [Knuth 1971] and centroid BSTs provide a nearly-optimal alternative, computable in $O(n)$ time [Mehlhorn 1977]. By contrast, optimal STTs are not known to be computable in polynomial time, and the fastest constant-approximation algorithm runs in $O(n^3)$ time [Berendsohn, Kozma 2022]. Centroid trees can be defined for STTs analogously to BSTs, and they have been used in a wide range of algorithmic applications. In the unweighted case (i.e., for a uniform distribution of queries), a centroid tree can be computed in $O(n)$ time [Brodal et al. 2001; Della Giustina et al. 2019]. These algorithms, however, do not readily extend to the weighted case. Moreover, no approximation guarantees were previously known for centroid trees in either the unweighted or weighted cases. In this paper we revisit centroid trees in a general, weighted setting, and we settle both the algorithmic complexity of constructing them, and the quality of their approximation. For constructing a weighted centroid tree, we give an output-sensitive $O(n\log h)\subseteq O(n\log n)$ time algorithm, where $h$ is the height of the resulting centroid tree. If the weights are of polynomial complexity, the running time is $O(n\log\log n)$. We show these bounds to be optimal, in a general decision tree model of computation. For approximation, we prove that the cost of a centroid tree is at most twice the optimum, and this guarantee is best possible, both in the weighted and unweighted cases. We also give tight, fine-grained bounds on the approximation-ratio for bounded-degree trees and on the approximation-ratio of more general $α$-centroid trees.