Fast and Simple Jumbled Indexing for Binary Run-Length Encoded Strings

Authors Luís Cunha, Simone Dantas, Travis Gagie, Roland Wittler, Luis Kowada, Jens Stoye

Thumbnail PDF


  • Filesize: 414 kB
  • 9 pages

Document Identifiers

Author Details

Luís Cunha
Simone Dantas
Travis Gagie
Roland Wittler
Luis Kowada
Jens Stoye

Cite AsGet BibTex

Luís Cunha, Simone Dantas, Travis Gagie, Roland Wittler, Luis Kowada, and Jens Stoye. Fast and Simple Jumbled Indexing for Binary Run-Length Encoded Strings. In 28th Annual Symposium on Combinatorial Pattern Matching (CPM 2017). Leibniz International Proceedings in Informatics (LIPIcs), Volume 78, pp. 19:1-19:9, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2017)


Important papers have appeared recently on the problem of indexing binary strings for jumbled pattern matching, and further lowering the time bounds in terms of the input size would now be a breakthrough with broad implications. We can still make progress on the problem, however, by considering other natural parameters. Badkobeh et al. (IPL, 2013) and Amir et al. (TCS, 2016) gave algorithms that index a binary string in O(n + r^2 log r) time, where n is the length and r is the number of runs, and Giaquinta and Grabowski (IPL, 2013) gave one that runs in O(n + r^2) time. In this paper we propose a new and very simple algorithm that also runs in O(n + r^2) time and can be extended either so that the index returns the position of a match (if there is one), or so that the algorithm uses only O(n) bits of space instead of O(n) words.
  • string algorithms
  • indexing
  • jumbled pattern matching
  • run-length encoding


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. Amihood Amir, Alberto Apostolico, Tirza Hirst, Gad M. Landau, Noa Lewenstein, and Liat Rozenberg. Algorithms for jumbled indexing, jumbled border and jumbled square on run-length encoded strings. Theor. Comput. Sci., 656:146-159, 2016. URL:
  2. Amihood Amir, Timothy M. Chan, Moshe Lewenstein, and Noa Lewenstein. On hardness of jumbled indexing. In Javier Esparza, Pierre Fraigniaud, Thore Husfeldt, and Elias Koutsoupias, editors, Proceedings of the 41st International Colloquium on Automata, Languages, and Programming (ICALP 2014), volume 8572 of LNCS, pages 114-125. Springer, 2014. URL:
  3. Golnaz Badkobeh, Gabriele Fici, Steve Kroon, and Zsuzsanna Lipták. Binary jumbled string matching for highly run-length compressible texts. Inf. Process. Lett., 113(17):604-608, 2013. URL:
  4. David Bremner, Timothy M. Chan, Erik D. Demaine, Jeff Erickson, Ferran Hurtado, John Iacono, Stefan Langerman, Mihai Pătraşcu, and Perouz Taslakian. Necklaces, convolutions, and X+Y. Algorithmica, 69(2):294-314, 2014. URL:
  5. Péter Burcsi, Ferdinando Cicalese, Gabriele Fici, and Zsuzsanna Lipták. On table arrangements, scrabble freaks, and jumbled pattern matching. In Paolo Boldi and Luisa Gargano, editors, Proceedings of the 5th International Conference on Fun with Algorithms (FUN 2010), volume 6099 of LNCS, pages 89-101. Springer, 2010. URL:
  6. Péter Burcsi, Ferdinando Cicalese, Gabriele Fici, and Zsuzsanna Lipták. On approximate jumbled pattern matching in strings. Theory Comput. Syst., 50(1):35-51, 2012. URL:
  7. Timothy M. Chan and Moshe Lewenstein. Clustered integer 3SUM via additive combinatorics. In Rocco A. Servedio and Ronitt Rubinfeld, editors, Proceedings of the 47th Annual ACM on Symposium on Theory of Computing (STOC 2015), pages 31-40. ACM, ACM, 2015. URL:
  8. Ferdinando Cicalese, Gabriele Fici, and Zsuzsanna Lipták. Searching for jumbled patterns in strings. In Jan Holub and Jan Zdárek, editors, Proceedings of the Prague Stringology Conference (PSC 2009), pages 105-117, 2009. URL:
  9. Ferdinando Cicalese, Travis Gagie, Emanuele Giaquinta, Eduardo Sany Laber, Zsuzsanna Lipták, Romeo Rizzi, and Alexandru I. Tomescu. Indexes for jumbled pattern matching in strings, trees and graphs. In Oren Kurland, Moshe Lewenstein, and Ely Porat, editors, Proceedings of the 20th International Symposium on String Processing and Information Retrieval (SPIRE 2013), volume 8214 of LNCS, pages 56-63. Springer, 2013. URL:
  10. Ferdinando Cicalese, Eduardo Laber, Oren Weimann, and Raphael Yuster. Near linear time construction of an approximate index for all maximum consecutive sub-sums of a sequence. In Juha Kärkkäinen and Jens Stoye, editors, Proceedings of the 23rd Annual Symposium on Combinatorial Pattern Matching (CPM 2012), volume 7354 of LNCS, pages 149-158. Springer, 2012. URL:
  11. Stephane Durocher, Robert Fraser, Travis Gagie, Debajyoti Mondal, Matthew Skala, and Sharma V. Thankachan. Indexed geometric jumbled pattern matching. In Alexander S. Kulikov, Sergei O. Kuznetsov, and Pavel A. Pevzner, editors, Proceedings of the 25th Annual Symposium on Combinatorial Pattern Matching (CPM 2014), volume 8486 of LNCS, pages 110-119. Springer, Springer, 2014. URL:
  12. Travis Gagie, Danny Hermelin, Gad M. Landau, and Oren Weimann. Binary jumbled pattern matching on trees and tree-like structures. Algorithmica, 73(3):571-588, 2015. URL:
  13. Emanuele Giaquinta and Szymon Grabowski. New algorithms for binary jumbled pattern matching. Inf. Process. Lett., 113(14):538-542, 2013. URL:
  14. Danny Hermelin, Gad M. Landau, Yuri Rabinovich, and Oren Weimann. Binary jumbled pattern matching via all-pairs shortest paths, 2014. URL:
  15. Tomasz Kociumaka, Jakub Radoszewski, and Wojciech Rytter. Efficient indexes for jumbled pattern matching with constant-sized alphabet. In Hans L. Bodlaender and Giuseppe F. Italiano, editors, Proceedings of the 21st Annual European Symposium on Algorithms (ESA 2013), volume 8125 of LNCS, pages 625-636. Springer, 2013. URL:
  16. Tanaeem M. Moosa and M. Sohel Rahman. Indexing permutations for binary strings. Inf. Process. Lett., 110(18-19):795-798, 2010. URL:
  17. Tanaeem M. Moosa and M. Sohel Rahman. Sub-quadratic time and linear space data structures for permutation matching in binary strings. J. Discrete Algorithms, 10:5-9, 2012. URL:
  18. Gonzalo Navarro. Compact Data Structures: A practical approach. Cambridge University Press, 2016. URL:
  19. Shiho Sugimoto, Naoki Noda, Shunsuke Inenaga, Hideo Bannai, and Masayuki Takeda. Computing Abelian regularities on RLE strings, 2017. URL:
Questions / Remarks / Feedback

Feedback for Dagstuhl Publishing

Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail