CS Paper Radar

Dynamically optimal weight-balanced binary search trees

John Iacono, Akash Pareek

cs.DS ·submitted 2026-10-21 11:16 UTC · v1

Abstract

In STOC 1972, J{ü}rg Nievergelt and Edward M.~Reingold introduced the $BB[α]$-tree, also known as a \emph{weight-balanced} tree, which for any $α\in (0,\frac{1}{2}]$ is a binary search tree where every node with induced subtree size $s$ has children with induced subtree sizes at least $α(s+1)-1$. A new rotation-based binary search tree, the \emph{PopTree}, is introduced. The PopTree stores $n$ elements and is a $BB[\tfrac1{20}]$-tree after the execution of each search and a $BB[\tfrac1{729}]$-tree at all times, notably while rebalancing. For any constant $α$, its performance on search sequences of length $Ω(n \log n)$ is proved to be within a constant factor (which can depend on $α$) of the optimal offline rotation-based binary search tree that maintains the $BB[α]$ balance invariant.

Closest papers

Nearest neighbours by meaning across the whole index.

A Binary Search Tree with the Unified Bound

cs.DS ·2026-11-12 ·Yang Cao, Haoran Qi, Hanzhi Wang
theory similarity 0.71
Abstract

We give a deterministic online binary search tree (BST) that satisfies the unified bound of Iacono [SODA 2001], which subsumes the working-set and dynamic-finger bounds: it serves every sequence $X$ of $m$ searches on $n$ keys at total cost $O(m+\mathrm{UB}(X))$, and every single search at cost $O(\log n)$. Previously, no BST was known to satisfy the unified bound, even offline. As a consequence, the dynamic optimality conjecture implies Iacono's conjecture that splay trees satisfy the unified bound. We also show that the unified bound is $O((m+n)(1+\log c_σ))$ on every sequence of searches that avoids a fixed permutation $σ$, where $c_σ$ is the Füredi-Hajnal limit of $σ$. Hence every BST that satisfies the unified bound, including ours, serves such sequences at this cost. For permutations this bound is tight, and it improves the previous upper bound $O(nc_σ^2)$ on the optimal cost, due to Berendsohn, Kozma and Opler [STOC 2024]. Finally, we extend the tree to support insertions and deletions: a sequence $X$ of $m$ operations, starting from $n_0$ keys, costs $O(n_0+m+\mathrm{UB}(X))$ in total, where $\mathrm{UB}$ is now the extension of the unified bound to insertions and deletions by Bădoiu, Cole, Demaine and Iacono [TCS 2007]. Hence, if splay trees are dynamically optimal for searches, insertions and deletions, then they serve every such sequence at this total cost as well.

0.24

Optimal Pattern-Avoidance Bounds for Binary Search Trees

cs.DS ·2026-11-15 ·Anita Dürr, Arturo Merino, Karol Węgrzycki, Sorrachai Yingchareonthawornchai
theorycode/datahot direction similarity 0.66
Abstract · 37 pages. Submitted to STOC 2027. Publicly available at https://github.com/sigact-stoc/stoc2027/releases/download/papers-2/906.pdf

Self-adjusting binary search trees (BSTs) perform better than balanced BSTs if the access sequence has additional structure. For example, splay trees serve a sequential access sequence in linear time. Pattern avoidance captures regularity in an access sequence and unifies several classic examples of efficient BST access, such as deque and traversal sequences. A central question is how well a BST algorithm can exploit a pattern-avoiding access sequence. We present an online BST algorithm that serves an access sequence avoiding a permutation pattern $π$ in linear time, matching the information-theoretic lower bound. The algorithm does not need to know that pattern $π$ a priori. Our results answer an open problem asked by [Kozma 2016, Problem 44, strong variant]. Previously, the best known offline bound was optimal only for constant-size patterns [Berendsohn, Kozma, and Opler, STOC'24], and the best known online bound was superlinear [Chalermsook, Pettie, Yingchareonthawornchai, SODA'24] even for a constant-size pattern. As a corollary, our BST algorithm yields an optimal sorting algorithm for a pattern-avoiding sequence that supports online insertions. Previously, an optimal sorting algorithm was achieved using a mergesort-like approach [Opler, FOCS'24] in a batch setting. A key technique is to apply recursive split decomposition [Chalermsook, Chuzhoy, Saranurak, ToC'23] jointly in time and space, along with the Marcus-Tardos proof of the Stanley-Wilf conjecture. We show that the framework can be implemented online using $k$-finger BSTs, which is of independent interest. Finally, this framework also yields a constant-factor-approximation FPT algorithm in the offline setting.

