Skip to main content
QUICK REVIEW

[Paper Review] Space-Efficient String Indexing for Wildcard Pattern Matching

Moshe Lewenstein, Yakov Nekrich|arXiv (Cornell University)|Jan 3, 2014
Algorithms and Data CompressionComputer Science8 references8 citations
TL;DR

This paper presents the first compressed data structures for wildcard pattern matching that use $o(n\log n)$ bits of space, achieving sublinear space while supporting efficient queries. It introduces an $O(n\log^\varepsilon n)$-bit index with $O(m + \sigma^g \sqrt{\log^{(3)}n} + \mathrm{occ})$ query time, significantly improving over prior linear-space solutions for constant alphabets.

ABSTRACT

In this paper we describe compressed indexes that support pattern matching queries for strings with wildcards. For a constant size alphabet our data structure uses $O(n\log^{\varepsilon}n)$ bits for any $\varepsilon>0$ and reports all $\mathrm{occ}$ occurrences of a wildcard string in $O(m+σ^g \cdotμ(n) + \mathrm{occ})$ time, where $μ(n)=o(\log\log\log n)$, $σ$ is the alphabet size, $m$ is the number of alphabet symbols and $g$ is the number of wildcard symbols in the query string. We also present an $O(n)$-bit index with $O((m+σ^g+\mathrm{occ})\log^{\varepsilon}n)$ query time and an $O(n(\log\log n)^2)$-bit index with $O((m+σ^g+\mathrm{occ})\log\log n)$ query time. These are the first non-trivial data structures for this problem that need $o(n\log n)$ bits of space.

Motivation & Objective

  • To design compressed string indexes that support wildcard pattern matching with sublinear space usage, specifically $o(n\log n)$ bits.
  • To address the inefficiency of existing data structures that require $\Theta(n\log n)$ bits or more, especially for large-scale text indexing.
  • To enable efficient query processing for patterns with arbitrary numbers of wildcards while minimizing space overhead.
  • To achieve a trade-off between space and query time that outperforms prior linear-space solutions in both metrics.

Proposed method

  • Constructs a compressed suffix tree with hierarchical sampling: primary and secondary marked nodes to reduce space while preserving query efficiency.
  • Uses wildcard trees to handle wildcard symbols by branching and traversing multiple paths in parallel, with a bounded number of active locations.
  • Employs a look-up table for short patterns (length $\leq \ell$) that match wildcard chunks, enabling fast pattern generation and location lookup.
  • Combines standard LCP queries on sampled suffix trees with wildcard-aware traversal to answer queries in $O(\sigma^g \sqrt{\log^{(3)}n})$ time.
  • Introduces a layered data structure where each level handles a segment of the pattern with up to $t_1$ wildcards, reducing the number of recursive queries.
  • Uses a compressed suffix array with $O(1)$ LCP query time for small subtrees, and a compressed LCP structure for larger sampled subtrees with $\mu(n) = O(\sqrt{\log^{(3)}n})$ time.

Experimental results

Research questions

  • RQ1Can we design a compressed string index for wildcard pattern matching that uses $o(n\log n)$ bits of space?
  • RQ2What is the best possible trade-off between space usage and query time for wildcard pattern matching with an arbitrary number of wildcards?
  • RQ3Can we achieve sublinear query time for patterns with $g$ wildcards while maintaining sublinear space?
  • RQ4How can we efficiently handle patterns with multiple wildcard segments without explicitly enumerating all $\sigma^g$ possible patterns?
  • RQ5Is it possible to maintain $O(\mathrm{occ})$ reporting time while reducing space to $O(n)$ or $O(n(\log\log n)^2)$ bits?

Key findings

  • The paper presents an $O(n\log^\varepsilon n)$-bit data structure that supports wildcard pattern matching in $O(m + \sigma^g \sqrt{\log^{(3)}n} + \mathrm{occ})$ time, achieving both sublinear space and improved query time over prior work.
  • An $O(n)$-bit index supports queries in $O((m + \sigma^g + \mathrm{occ})\log^\varepsilon n)$ time, offering a significant space reduction with a modest increase in query time.
  • An $O(n(\log\log n)^2)$-bit index supports queries in $O((m + \sigma^g + \mathrm{occ})\log\log n)$ time, balancing space and performance.
  • For constant alphabet size $\sigma$, the query time is $O(m + \sigma^g \sqrt{\log^{(3)}n} + \mathrm{occ})$, which improves upon the $O(m + \sigma^g \log\log n)$ time of previous linear-space structures.
  • The data structure supports arbitrary numbers of wildcards and avoids enumerating all $\sigma^g$ possible patterns by using hierarchical sampling and look-up tables for short wildcard segments.
  • The approach generalizes to larger alphabets: an $O(n\log n)$-bit structure supports $O(m + \sigma^g + \mathrm{occ})$ queries when $\sigma \geq \log\log n$, and an $O(n\log\sigma)$-bit structure supports $O((m + \sigma^g + \mathrm{occ})\log_\sigma^\varepsilon n)$ time for general $\sigma$.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.