Skip to content
Conference

Text Indexing: From Reporting to Counting

Jul 2026 · Embedded Systems and Applications · pp. 68:1-68:20 · 0 citations · 53 references
Computer Science

Abstract

We prove an elementary yet powerful combinatorial lemma: in any rooted tree with $L$ leaves, the number of nodes whose depth is smaller than the number of their leaf descendants is at most $L$. For any string $T$ of length $n$, a direct application of this lemma to the suffix trie of $T$ yields that the number of substrings of $T$ whose length is smaller than their number of occurrences in $T$ is at most $n$. This combinatorial insight leads to space-efficient data structures with optimal query times for string counting problems via the following algorithmic framework: store the counts for the at most $n$ ``frequent''substrings of $T$ in a preprocessing step, and use a reporting query to count for the ``infrequent''substrings. Our framework acts as a convenient black box, lifting indexes with reporting time $\mathcal{O}(|P|+|\textsf{Occ}_T(P)|)$ to support counting queries in time $\mathcal{O}(|P|)$, where $P$ is the queried pattern and $\textsf{Occ}_T(P)$ is the set of occurrences of $P$ in $T$. As applications, we show efficient indexes for consecutive occurrences, weighted sequences, strings with utilities, and non-overlapping occurrences.

View source

Similar papers

Preprint Sep 2026

ZigZag Trie: A Novel Index for Contextual Queries

There is increasing interest in queries about the context of a string $P$ in a longer text $T$, i.e., the set of all string pairs $(L,R)$, with $|L|=|R|=q$, for a given $q$, such that the string $LPR$ occurs in $T$. Such contextual queries are important in several domains but are challenging to answer efficiently. This...

Ling Li, D. Gibney, S. V. Thankachan et al. · 0 citations
Preprint Aug 2026

Cell-Probe Lower Bounds and Complexity-Preserving Reductions for Suffix Array Queries

For a text $T$ of length $n$ over an alphabet of size $\sigma$, its suffix array lists the starting positions of the suffixes of $T$ in lexicographic order, and its inverse suffix array gives the lexicographic rank of the suffix starting at each position. Since the introduction of the FM-index and the compressed suffix...

Dominik Kempa, Tomasz Kociumaka · 1 citation
Preprint Sep 2026

Union-Find with Constant-Time Deletions Across the Optimal Worst-Case Tradeoff

We consider union-find with deletions, where the representation and the cost of a query must depend on the current number of live elements rather than on the number of elements ever created. For every integer parameter $k\ge 2$, we give a linear-space data structure supporting $\mathsf{MakeSet}$ in $O(1)$ worst-case ti...

Han-Qing Li, Ze Hong · 0 citations
Preprint Sep 2026

Subtree Counts and the Maximum Mean Subtree Order

For a finite simple graph $G$ of positive order, let $s_k(G)$ be the number of its $k$-vertex tree subgraphs. We prove that, among graphs of a fixed order $n$, the ratios $s_k(G)/s_k(K_n)$ form a nonincreasing sequence in $k$. It follows that the complete graph maximizes the mean subtree order: $\mu(G)\leq\mu(K_n)$, wi...

Jun-Gang Chen, Xian'an Jin, Zhuo Li et al. · 0 citations
Preprint Aug 2026

misi: a Metric Inverted Sample Index

Misi is presented, an inverted index for approximate nearest-neighbor search over general metric spaces whose vocabulary is a random sample of the database, of size proportional to $n, whose design's strengths are structural and structural.

Edgar Chávez · 1 citation
Preprint Sep 2026

Transposition achieves OPT$+O(1)$ in polynomial time for IID list update

In the classical list update problem, a set of items must be stored in a list-type structure, where accessing the $i$-th element costs $i$. Items will be queried in an IID manner according to some probability distribution $p$ on the items. We want to minimize the expected cost of each query. The optimal order is to pla...

Clayton Mizgerd · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.