0.41

A Refined Analysis of the Sequential Access Theorem for Splay Trees

cs.DS ·2026-09-17 ·Naonori Kakimura, Yoshihiko Terai
theory similarity 0.63
Abstract

A splay tree is a self-adjusting binary search tree that allows access, insertion, and deletion to be performed in amortized $O(\log n)$ time, where $n$ is the number of stored elements. The sequential access theorem states that, when the elements of a splay tree are accessed in increasing order, the amortized cost per operation becomes a constant. In this paper, we show that the upper bound for this constant is at most $5.5$ by refining the existing analysis and introducing a new potential function. Furthermore, we complement our result by showing that there exists a splay tree for which the constant is lower-bounded by almost $4$.

0.31

A Sublogarithmic Competitive Algorithm for Online Graph Exploration

cs.DS ·2026-11-10 ·Max Klimm
similarity 0.62
Abstract

In online graph exploration, an agent must visit every vertex of an unknown weighted graph and return to its start, learning the incident edges at each vertex it visits. On $n$-vertex graphs, the best known competitive ratio has been $O(\log n)$, achieved by several algorithms, among them the hierarchical depth-first search of Megow, Mehlhorn, and Schweitzer. We give an algorithm with competitive ratio ${(2+o(1))}\ln n/\ln\ln n$ for known~$n$. Like hierarchical depth-first search, it groups the edges into geometric weight classes and searches depth-first between components of lighter edges. Unlike it, the agent tours each component along a minimum spanning tree for the original weights, so only crossings between components pay for rounding, and the base $b$ of the weight class can grow with~$n$. The leading constant $2$ is tight for our choice of base. Without knowing $n$, restarts with increasing size guesses give upper bounds with leading constant $4$ for a fixed schedule and $2$ in expectation for a randomly shifted schedule. If the weights lie in a known range $[1,2^k]$ with $k\ge4$, choosing $b=k/\log_2 k$ gives a competitive ratio of $O(k/\log k)$ without knowing $n$.

0.26

Optimal (Parallel) Spooky Pebbling on Binary Trees

cs.CC ·2026-10-07 ·Mingyu Lee, Sanghyun Lee, Kabgyun Jeong
similarity 0.60
Abstract · 21 pages, 1 figure

Pebble games model computations under a fixed space budget. Spooky pebbling allows quantum memory to be released by measurement, with the resulting phases corrected later. We study two-input computations with binary-tree dependencies and determine the optimal work and parallel depth for complete binary trees. Our key idea is to clean up the tree in blocks, reducing repeated recomputation of intermediate values. For the complete tree $B_h$ with $n=2^h-1$ vertices and every space budget $h+1\le s\le n$, we give an algorithm with asymptotically optimal work $Θ(nh/\log(s+1))$. At the minimum budget $s=h+1$, this improves the $O(n\log n)$ bound of Kornerup, Sadun, and Soloveichik to $Θ(n\log n/\log\log n)$, resolving their time-optimality question. We also construct a parallel schedule with optimal depth \[ Θ\!\left(h+\frac ns \max\!\left\{\frac{h}{\log(s+1)},\,1+\log^*h\right\}\right). \] Our lower bounds hold for every full binary tree. We also show that achieving optimal parallel depth can require asymptotically more work than minimizing work alone. Applying our schedule to the RNS point-addition trees in the public implementation of Chevignard, Fouque, and Schrottenloher reduces their Toffoli/AND gate count by $20.86\%$ for a P-224 instance and $22.66\%$ for a P-256 instance, using the same arithmetic circuits and peak workspace.

0.41

Dynamic Edge Orientation via Random Walks: From Trees to Outerplanar Graphs and Beyond

cs.DS ·2026-08-25 ·Gabriel Marques Domingues, Minh Hang Nguyen, Shay Solomon
theory similarity 0.60
Abstract · Abstract truncated to fit arXiv limits

