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.
Using (a,b)-trees as an example, we show how to perform a parallel split with logarithmic latency and parallel join, bulk updates, intersection, union (or merge), and (symmetric) set difference with logarithmic latency and with information theoretically optimal work. We present both asymptotically optimal solutions and simplified versions that perform well in practice - they are several times faster than previous implementations.
The wavelet tree (Grossi et al. [SODA, 2003]) and wavelet matrix (Claude et al. [Inf. Syst., 47:15--32, 2015]) are compact indices for texts over an alphabet $[0,σ)$ that support rank, select and access queries in $O(\lg σ)$ time. We first present new practical sequential and parallel algorithms for wavelet tree construction. Their unifying characteristics is that they construct the wavelet tree bottomup}, i.e., they compute the last level first. We also show that this bottom-up construction can easily be adapted to wavelet matrices. In practice, our best sequential algorithm is up to twice as…
We suggest a new non-recursive algorithm for constructing a binary search tree given an array of numbers. The algorithm has $O(N)$ time and $O(1)$ memory complexity if the given array of $N$ numbers is sorted. The resulting tree is of minimal height and can be transformed to a complete binary search tree (retaining minimal height) with $O(\log N)$ time and $O(1)$ memory. The algorithm allows simple and effective parallelization.
Cartesian tree matching is the problem of finding all substrings in a given text which have the same Cartesian trees as that of a given pattern. In this paper, we deal with Cartesian tree matching for the case of multiple patterns. We present two fingerprinting methods, i.e., the parent-distance encoding and the binary encoding. By combining an efficient fingerprinting method and a conventional multiple string matching algorithm, we can efficiently solve multiple pattern Cartesian tree matching. We propose three practical algorithms for multiple pattern Cartesian tree matching based on the Wu-…
Navarro and Sadakane [TALG 2014] gave a dynamic succinct data structure for storing an ordinal tree. The structure supports tree queries in either $O(\log n/\log\log n)$ or $O(\log n)$ time, and insertion or deletion of a single node in $O(\log n)$ time. In this paper we improve the result of Navarro and Sadakane by reducing the time complexities of some queries (e.g.\ degree and level\_ancestor) from $O(\log n)$ to $O(\log n/\log\log n)$.
random_tree() is a linear time and space C++ implementation able to create trees of up to a billion nodes for genetic programming and genetic improvement experiments. A 3.60GHz CPU can generate more than 18 million random nodes for GP program trees per second.
Cartesian tree matching is the problem of finding all substrings of a given text which have the same Cartesian trees as that of a given pattern. So far there is one linear-time solution for Cartesian tree matching, which is based on the KMP algorithm. We improve the running time of the previous solution by introducing new representations. We present the framework of a binary filtration method and an efficient verification technique for Cartesian tree matching. Any exact string matching algorithm can be used as a filtration for Cartesian tree matching on our framework. We also present a SIMD so…
Let $G = (V, E)$ be an undirected connected simple graph on $n$ vertices. A cut-equivalent tree of $G$ is an edge-weighted tree on the same vertex set $V$, such that for any pair of vertices $s, t\in V$, the minimum $(s, t)$-cut in the tree is also a minimum $(s, t)$-cut in $G$, and these two cuts have the same cut value. In a recent paper [Abboud, Krauthgamer and Trabelsi, 2021], the authors propose the first subcubic time algorithm for constructing a cut-equivalent tree. More specifically, their algorithm has $\widetilde{O}(n^{2.5})$ running time. In this paper, we improve the running time t…
Tree edit distance is a well-studied measure of dissimilarity between rooted trees with node labels. It can be computed in $O(n^3)$ time [Demaine, Mozes, Rossman, and Weimann, ICALP 2007], and fine-grained hardness results suggest that the weighted version of this problem cannot be solved in truly subcubic time unless the APSP conjecture is false [Bringmann, Gawrychowski, Mozes, and Weimann, SODA 2018]. We consider the unweighted version of tree edit distance, where every insertion, deletion, or relabeling operation has unit cost. Given a parameter $k$ as an upper bound on the distance, the pr…
We develop fast approximation algorithms for the minimum-cost version of the Bounded-Degree MST problem (BD-MST) and its generalization the Crossing Spanning Tree problem (Crossing-ST). We solve the underlying LP to within a $(1+ε)$ approximation factor in near-linear time via the multiplicative weight update (MWU) technique. This yields, in particular, a near-linear time algorithm that outputs an estimate $B$ such that $B \le B^* \le \lceil (1+ε)B \rceil +1$ where $B^*$ is the minimum-degree of a spanning tree of a given graph. To round the fractional solution, in our main technical contribut…
We present a new fast all-pairs shortest path algorithm for unweighted graphs. In breadth-first search which is said to representative and fast in unweighted graphs, the average number of accesses to adjacent vertices (expressed by α) is about equal to the average degree of the graph. On the other hand, our algorithm utilizes the shortest path trees of adjacent vertices of each source vertex, and reduce α drastically. Roughly speaking α is reduced to the value close to 1, because the average degree of a tree is about 2, and one is used to come in and the other is used to go out, although that …
Treewidth is a measure of how tree-like a graph is. It has many important algorithmic applications because many NP-hard problems on general graphs become tractable when restricted to graphs of bounded treewidth. Algorithms for problems on graphs of bounded treewidth mostly are dynamic programming algorithms using the structure of a tree decomposition of the graph. The bottleneck in the worst-case run time of these algorithms often is the computations for the so called join nodes in the associated nice tree decomposition. In this paper, we review two different approaches that have appeared in t…
Fast Algorithms for Constructing Maximum Entropy Summary Trees
卡洛夫Shirley最近提出了摘要树作为一种新的方法来可视化大根树(Eurovis 2013),并给出了用于生成输入n节点根树的最大熵k节点摘要树的算法。然而,生成最优汇总树的算法只是伪多项式(并且仅适用于整数权重);作者留下了多项式时间算法的开放存在性。此外,作者还提供了一个加性近似算法和贪婪启发式,都工作在真正的权重。本文展示了如何在O(k^2 n + n log n)的时间内构造实权重的最大熵k节点汇总树(实际上,与前面给出的贪婪启发式的时间界一样小);如何加速近似算法,使其在O(n +(k^4/eps?)log(k/eps?)),以及如何加速贪心算法,使其时间复杂度为O(kn + nlogn)。总之,这些结果使摘要树成为比以前更实用的工具。
We consider online algorithms for the $k$-server problem on trees. There is a $k$-competitive algorithm for this problem, and it is the best competitive ratio. M. Chrobak and L. Larmore provided it. At the same time, the existing implementation has $O(n)$ time complexity for processing a query and $O(n)$ for prepossessing, where $n$ is the number of nodes in a tree. Another implementation of the algorithm has $O(k^2+k\log n)$ time complexity for processing a query and $O(n\log n)$ for prepossessing. We provide a new time-efficient implementation of the algorithm. It has $O(n)$ time complexity …
Fast Evaluation of Interlace Polynomials on Graphs of Bounded Treewidth
我们考虑由Courcelle(2008)引入的多元交错多项式,其推广了由Arratia,Bollobas和Sorkin(2004)以及Aigner和van der Holst(2004)定义的几个交错多项式。本文给出了一个算法,在给定宽度为k的图的树分解的情况下,计算n个顶点的图的多元交错多项式。先前已知的最佳结果(Courcelle 2008)采用了一般的逻辑框架,并导致了运行时间为f(k)*n的算法,其中f(k)在k中是双指数的。在树分解的背景下,分析邻接矩阵的GF(2)-秩,给出了一个更快更直接的算法。我们的算法使用2^{3k^2+O(k)}*n个算术运算,可以有效地并行实现。
In this paper, we introduce a new representation for ordered trees, the weight sequence representation. We then use this to construct new representations for both rooted trees and free trees, namely the canonical weight sequence representation. We construct algorithms for generating the weight sequence representations for all rooted and free trees of order n, and then add a number of modifications to improve the efficiency of the algorithms. Python implementations of the algorithms incorporate further improvements by using generators to avoid having to store the long lists of trees returned by…
Graduate School of Information Science and Technology, The University of Tokyo(东京大学信息科学与技术研究生院)
核方法是分析结构化数据(如序列、树和图)的一种潜在方法,然而,无序树尚未得到广泛研究。Kimura et al.(2011)提出了一种基于子路径的无序树的核函数,子路径是树的垂直子结构,负责其中的层次信息。他们的内核在精度和速度方面表现出实际上很好的性能;然而,线性时间计算在理论上不能保证,不像Vishwanathan和Smola(2003)提出的其他无序树内核。在本文中,我们提出了一个理论上保证线性时间内核计算算法,实际上是快速的,我们提出了一个有效的预测算法,其运行时间只取决于输入树的大小。实验结果表明,本文提出的算法在实际应用中是非常有效的.
Maintaining an archive of all non-dominated points is a standard task in multi-objective optimization. Sometimes it is sufficient to store all evaluated points and to obtain the non-dominated subset in a post-processing step. Alternatively the non-dominated set can be updated on the fly. While keeping track of many non-dominated points efficiently is easy for two objectives, we propose an efficient algorithm based on a binary space partitioning (BSP) tree for the general case of three or more objectives. Our analysis and our empirical results demonstrate the superiority of the method over the …
Evolutionary scenarios displaying reticulation events are often represented by rooted phylogenetic networks. Due to biological reasons, those events occur very rarely, and, thus, networks containing a minimum number of such events, so-called minimum hybridization networks, are of particular interest for research. Moreover, to study reticulate evolution, biologist need not only a subset but all of those networks. To achieve this goal, the less complex concept of rooted phylogenetic trees can be used as building block. Here, as a first important step, the trees are disjoint into common parts, so…
We revisit the \textsc{$k$-Secluded Tree} problem. Given a vertex-weighted undirected graph $G$, its objective is to find a maximum-weight induced subtree $T$ whose open neighborhood has size at most $k$. We present a fixed-parameter tractable algorithm that solves the problem in time $2^{\mathcal{O}(k \log k)}\cdot n^{\mathcal{O}(1)}$, improving on a double-exponential running time from earlier work by Golovach, Heggernes, Lima, and Montealegre. Starting from a single vertex, our algorithm grows a $k$-secluded tree by branching on vertices in the open neighborhood of the current tree $T$. To …
The need for scalable concurrent ordered set data structures with linearizable range query support is increasing due to the rise of multicore computers, data processing platforms and in-memory databases. This paper presents a new concurrent ordered set with linearizable range query support. The new data structure is based on the contention adapting search tree and an immutable data structure. Experimental results show that the new data structure is as much as three times faster compared to related data structures. The data structure scales well due to its ability to adapt the sizes of its immu…