Skip to main content
QUICK REVIEW

[Paper Review] Pattern Matching in Trees and Strings

Philip Bille|ArXiv.org|Aug 31, 2007
Algorithms and Data CompressionComputer Science40 references8 citations
TL;DR

This paper presents a novel algorithm for the tree inclusion problem in XML databases, achieving subquadratic time complexity and linear space usage—marking a significant improvement over prior methods that required quadratic space. By leveraging advanced data structures and word-level parallelism, the approach enables efficient querying of large XML datasets while keeping computation within main memory.

ABSTRACT

We study the design of efficient algorithms for combinatorial pattern matching. More concretely, we study algorithms for tree matching, string matching, and string matching in compressed texts.

Motivation & Objective

  • Address the inefficiency of existing tree inclusion algorithms that require quadratic space, limiting scalability for large XML databases.
  • Develop a method that reduces space complexity from Ω(n_P n_T) to O(n_T) while improving time complexity.
  • Enable efficient pattern matching in large-scale XML workloads by optimizing both time and space usage.
  • Extend the applicability of tree matching algorithms to compressed texts and regular expression matching with improved bounds.
  • Provide a unified framework for solving tree matching, string matching, and compressed text pattern matching problems with optimal resource usage.

Proposed method

  • Introduce a new data structure that maintains state-sets of active automaton states during tree traversal, enabling efficient path subsequence detection.
  • Use a compression scheme based on Ziv-Lempel (ZL) dictionaries to represent paths in trees, reducing space usage while preserving query efficiency.
  • Apply word-level parallelism via bit-parallel operations on state-sets encoded as bit strings, reducing time per transition to O(⌈m/log n⌉).
  • Leverage the Thompson automaton with compact state-set encoding to avoid explicit DFA construction, reducing preprocessing overhead.
  • Use a priority queue to merge match sets from multiple states and eliminate duplicates, ensuring correct and efficient output reporting.
  • Design a two-step state-set transition mechanism: first propagate via nearest compressed element, then apply local path transitions using distance bounds.

Experimental results

Research questions

  • RQ1Can the tree inclusion problem be solved in subquadratic time and linear space, improving upon the O(n_P n_T) space bound of prior algorithms?
  • RQ2How can word-level parallelism be exploited to reduce time complexity in tree and string pattern matching without increasing space usage?
  • RQ3What is the impact of using compressed text representations (e.g., ZL78/ZLW) on the time and space complexity of regular expression and string matching?
  • RQ4Can the path subsequence problem in labeled trees be solved efficiently with improved time and space bounds for XML query workloads?
  • RQ5To what extent can state-set transitions in automata be optimized using bit-parallel operations and hierarchical compression?

Key findings

  • The tree inclusion problem is solved in O(n_T) space and subquadratic time, specifically O(min(l_P n_T, n_P l_T log log n_T + n_T, n_P n_T / log n_T + n_T log n_T)) time, improving over prior Ω(n_P n_T) space bounds.
  • The algorithm achieves a space reduction by a linear factor compared to previous methods, enabling larger XML databases to be queried efficiently in main memory.
  • For regular expression matching, the algorithm achieves O(n m log w / w + m log w) time when m > w, improving known time bounds under O(m) space constraints.
  • When w ≥ log²n, the algorithm improves all known time bounds regardless of space usage, demonstrating broad applicability.
  • By exploiting word-level parallelism and compressed state-set encoding, the algorithm reduces time complexity by a factor of roughly log u for ZL78/ZLW compressed texts.
  • The path subsequence problem is solved in O(n_T) space with improved time complexity, enabling efficient XML path query processing at scale.

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.