English

Compressed Subsequence Matching and Packed Tree Coloring

Data Structures and Algorithms 2014-06-06 v2

Abstract

We present a new algorithm for subsequence matching in grammar compressed strings. Given a grammar of size nn compressing a string of size NN and a pattern string of size mm over an alphabet of size σ\sigma, our algorithm uses O(n+nσw)O(n+\frac{n\sigma}{w}) space and O(n+nσw+mlogNlogwocc)O(n+\frac{n\sigma}{w}+m\log N\log w\cdot occ) or O(n+nσwlogw+mlogNocc)O(n+\frac{n\sigma}{w}\log w+m\log N\cdot occ) time. Here ww is the word size and occocc is the number of occurrences of the pattern. Our algorithm uses less space than previous algorithms and is also faster for occ=o(nlogN)occ=o(\frac{n}{\log N}) occurrences. The algorithm uses a new data structure that allows us to efficiently find the next occurrence of a given character after a given position in a compressed string. This data structure in turn is based on a new data structure for the tree color problem, where the node colors are packed in bit strings.

Keywords

Cite

@article{arxiv.1403.1065,
  title  = {Compressed Subsequence Matching and Packed Tree Coloring},
  author = {Philip Bille and Patrick Hagge Cording and Inge Li Gørtz},
  journal= {arXiv preprint arXiv:1403.1065},
  year   = {2014}
}

Comments

To appear at CPM '14

R2 v1 2026-06-22T03:20:30.950Z