Search arXivSearch

arXiv · 2004.01032

Grammar-Compressed Indexes with Logarithmic Search Time

Abstract

Let a text $T[1..n]$ be the only string generated by a context-free grammar with $g$ (terminal and nonterminal) symbols, and of size $G$ (measured as the sum of the lengths of the right-hand sides of the rules). Such a grammar, called a grammar-compressed representation of $T$, can be encoded using essentially $G\lg g$ bits. We introduce the first grammar-compressed index that uses $O(G\lg n)$ bits and can find the $occ$ occurrences of patterns $P[1..m]$ in time $O((m^2+occ)\lg G)$. We implement the index and demonstrate its practicality in comparison with the state of the art, on highly repetitive text collections.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Francisco Claude, Gonzalo Navarro, Alejandro Pacheco. 2020-04-01. Grammar-Compressed Indexes with Logarithmic Search Time. https://arxiv.org/abs/2004.01032

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Paths and Intersections: Recognizing Outerplanar Metrics

We study the following distance realization problem: given a metric $D$ on a set $T$ of terminals, does there exist an (edge-weighted) outerplanar graph $G$, such that $T\subseteq V(G)$, and for every pair $t,t'\in T$, $\textsf{dist}_G(t,t')=D(t,t')$? We first prove that there is no ``local characterization'', forming a contrast with trees and Okamura-Seymour instances. Our main result is an efficient algorithm for this problem whose running time is polynomial in $|T|$. Both our proof and our algorithm utilize a recent new approach of analyzing graph structures, by viewing graphs as paths and their intersections, which we believe is of independent interest.

cs.DS

Online Multi-Level Aggregation with Per-Batch Maximum Delay

We study online multi-level aggregation on finite rooted trees with a per-batch maximum-delay objective. A service pays for a rooted subtree and for the maximum waiting time among the requests cleared by that service. We show that the offline optimum admits a consecutive-arrival-block normal form and can be computed by a polynomial-time dynamic program. The same dynamic program defines the deadlines of a family of online algorithms, which we call DP-Envelope. Its deterministic endpoint is $2$-competitive. Sampling one global parameter with density $e^θ/(e-1)$ leads to an $e/(e-1)$-competitive randomized algorithm against an oblivious adversary. The deterministic guarantee matches the known fixed-node lower bound, and we prove a matching randomized lower bound. Thus, both guarantees are optimal on every nondegenerate rooted tree. We first develop the line metric as a warm-up, where the algorithm and its nested block partitions have a direct geometric interpretation. Finally, we show that the upper bounds extend to every realizable static service system with a normalized, nondecreasing, submodular joint service cost.

cs.DS

Parameterized complexity of $k$-Coloring in graphs with no long induced paths

We study the parameterized complexity of (List) $k$-Coloring in $H$-free graphs, where $H$ is a linear forest, that is, a disjoint union of paths. First, considering $k$ as the parameter, we establish the following: * For any $s \geq 0$, List $k$-Coloring in $(P_4+sP_1)$-free graphs is fixed-parameter tractable (FPT). * $k$-Coloring is W[1]-hard in $2P_2$-free graphs. The second result settles, in a strong form, a long-standing open problem posed by Hoàng, Kamiński, Lozin, Sawada, and Shu [Algorithmica, 2010]. Next, we prove that $k$-Coloring is NP-hard in $(P_4+P_2)$-free graphs. These three findings, together with known results from classical, non-parameterized complexity, yield a complete complexity classification of $k$-Coloring and List $k$-Coloring in $H$-free graphs, parameterized by $k$, into the cases: FPT, XP but W[1]-hard, and paraNP-hard. We also prove that $3$-Coloring is W[1]-hard in $P_t$-free graphs when parameterized by $t$. This answers a question of Golovach, Johnson, Paulusma, and Song [Journal of Graph Theory, 2017]. Finally, as a byproduct of our algorithm for List $k$-Coloring in $(P_4+sP_1)$-free graphs, we show that, for every fixed $s$ and $k$, there are only finitely many $(P_4+sP_1)$-free minimal obstructions to $k$-colorability. This settles a conjecture of Cameron, Hoàng, and Sawada [Disc. Appl. Math., 2022] and completes the dichotomy concerning the finiteness of the family of vertex-$k$-critical $H$-free graphs for every graph $H$ and every $k$.

cs.DS