We study the \emph{fully dynamic edge orientation problem}, focusing on \emph{worst-case} time bounds. An undirected graph undergoes edge insertions and deletions, and the goal is to maintain an orientation with small {\em maximum outdegree} (hereafter, outdegree) and small worst-case update time. The outdegree of any orientation is at least $α-1$, where $α$ is the graph's \emph{arboricity}, i.e., the minimum number of forests into which its edge set can be partitioned. When $α= O(1)$, it is long known that both the outdegree and the worst-case update time can be bounded by $O(\log n)$. Despite numerous follow-ups, no $o(\log^3 n)$ worst-case update time is known for maintaining constant outdegree, even for very basic graph families---with a notable exception, \emph{forests}. For forests, a \emph{simple folklore} algorithm maintains outdegree 2 via \emph{random walks}: When an insertion creates a vertex of outdegree 3, the algorithm repeatedly chooses a uniformly random outgoing edge until reaching a vertex of outdegree at most 1, and then flips the resulting directed path. As the underlying graph is cycle-free, the path length is easily shown to be $O(\log n)$ in expectation, and also with high probability for polynomially long update sequences. We prove that this simple random walk paradigm extends to \emph{outerplanar graphs}. Our algorithm maintains constant outdegree with $O(\log n)$ worst-case update time, where the time bound holds in expectation, and also with high probability for polynomially long update sequences. We give a \emph{tight analysis}: outdegree 4 is achievable with $O(\log n)$-length paths, while outdegree 3 incurs $\mathtt{poly}(n)$-length paths. We also extend the argument to $K_{2,t}$-minor-free graphs, for any $t \ge 2$, with the outdegree bound depending only on $t$ and with the same update time guarantees. The locality of [...]

0.27

Tree Edit Distance: Near-Linear-Time Approximate, Sublinear, and Dynamic

cs.DS ·2026-10-15 ·Bingbing Hu, Tomasz Kociumaka, Jakob Nogler, Barna Saha
published similarity 0.60
Abstract · SODA 2027

Tree edit distance (TED), the analog of string edit distance (ED) for hierarchical data, is the minimum number of node insertions, deletions, and substitutions transforming one labeled rooted ordered tree into another. We narrow polynomial gaps between TED and ED in near-linear-time approximation, sublinear algorithms, and dynamic algorithms. We give an $n^{o(1)}$-approximation in $O(n)$ time and, for every $0<δ<1$, a $(\log n)^{O(1/δ)}$-approximation in $O(n^{1+δ})$ time. This improves the previous near-linear-time $O(\sqrt n)$-approximation [Boroujeni et al., STOC'19] and brings TED to parity with ED in this regime up to polylogarithmic factors. With query access to the balanced-parentheses (Euler-tour) representation of the input trees, we give the first sublinear-time TED algorithm: for every $τ\in[1,n]$, it computes a $τn^{o(1)}$-approximation of $1+\mathrm{ted}$ in $O(n/τ)$ time. For dynamic TED, we give an exact algorithm with amortized update time $\tilde{O}(k^7)$ and a $(1+\varepsilon)$-approximation with amortized update time $\tilde{O}_{\varepsilon}(k)$, where $k$ caps the distance that must be reported. The exact algorithm is the first to beat recomputation in a nontrivial parameter regime. The approximation improves prior dynamic guarantees [Das et al., FOCS'25] and cannot be significantly improved in any parameter regime without a breakthrough for static $(1+\varepsilon)$-approximation of ED. All results use dynamic programming on a new hierarchical tree decomposition, analogous to partitioning strings into blocks of geometrically decreasing sizes. It combines structural properties previously achieved only in isolation, providing a framework for transferring algorithmic ideas from ED to TED, with additional ingredients addressing the obstacles in each computational setting.

0.34

Strong NP-Completeness of Unrestricted Balanced Mobiles

cs.CC ·2026-09-21 ·Andrei Popa, Alexandru Popa
similarity 0.60
Abstract

A mobile is a rooted full binary tree whose leaves carry positive integer weights. The imbalance of an internal node is the absolute difference between the total weights of its two child subtrees, and the cost of the mobile is the sum of these imbalances. In the unrestricted \emph{Balanced Mobiles} problem, only the multiset of leaf weights is given: both the tree topology and the placement of the weights must be chosen so as to minimize the cost. The computational complexity of this unrestricted variant has remained open, although the variant with a prescribed topology is strongly NP-hard. We close this gap by proving that the decision version of unrestricted Balanced Mobiles is strongly NP-complete. Our reduction from Numerical 3-Dimensional Matching with Distinct Integers uses three widely separated numerical scales. Tight telescoping bounds force every threshold-achieving mobile into a canonical hierarchy, after which pairwise distinctness of the source integers collapses the hierarchy to single triples from which a valid numerical matching can be recovered.

0.30