Skip to main content
QUICK REVIEW

[Paper Review] Fingerprints in Compressed Strings

Philip Bille, Patrick Hagge Cording|arXiv (Cornell University)|May 13, 2013
Algorithms and Data CompressionComputer Science18 references5 citations
TL;DR

This paper presents the first linear-space data structures for answering Karp-Rabin fingerprint queries on grammar-compressed strings without decompressing any characters. For Straight Line Programs (SLPs), it achieves O(log N) query time, and for Linear SLPs—used to represent LZ78-style compression—it reduces query time to O(log log N), matching the efficiency of random access in such compressed representations.

ABSTRACT

The Karp-Rabin fingerprint of a string is a type of hash value that due to its strong properties has been used in many string algorithms. In this paper we show how to construct a data structure for a string $S$ of size $N$ compressed by a context-free grammar of size $n$ that answers fingerprint queries. That is, given indices $i$ and $j$, the answer to a query is the fingerprint of the substring $S[i,j]$. We present the first O(n) space data structures that answer fingerprint queries without decompressing any characters. For Straight Line Programs (SLP) we get $O(\log N)$ query time, and for Linear SLPs (an SLP derivative that captures LZ78 compression and its variations) we get $O(\log \log N)$ query time. Hence, our data structures has the same time and space complexity as for random access in SLPs. We utilize the fingerprint data structures to solve the longest common extension problem in query time $O(\log N \log \lce)$ and $O(\log \lce \log\log \lce + \log\log N)$ for SLPs and Linear SLPs, respectively. Here, $\lce$ denotes the length of the LCE.

Motivation & Objective

  • To design efficient data structures for answering fingerprint queries on grammar-compressed strings without decompression.
  • To achieve optimal space complexity O(n) while minimizing query time for SLPs and Linear SLPs.
  • To match the time complexity of random access in SLPs for fingerprint queries, improving over prior decompression-based methods.
  • To apply the fingerprint data structure to solve the longest common extension (LCE) problem efficiently in compressed strings.
  • To provide a new, simple reduction for solving the finger predecessor problem using any predecessor data structure as a black box.

Proposed method

  • Leverage the property that fingerprints of substrings can be computed in constant time from prefix fingerprints, enabling efficient composition of fingerprints along paths in the SLP parse tree.
  • Use the fast random access data structure by Bille et al. [8] as a foundation for SLPs, combining it with precomputed node fingerprints to answer fingerprint queries in O(log N) time.
  • For Linear SLPs, exploit the tree-like structure of production rules and use a level ancestor data structure to enable large jumps in the parse tree in constant time.
  • Model the position-finding step in Linear SLPs as a predecessor problem, solved efficiently using finger searching techniques.
  • Introduce a finger-based query mechanism where a finger points to the root child producing a given position, enabling O(log log D) query time for D = |i - j|.
  • Develop a black-box reduction for the finger predecessor problem using any underlying predecessor data structure, enhancing flexibility and efficiency.

Experimental results

Research questions

  • RQ1Can fingerprint queries on grammar-compressed strings be answered in sublinear time and linear space without decompressing any characters?
  • RQ2Can the query time for fingerprint queries on Linear SLPs be improved to O(log log N), matching the efficiency of random access?
  • RQ3How can fingerprint data structures be used to solve the longest common extension (LCE) problem efficiently in compressed strings?
  • RQ4Can a new, simple reduction be devised for the finger predecessor problem using any existing predecessor data structure as a black box?
  • RQ5What is the minimal space and time complexity for verifying that a Karp-Rabin fingerprint function is collision-free on compressed strings?

Key findings

  • The paper presents the first O(n) space data structures that answer fingerprint queries on SLP-compressed strings in O(log N) time, without decompressing any characters.
  • For Linear SLPs, the query time is reduced to O(log log N), matching the time complexity of random access in such representations.
  • The fingerprint data structure enables solving the LCE problem in O(log N log ℓ) time for SLPs and O(log ℓ log log ℓ + log log N) time for Linear SLPs, where ℓ is the LCE length.
  • A new finger predecessor reduction is introduced, allowing efficient position queries in Linear SLPs using finger-based access, achieving O(log log D) query time for D = |i - j|.
  • The fingerprint verification algorithm runs in O(N log N) time and O(n) space, or in O(N²/n log N) time with the same space, enabling efficient collision-free fingerprint function validation.
  • For Linear SLPs, the fingerprint verification time is further reduced to O(N log N log log N) with O(n) space by leveraging the structure of root substrings and efficient sliding window techniques.

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.