Abstract
Binary jumbled pattern matching asks to preprocess a binary string $$S$$ in order to answer queries $$(i,j)$$ which ask for a substring of $$S$$ that is of length $$i$$ and has exactly $$j$$ 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(n^2 / \log ^2 n)$$ -time solution for trees, matching the currently best bound for (the simpler problem of) strings. We also give an $${O}({g^{2 / 3} n^{4 / 3}/(\log n)^{4/3}})$$ -time solution for strings that are compressed by a context-free grammar of size $$g$$ in Chomsky normal form. This solution improves the known bounds when the string is compressible under many popular compression schemes. Finally, we prove that on graphs the problem is fixed-parameter tractable with respect to the treewidth $$w$$ of the graph, even for a constant number of different vertex-labels, thus improving the previous best $$n^{O(w)}$$ algorithm.
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.