English

Binary Jumbled Pattern Matching on Trees and Tree-Like Structures

Data Structures and Algorithms 2014-07-01 v3

Abstract

Binary jumbled pattern matching asks to preprocess a binary string SS in order to answer queries (i,j)(i,j) which ask for a substring of SS that is of length ii and has exactly jj 1-bits. This problem naturally generalizes to vertex-labeled trees and graphs by replacing "substring" with "connected subgraph". In this paper, we give an O(n2/log2n)O(n^2 / \log^2 n)-time solution for trees, matching the currently best bound for (the simpler problem of) strings. We also give an \Ohg2/3n4/3/(logn)4/3\Oh{g^{2 / 3} n^{4 / 3}/(\log n)^{4/3}}-time solution for strings that are compressed by a grammar of size gg. This solution improves the known bounds when the string is compressible under many popular compression schemes. Finally, we prove that the problem is fixed-parameter tractable with respect to the treewidth ww of the graph, thus improving the previous best nO(w)n^{O(w)} algorithm [ICALP'07].

Keywords

Cite

@article{arxiv.1301.6127,
  title  = {Binary Jumbled Pattern Matching on Trees and Tree-Like Structures},
  author = {Travis Gagie and Danny Hermelin and Gad M. Landau and Oren Weimann},
  journal= {arXiv preprint arXiv:1301.6127},
  year   = {2014}
}
R2 v1 2026-06-21T23:15:29.290Z