Sleator and Tarjan [JACM, 1985] conjectured that splay trees are dynamically optimal – that on every access sequence, they perform within a constant factor of the optimal offline dynamic binary search tree. Despite four decades of work, no o(log n) competitive ratio was known. We prove that splay trees are O(loglog n ·log^2loglog n)=Õ(loglog n)-competitive.
The pairing heap is a "self-adjusting" implementation of a heap (priority queue) that is widely used in practice because it is simple and efficient. We introduce and analyze a simplified version of the pairing heap that we call the pure pairing heap. Our innovation is to eliminate the assembly pass during delete-min operations. We obtain the following amortized time bounds for operations on pure pairing heaps: $O(\log n)$ time per delete-min, $O(\log\log n \cdot \log\log\log n)$ time per decrease-key operation, and $O(1)$ time for each insert or meld. These bounds match those recently obtained for a more complicated version of pairing heaps, the multipass pairing heap}. These bounds also match the known lower bounds for self-adjusting heaps, except for the decrease-key bound, which is within a factor of $\log\log\log n$ of the lower bound. The main novelty in our analysis is to partition heap items into groups and to analyze each group separately. Our analysis extends to give the same bounds for lazy pairing heaps, a multitree version of pairing heaps.
This paper proves that a wide class of local search algorithms extend as is to the fully dynamic setting with an adaptive adversary, achieving an amortized Õ(1) number of local-search steps per update. A breakthrough by Moser (2009) introduced the witness-tree and entropy compression techniques for analyzing local resampling processes for the Lovász Local Lemma. These methods have since been generalized and expanded to analyze a wide variety of local search algorithms that can efficiently find solutions to many important local constraint satisfaction problems. These algorithms either extend a partial valid assignment and backtrack by unassigning variables when constraints become violated, or they iteratively fix violated constraints by resampling their variables. These local resampling or backtracking procedures are incredibly flexible, practical, and simple to specify and implement. Yet, they can be shown to be extremely efficient on static instances, typically performing only (sub)-linear number of fixing steps. The main technical challenge lies in proving conditions that guarantee such rapid convergence. This paper extends these convergence results to fully dynamic settings, where an adaptive adversary may add or remove constraints. We prove that applying the same simple local search procedures to fix old or newly introduced violations leads to a total number of resampling steps near-linear in the number of adversarial updates. Our result is very general and yields several immediate corollaries. For example, letting Δ denote the maximum degree, for a constant ε and Δ= poly(log n), we can maintain a (1+ε) Δ-edge coloring in poly(log n) amortized update time against an adaptive adversary. The prior work for this regime has exponential running time in √(log n) [Christiansen, SODA '26].
We construct a heap with strong beyond-worst-case performance guarantees and explore the analysis of such heaps. First, we unify existing notions of the working-set bound for heaps by proving that essentially all of them are equivalent - with the notable exception of the so-called stack-like bound, which is strictly stronger. This equivalence simplifies the theoretical landscape and extends the range of applications of heaps with working-set bounds. Second, we present the first heap implementation that has the amortized stack-like bound and supports $\mathcal O(1)$-time decrease-key and $o(\log^*n)$-time insert.
We consider the problem of sorting n items, given the outcomes of m pre-existing comparisons. We present a simple and natural deterministic algorithm that runs in O(m + log T) time and does O(log T) comparisons, where T is the number of total orders consistent with the pre-existing comparisons. Our running time and comparison bounds are best possible up to constant factors, thus resolving a problem that has been studied intensely since 1976 (Fredman, Theoretical Computer Science). The best previous algorithm with a bound of O(log T) on the number of comparisons has a time bound of O(n^2.5) and is more complicated. Our algorithm combines three classic algorithms: topological sort, heapsort with the right kind of heap, and efficient search in a sorted list. It outputs the items in sorted order one by one. It can be modified to stop early, thereby solving the important and more general top-k sorting problem: Given k and the outcomes of some pre-existing comparisons, output the smallest k items in sorted order. The modified algorithm solves the top-k sorting problem in minimum time and comparisons, to within constant factors.
We define simple variants of zip trees, called zip-zip trees, which provide several advantages over zip trees, including overcoming a bias that favors smaller keys over larger ones. We analyze zip-zip trees theoretically and empirically, showing, e.g., that the expected depth of a node in an $n$-node zip-zip tree is at most $1.3863\log n-1+o(1)$, which matches the expected depth of treaps and binary search trees built by uniformly random insertions. Unlike these other data structures, however, zip-zip trees achieve their bounds using only $O(\log\log n)$ bits of metadata per node, w.h.p., as compared to the $\Theta(\log n)$ bits per node required by treaps. In fact, we even describe a ``just-in-time'' zip-zip tree variant, which needs just an expected $O(1)$ number of bits of metadata per node. Moreover, we can define zip-zip trees to be strongly history independent, whereas treaps are generally only weakly history independent. We also introduce \emph{biased zip-zip trees}, which have an explicit bias based on key weights, so the expected depth of a key, $k$, with weight, $w_k$, is $O(\log (W/w_k))$, where $W$ is the weight of all keys in the weighted zip-zip tree. Finally, we show that one can easily make zip-zip trees partially persistent with only $O(n)$ space overhead w.h.p.
We present the first pointer-based heap implementation with time bounds matching those of Fibonacci heaps in the worst case. We support make-heap, insert, find-min, meld and decrease-key in worst-case O(1) time, and delete and delete-min in worst-case O(lg n) time, where n is the size of the heap. The data structure uses linear space.A previous, very complicated, solution achieving the same time bounds in the RAM model made essential use of arrays and extensive use of redundant counter schemes to maintain balance. Our solution uses neither. Our key simplification is to discard the structure of the smaller heap when doing a meld. We use the pigeonhole principle in place of the redundant counter mechanism.
We present a randomized (O) over tilde (n(3.5))-time algorithm for computing optimal energetic paths for an electric car between all pairs of vertices in an n-vertex directed graph with positive and negative costs, or gains, which are defined to be the negatives of the costs. The optimal energetic paths are finite and well-defined even if the graph contains negative-cost, or equivalently, positive-gain, cycles. This makes the problem much more challenging than standard shortest paths problems. More specifically, for every two vertices s and t in the graph, the algorithm computes alpha(B)(s, t), the maximum amount of charge the car can reach t with, if it starts at s with full battery, i.e., with charge B, where B is the capacity of the battery. The algorithm also outputs a concise description of the optimal energetic paths that achieve these values. In the presence of positive-gain cycles, optimal paths are not necessarily simple. For dense graphs, our new (O) over tilde (n(3.5)) time algorithm improves on a previous (O) over tilde (mn(2))-time algorithm of Dorfman et al. [ESA 2023] for the problem. The gain of an arc is the amount of charge added to the battery of the car when traversing the arc. The charge in the battery can never exceed the capacity B of the battery and can never be negative. An arc of positive gain may correspond, for example, to a downhill road segment, while an arc with a negative gain may correspond to an uphill segment. A positive-gain cycle, if one exists, can be used in certain cases to charge the battery to its capacity. This makes the problem more interesting and more challenging. As mentioned, optimal energetic paths are well-defined even in the presence of positive-gain cycles. Positive-gain cycles may arise when certain road segments have magnetic charging strips, or when the electric car has solar panels. Combined with a result of Dorfman et al. [SOSA 2024], this also provides a randomized (O) over tilde (n(3.5))-time algorithm for computing minimum-cost paths between all pairs of vertices in an n-vertex graph when the battery can be externally recharged, at varying costs, at intermediate vertices.
Since the invention of the pairing heap by Fredman, Sedgewick, Sleator, and Tarjan [8], it has been an open question whether this or any other simple “self-adjusting” heap supports decrease-key operations in \(\mathrm{O}(\log\log n)\) time, where \(n\) is the number of heap items. Using powerful new techniques, we answer this question in the affirmative. We prove that both slim and smooth heaps, recently introduced self-adjusting heaps, support heap operations in the following amortized time bounds: \(\mathrm{O}(\log n)\) for delete-min and delete, \(\mathrm{O}(\log\log n)\) for decrease-key, and \(\mathrm{O}(1)\) for all other heap operations, including insert and meld, where \(n\) is the number of heap items that are eventually deleted: Items inserted but never deleted do not count in the bounds. We also analyze the multipass pairing heap, a variant of pairing heaps. For this heap implementation, we obtain the same bounds except for decrease-key, for which our bound is \(\mathrm{O}(\log\log n\cdot\log\log\log n)\), where again items that are never deleted do not count in \(n\). Our bounds significantly improve the best previously known bounds for all three data structures. For slim and smooth heaps our bounds are tight, since they match lower bounds of Iacono and Özkan [13].
Although Dijkstra's algorithm has near-optimal time complexity for the problem of finding a shortest path from a given vertex s to a given vertex t, in practice other algorithms are often superior on huge graphs. A prominent example is bidirectional search, which concurrently executes Dijkstra's algorithm forward from s and backward from t, and stops when these executions meet. In this paper, we give a strong theoretical justification for the use of bidirectional search to find a shortest st-path. We prove that for weighted multigraphs, both directed and undirected, a careful implementation of bidirectional search is instance-optimal with respect to the number of edges it examines. That is, we prove that no correct algorithm can outperform our implementation of bidirectional search on any single instance by more than a constant factor. For unweighted graphs, we show that bidirectional breadth-first search is instance-optimal up to a factor of O(Δ) where Δ is the maximum degree of the graph. We also show that this is best possible.
We survey three algorithms that use depth-first search to find the strong components of a directed graph in linear time: (1) Tarjan's algorithm; (2) a cycle-finding algorithm; and (3) a bidirectional search algorithm.
We design a simple, fast, scalable, and reliable concurrent disjoint set union (a.k.a. union-find) data structure. Our algorithms are the first scalable algorithms for the problem. Our best algorithm provides almost-linear speed-up, performing just Θ (m ⋅ (log (np/m + 1) + α (n, m/np))) work when p processes execute a total of m operations on an instance with sets of total size n. We give a rigorous, machine-verified proof of correctness, and we prove that the work-complexity is optimal amongst a class of symmetric algorithms, which include all known concurrent set union algorithms. Our algorithms are fast in practice and have seen wide adoption. They are implemented in Google's recently open-sourced graph-mining library, where they enable "parallel clustering algorithms which scale to graphs with tens of billions of edges" [5]. An MIT research group (Dhulipala, Hong, and Shun) independently implemented hundreds of parallel algorithms for connected components and revealed that our algorithms are consistently the fastest both on CPUs [2] and GPUs [6]. As an illustration, our algorithms were used to compute the components of the Hyperlink2012 graph of 128 billion edges in just 8.2 seconds on a standard 72 core machine; this is 3.1x faster than the state-of-the-art in any computational setting [2]. Several state-of-the-art algorithms for parallel clustering [5, 15, 16], graph analysis [2, 14], and model checking [1] rely on our data structures.
This paper proves that Dijkstra's shortest-path algorithm is universally optimal in both its running time and number of comparisons when combined with a sufficiently efficient heap data structure. Universal optimality is a powerful beyond-worst-case performance guarantee for graph algorithms that informally states that a single algorithm performs as well as possible for every single graph topology. We give the first application of this notion to any sequential algorithm. We design a new heap data structure with a working-set property guaranteeing that the heap takes advantage of locality in heap operations. Our heap matches the optimal (worst-case) bounds of Fibonacci heaps but also provides the beyond-worst-case guarantee that the cost of extracting the minimum element is merely logarithmic in the number of elements inserted after it instead of logarithmic in the number of all elements in the heap. This makes the extraction of recently added elements cheaper. We prove that our working-set property is sufficient to guarantee universal optimality, specifically, for the problem of ordering vertices by their distance from the source vertex: The locality in the sequence of heap operations generated by any run of Dijkstra's algorithm on a fixed topology is strong enough that one can couple the number of comparisons performed by any heap with our working-set property to the minimum number of comparisons required to solve the distance ordering problem on this topology.
An electric car equipped with a battery of a finite capacity travels on a road network with an infrastructure of charging stations. Each charging station has a possibly different cost per unit of energy. Traversing a given road segment requires a specified amount of energy that may be positive, zero or negative. The car can only traverse a road segment if it has enough charge to do so (the charge cannot drop below zero), and it cannot charge its battery beyond its capacity. To travel from one point to another the car needs to choose a travel plan consisting of a path in the network and a recharging schedule that specifies how much energy to charge at each charging station on the path, making sure of having enough energy to reach the next charging station or the destination. The cost of the plan is the total charging cost along the chosen path. We reduce the problem of computing plans between every two junctions of the network to two problems: Finding optimal energetic paths when no charging is allowed and finding standard shortest paths. When there are no negative cycles in the network, we obtain an O(n3)-time algorithm for computing all-pairs travel plans, where n is the number of junctions in the network. We obtain slightly faster algorithms under some further assumptions. We also consider the case in which a bound is placed on the number of rechargings allowed.
The pairing heap, introduced by Fredman et al. [3], is a self-adjusting heap data structure that is both simple and efficient. A variant introduced in the same paper is the multipass pairing heap. Standard pairing heaps do just two linking passes during delete-min, a pairing pass and an assembly pass. In contrast, multipass pairing heaps do repeated pairing passes, in which nodes are linked in adjacent pairs, until only a minimum-key node remains. We obtain the following amortized time bounds for operations on n-item multipass pairing heaps: O(log n) for delete-min and delete; O(log log n log log log n) for decrease-key; and O(1) for all other heap operations, including insert and meld. This is the first analysis giving an O(log n) bound for delete-min. Our analysis is tight for all operations except possibly decrease-key, for which Fredman [2] and separately Iacono and Ozkan [6] proved an Omega(log log n) lower bound.
The smooth heap and the closely related slim heap are recently invented self-adjusting implementations of the heap (priority queue) data structure. We analyze the efficiency of these data structures. We obtain the following amortized bounds on the time per operation: $O(1)$ for make-heap, insert, find-min, and meld; $O(\log\log n)$ for decrease-key; and $O(\log n)$ for delete-min and delete, where $n$ is the current number of items in the heap. These bounds are tight not only for smooth and slim heaps but for any heap implementation in Iacono and Özkan's pure heap model, intended to capture all possible"self-adjusting"heap implementations. Slim and smooth heaps are the first known data structures to match Iacono and Özkan's lower bounds and to satisfy the constraints of their model. Our analysis builds on Pettie's insights into the efficiency of pairing heaps, a classical self-adjusting heap implementation.
A \emph{resizable array} is an array that can \emph{grow} and \emph{shrink} by the addition or removal of items from its end, or both its ends, while still supporting constant-time \emph{access} to each item stored in the array given its \emph{index}. Since the size of an array, i.e., the number of items in it, varies over time, space-efficient maintenance of a resizable array requires dynamic memory management. A standard doubling technique allows the maintenance of an array of size~$N$ using only $O(N)$ space, with $O(1)$ amortized time, or even $O(1)$ worst-case time, per operation. Sitarski and Brodnik et al.\ describe much better solutions that maintain a resizable array of size~$N$ using only $N+O(\sqrt{N})$ space, still with $O(1)$ time per operation. Brodnik et al.\ give a simple proof that this is best possible. We distinguish between the space needed for \emph{storing} a resizable array, and accessing its items, and the \emph{temporary} space that may be needed while growing or shrinking the array. For every integer $r\ge 2$, we show that $N+O(N^{1/r})$ space is sufficient for storing and accessing an array of size~$N$, if $N+O(N^{1-1/r})$ space can be used briefly during grow and shrink operations. Accessing an item by index takes $O(1)$ worst-case time while grow and shrink operations take $O(r)$ amortized time. Using an exact analysis of a \emph{growth game}, we show that for any data structure from a wide class of data structures that uses only $N+O(N^{1/r})$ space to store the array, the amortized cost of grow is $\Omega(r)$, even if only grow and access operations are allowed. The time for grow and shrink operations cannot be made worst-case, unless $r=2$.
A weighted directed graph $G=(V,A,c)$, where $A\subseteq V\times V$ and $c:A\to R$, describes a road network in which an electric car can roam. An arc $uv$ models a road segment connecting the two vertices $u$ and $v$. The cost $c(uv)$ of an arc $uv$ is the amount of energy the car needs to traverse the arc. This amount may be positive, zero or negative. To make the problem realistic, we assume there are no negative cycles. The car has a battery that can store up to $B$ units of energy. It can traverse an arc $uv\in A$ only if it is at $u$ and the charge $b$ in its battery satisfies $b\ge c(uv)$. If it traverses the arc, it reaches $v$ with a charge of $\min(b-c(uv),B)$. Arcs with positive costs deplete the battery, arcs with negative costs charge the battery, but not above its capacity of $B$. Given $s,t\in V$, can the car travel from $s$ to $t$, starting at $s$ with an initial charge $b$, where $0\le b\le B$? If so, what is the maximum charge with which the car can reach $t$? Equivalently, what is the smallest $\delta_{B,b}(s,t)$ such that the car can reach $t$ with a charge of $b-\delta_{B,b}(s,t)$, and which path should the car follow to achieve this? We refer to $\delta_{B,b}(s,t)$ as the energetic cost of traveling from $s$ to $t$. We let $\delta_{B,b}(s,t)=\infty$ if the car cannot travel from $s$ to $t$ starting with an initial charge of $b$. The problem of computing energetic costs is a strict generalization of the standard shortest paths problem. We show that the single-source minimum energetic paths problem can be solved using simple, but subtle, adaptations of the Bellman-Ford and Dijkstra algorithms. To make Dijkstra's algorithm work in the presence of negative arcs, but no negative cycles, we use a variant of the $A^*$ search heuristic. These results are explicit or implicit in some previous papers. We provide a simpler and unified description of these algorithms.
The pairing heap is a simple "self-adjusting" implementation of a heap (priority queue). Inserting an item into a pairing heap or decreasing the key of an item takes O(1) time worst-case, as does melding two heaps. But deleting an item of minimum key can take time linear in the heap size in the worst case. The paper that introduced the pairing heap proved an O(log n) amortized time bound for each heap operation, where n is the number of items in the heap or heaps involved in the operation, by charging all but O(log n) of the time for each deletion to non-deletion operations, O(log n) to each. Later Iacono found a way to reduce the amortized time per insertion to O(1) and that of meld to zero while preserving the O(log n) amortized time bound for the other update operations. We give a simpler proof of Iacono's result with significantly smaller constant factors. Our analysis uses the natural representation of pairing heaps instead of the conversion to a binary tree used in the original analysis and in Iacono's.
Kostas Tsioutsiouliklis合作论文数Yahoo!6
Jon Louis Bentley合作论文数Bell Laboratories5
Ravindra K Ahuja合作论文数Axele;Optym4