-
Efficiency of Self-Adjusting Heaps
Authors:
Corwin Sinnamon,
Robert E. Tarjan
Abstract:
Since the invention of the pairing heap by Fredman et al., it has been an open question whether this or any other simple "self-adjusting" heap supports decrease-key operations on $n$-item heaps in $O(\log\log n)$ time. 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 operation…
▽ More
Since the invention of the pairing heap by Fredman et al., it has been an open question whether this or any other simple "self-adjusting" heap supports decrease-key operations on $n$-item heaps in $O(\log\log n)$ time. 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 on an $n$-item heap in the following amortized time bounds: $O(\log n)$ for delete-min and delete, $O(\log\log n)$ for decrease-key, and $O(1)$ for all other heap operations, including insert and meld. 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 $O(\log\log n \log\log\log 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 Ozkan; for multipass pairing heaps our bounds are tight except for decrease-key, which by the lower bounds of Fredman and Iacono and Özkan must take $O(\log\log n)$ amortized time if delete-min takes $O(\log n)$ time.
△ Less
Submitted 6 July, 2023;
originally announced July 2023.
-
A Simpler Proof that Pairing Heaps Take O(1) Amortized Time per Insertion
Authors:
Corwin Sinnamon,
Robert Tarjan
Abstract:
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…
▽ More
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.
△ Less
Submitted 24 August, 2022;
originally announced August 2022.
-
A Tight Analysis of Slim Heaps and Smooth Heaps
Authors:
Corwin Sinnamon,
Robert E. Tarjan
Abstract:
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…
▽ More
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.
△ Less
Submitted 5 November, 2021; v1 submitted 10 August, 2021;
originally announced August 2021.
-
Analysis of Smooth Heaps and Slim Heaps
Authors:
Maria Hartmann,
László Kozma,
Corwin Sinnamon,
Robert E. Tarjan
Abstract:
The smooth heap is a recently introduced self-adjusting heap [Kozma, Saranurak, 2018] similar to the pairing heap [Fredman, Sedgewick, Sleator, Tarjan, 1986]. The smooth heap was obtained as a heap-counterpart of Greedy BST, a binary search tree updating strategy conjectured to be \emph{instance-optimal} [Lucas, 1988], [Munro, 2000]. Several adaptive properties of smooth heaps follow from this con…
▽ More
The smooth heap is a recently introduced self-adjusting heap [Kozma, Saranurak, 2018] similar to the pairing heap [Fredman, Sedgewick, Sleator, Tarjan, 1986]. The smooth heap was obtained as a heap-counterpart of Greedy BST, a binary search tree updating strategy conjectured to be \emph{instance-optimal} [Lucas, 1988], [Munro, 2000]. Several adaptive properties of smooth heaps follow from this connection; moreover, the smooth heap itself has been conjectured to be instance-optimal within a certain class of heaps. Nevertheless, no general analysis of smooth heaps has existed until now, the only previous analysis showing that, when used in \emph{sorting mode} ($n$ insertions followed by $n$ delete-min operations), smooth heaps sort $n$ numbers in $O(n\lg n)$ time.
In this paper we describe a simpler variant of the smooth heap we call the \emph{slim heap}. We give a new, self-contained analysis of smooth heaps and slim heaps in unrestricted operation, obtaining amortized bounds that match the best bounds known for self-adjusting heaps. Previous experimental work has found the pairing heap to dominate other data structures in this class in various settings. Our tests show that smooth heaps and slim heaps are competitive with pairing heaps, outperforming them in some cases, while being comparably easy to implement.
△ Less
Submitted 10 July, 2021;
originally announced July 2021.
-
Fast and Simple Edge-Coloring Algorithms
Authors:
Corwin Sinnamon
Abstract:
We develop sequential algorithms for constructing edge-colorings of graphs and multigraphs efficiently and using few colors. Our primary focus is edge-coloring arbitrary simple graphs using $d+1$ colors, where $d$ is the largest vertex degree in the graph. Vizing's Theorem states that every simple graph can be edge-colored using $d+1$ colors. Although some graphs can be edge-colored using only…
▽ More
We develop sequential algorithms for constructing edge-colorings of graphs and multigraphs efficiently and using few colors. Our primary focus is edge-coloring arbitrary simple graphs using $d+1$ colors, where $d$ is the largest vertex degree in the graph. Vizing's Theorem states that every simple graph can be edge-colored using $d+1$ colors. Although some graphs can be edge-colored using only $d$ colors, it is NP-hard to recognize graphs of this type [Holyer, 1981]. So using $d+1$ colors is a natural goal. Efficient techniques for $(d+1)$-edge-coloring were developed by Gabow, Nishizeki, Kariv, Leven, and Terada in 1985, and independently by Arjomandi in 1982, leading to algorithms that run in $O(|E| \sqrt{|V| \log |V|})$ time. They have remained the fastest known algorithms for this task.
We improve the runtime to $O(|E| \sqrt{|V|})$ with a small modification and careful analysis. We then develop a randomized version of the algorithm that is much simpler to implement and has the same asymptotic runtime, with very high probability. On the way to these results, we give a simple algorithm for $(2d-1)$-edge-coloring of multigraphs that runs in $O(|E|\log d)$ time. Underlying these algorithms is a general edge-coloring strategy which may lend itself to further applications.
△ Less
Submitted 28 February, 2021; v1 submitted 6 July, 2019;
originally announced July 2019.
-
Space-Efficient Data Structures for Lattices
Authors:
J. Ian Munro,
Bryce Sandlund,
Corwin Sinnamon
Abstract:
A lattice is a partially-ordered set in which every pair of elements has a unique meet (greatest lower bound) and join (least upper bound). We present new data structures for lattices that are simple, efficient, and nearly optimal in terms of space complexity.
Our first data structure can answer partial order queries in constant time and find the meet or join of two elements in $O(n^{3/4})$ time…
▽ More
A lattice is a partially-ordered set in which every pair of elements has a unique meet (greatest lower bound) and join (least upper bound). We present new data structures for lattices that are simple, efficient, and nearly optimal in terms of space complexity.
Our first data structure can answer partial order queries in constant time and find the meet or join of two elements in $O(n^{3/4})$ time, where $n$ is the number of elements in the lattice. It occupies $O(n^{3/2}\log n)$ bits of space, which is only a $Θ(\log n)$ factor from the $Θ(n^{3/2})$-bit lower bound for storing lattices. The preprocessing time is $O(n^2)$. This structure admits a simple space-time tradeoff so that, for any $c \in [\frac{1}{2}, 1]$, the data structure supports meet and join queries in $O(n^{1-c/2})$ time, occupies $O(n^{1+c}\log n)$ bits of space, and can be constructed in $O(n^2 + n^{1+3c/2})$ time.
Our second data structure uses $O(n^{3/2}\log n)$ bits of space and supports meet and join in $O(d \frac{\log n}{\log d})$ time, where $d$ is the maximum degree of any element in the transitive reduction graph of the lattice. This structure is much faster for lattices with low-degree elements.
This paper also identifies an error in a long-standing solution to the problem of representing lattices. We discuss the issue with this previous work.
△ Less
Submitted 16 June, 2020; v1 submitted 13 February, 2019;
originally announced February 2019.
-
Complexity of Proper Suffix-Convex Regular Languages
Authors:
Corwin Sinnamon
Abstract:
A language L is suffix-convex if for any words u, v,w, whenever w and uvw are in L, vw is in L as well. Suffix-convex languages include left ideals, suffix-closed languages, and suffix-free languages, which were studied previously. In this paper, we concentrate on suffix-convex languages that do not belong to any one of these classes; we call such languages proper. In order to study this language…
▽ More
A language L is suffix-convex if for any words u, v,w, whenever w and uvw are in L, vw is in L as well. Suffix-convex languages include left ideals, suffix-closed languages, and suffix-free languages, which were studied previously. In this paper, we concentrate on suffix-convex languages that do not belong to any one of these classes; we call such languages proper. In order to study this language class, we define a structure called a suffix-convex triple system that characterizes the automata recognizing suffix-convex languages. We find tight upper bounds for reversal, star, product, and boolean operations of proper suffix-convex languages, and we conjecture on the size of the largest syntactic semigroup. We also prove that three witness streams are required to meet all these bounds.
△ Less
Submitted 12 May, 2018; v1 submitted 9 May, 2018;
originally announced May 2018.
-
Unrestricted State Complexity of Binary Operations on Regular and Ideal Languages
Authors:
Janusz Brzozowski,
Corwin Sinnamon
Abstract:
We study the state complexity of binary operations on regular languages over different alphabets. It is known that if $L'_m$ and $L_n$ are languages of state complexities $m$ and $n$, respectively, and restricted to the same alphabet, the state complexity of any binary boolean operation on $L'_m$ and $L_n$ is $mn$, and that of product (concatenation) is $m 2^n - 2^{n-1}$. In contrast to this, we s…
▽ More
We study the state complexity of binary operations on regular languages over different alphabets. It is known that if $L'_m$ and $L_n$ are languages of state complexities $m$ and $n$, respectively, and restricted to the same alphabet, the state complexity of any binary boolean operation on $L'_m$ and $L_n$ is $mn$, and that of product (concatenation) is $m 2^n - 2^{n-1}$. In contrast to this, we show that if $L'_m$ and $L_n$ are over different alphabets, the state complexity of union and symmetric difference is $(m+1)(n+1)$, that of difference is $mn+m$, that of intersection is $mn$, and that of product is $m2^n+2^{n-1}$. We also study unrestricted complexity of binary operations in the classes of regular right, left, and two-sided ideals, and derive tight upper bounds. The bounds for product of the unrestricted cases (with the bounds for the restricted cases in parentheses) are as follows: right ideals $m+2^{n-2}+2^{n-1}$ ($m+2^{n-2}$); left ideals $mn+m+n$ ($m+n-1$); two-sided ideals $m+2n$ ($m+n-1$). The state complexities of boolean operations on all three types of ideals are the same as those of arbitrary regular languages, whereas that is not the case if the alphabets of the arguments are the same. Finally, we update the known results about most complex regular, right-ideal, left-ideal, and two-sided-ideal languages to include the unrestricted cases.
△ Less
Submitted 20 December, 2017; v1 submitted 14 September, 2016;
originally announced September 2016.
-
Complexity of Prefix-Convex Regular Languages
Authors:
Janusz Brzozowski,
Corwin Sinnamon
Abstract:
A language $L$ over an alphabet $Σ$ is prefix-convex if, for any words $x,y,z\inΣ^*$, whenever $x$ and $xyz$ are in $L$, then so is $xy$. Prefix-convex languages include right-ideal, prefix-closed, and prefix-free languages. We study complexity properties of prefix-convex regular languages. In particular, we find the quotient/state complexity of boolean operations, product (concatenation), star, a…
▽ More
A language $L$ over an alphabet $Σ$ is prefix-convex if, for any words $x,y,z\inΣ^*$, whenever $x$ and $xyz$ are in $L$, then so is $xy$. Prefix-convex languages include right-ideal, prefix-closed, and prefix-free languages. We study complexity properties of prefix-convex regular languages. In particular, we find the quotient/state complexity of boolean operations, product (concatenation), star, and reversal, the size of the syntactic semigroup, and the quotient complexity of atoms. For binary operations we use arguments with different alphabets when appropriate; this leads to higher tight upper bounds than those obtained with equal alphabets. We exhibit most complex prefix-convex languages that meet the complexity bounds for all the measures listed above.
△ Less
Submitted 24 June, 2016; v1 submitted 21 May, 2016;
originally announced May 2016.