Abstract
The definition of antipower introduced by Fici et al. (ICALP 2016) captures the notion of being the opposite of a power: a sequence of k pairwise distinct blocks of the same length. Recently, Alamro et al. (CPM 2019) defined a string to have an antiperiod if it is a prefix of an antipower, and gave complexity bounds for the offline computation of the minimum antiperiod and all the antiperiods of a word. In this paper, we address the same problems in the online setting. Our solutions rely on new arrays that compactly and incrementally store antiperiods and antipowers as the word grows, obtaining in the process this information for all the word’s prefixes. We show how to compute those arrays online in \(O(n\log n)\) space, \(O(n\log n)\) time, and \(o(n^\epsilon )\) delay per character, for any constant \(\epsilon >0\). Running times are worst-case and hold with high probability. We also discuss more space-efficient solutions returning the correct result with high probability, and small data structures to support random access to those arrays.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
We remark that a word may be a power/antipower for different orders, even though in some cases [1] the focus is on the smallest such order.
- 2.
Using their interface, factor comparisons can be achieved by extracting (splitting) the factors in logarithmic time, then comparing them in constant time (or, alternatively, by navigating their grammar in logarithmic time without performing splits).
References
Alamro, H., Badkobeh, G., Belazzougui, D., Iliopoulos, C.S., Puglisi, S.J.: Computing the Antiperiod(s) of a string. In: 30th Annual Symposium on Combinatorial Pattern Matching (CPM). LIPIcs (2019, to appear)
Alzamel, M., et al.: Quasi-linear-time algorithm for longest common circular factor. In: 30th Annual Symposium on Combinatorial Pattern Matching (CPM). LIPIcs (2019, to appear)
Ayad, L.A.K., et al.: Longest property-preserved common factor. In: Gagie, T., Moffat, A., Navarro, G., Cuadros-Vargas, E. (eds.) SPIRE 2018. LNCS, vol. 11147, pp. 42–49. Springer, Cham (2018). https://doi.org/10.1007/978-3-030-00479-8_4
Badkobeh, G., Fici, G., Puglisi, S.J.: Algorithms for anti-powers in strings. Inf. Process. Lett. 137, 57–60 (2018)
Bae, S.W., Lee, I.: On finding a longest common palindromic subsequence. Theor. Comput. Sci. 710, 29–34 (2018)
Bille, P., Gørtz, I.L., Knudsen, M.B.T., Lewenstein, M., Vildhøj, H.W.: Longest common extensions in sublinear space. In: Cicalese, F., Porat, E., Vaccaro, U. (eds.) CPM 2015. LNCS, vol. 9133, pp. 65–76. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-19929-0_6
Burcroff, A.: (\(k\),\(\lambda \))-anti-powers and other patterns in words. Electron. J. Comb. 25, P4.41 (2018)
Chowdhury, S., Hasanl, M., Iqbal, S., Rahman, M.: Computing a longest common palindromic subsequence. Fundam. Inform. 129(4), 329–340 (2014)
Crochemore, M., Ilie, L., Rytter, W.: Repetitions in strings: algorithms and combinatorics. Theor. Comput. Sci. 410(50), 5227–5235 (2009). Mathematical Foundations of Computer Science (MFCS 2007)
Crochemore, M., Rytter, W.: Jewels of Stringology. World Scientific, Singapore (2002)
Defant, C.: Anti-power prefixes of the Thue-Morse word. Electron. J. Comb. 24, P1.32 (2017)
Dietzfelbinger, M., Meyer auf der Heide, F.: A new universal class of hash functions and dynamic hashing in real time. In: Paterson, M.S. (ed.) ICALP 1990. LNCS, vol. 443, pp. 6–19. Springer, Heidelberg (1990). https://doi.org/10.1007/BFb0032018
Dietzfelbinger, M., Karlin, A., Mehlhorn, K., Meyer auF der Heide, F., Rohnert, H., Tarjan, R.E.: Dynamic perfect hashing: upper and lower bounds. SIAM J. Comput. 23(4), 738–761 (1994)
Fici, G., Restivo, A., Silva, M., Zamboni, L.Q.: Anti-powers in infinite words. In: ICALP 2016. Leibniz International Proceedings in Informatics (LIPIcs), vol. 55, pp. 124:1–124:9. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany (2016)
Fici, G., Restivo, A., Silva, M., Zamboni, L.Q.: Anti-powers in infinite words. J. Comb. Theory Ser. A 157, 109–119 (2018)
Fischer, J., Heun, V.: Space-efficient preprocessing schemes for range minimum queries on static arrays. SIAM J. Comput. 40(2), 465–492 (2011)
Gawrychowski, P., Karczmarz, A., Kociumaka, T., Łacki, J., Sankowski, P.: Optimal dynamic strings. In: Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2018, pp. 1509–1528. Society for Industrial and Applied Mathematics (2018)
Inenaga, S., Hyyrö, H.: A hardness result and new algorithm for the longest common palindromic subsequence problem. Inf. Process. Lett. 129, 11–15 (2018)
Inoue, T., Inenaga, S., Hyyrö, H., Bannai, H., Takeda, M.: Computing longest common square subsequences. In: 29th Symposium on Combinatorial Pattern Matching (CPM). LIPIcs, vol. 105, pp. 15:1–15:13 (2018)
Karp, R.M., Rabin, M.O.: Efficient randomized pattern-matching algorithms. IBM J. Res. Dev. 31(2), 249–260 (1987)
Kociumaka, T., Radoszewski, J., Rytter, W., Straszyński, J., Waleń, T., Zuba, W.: Efficient representation and counting of antipower factors in words. In: Martín-Vide, C., Okhotin, A., Shapira, D. (eds.) LATA 2019. LNCS, vol. 11417, pp. 421–433. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-13435-8_31
Kolpakov, R., Bana, G., Kucherov, G.: mreps: efficient and flexible detection of tandem repeats in DNA. Nucl. Acids Res. 31(13), 3672–3678 (2003). https://doi.org/10.1093/nar/gkg617
Lenstra, H.W., Pomerance, C.: A rigorous time bound for factoring integers. J. Am. Math. Soc. 5(3), 483–516 (1992)
Li, L., Jin, R., Kok, P.L., Wan, H.: Pseudo-periodic partitions of biological sequences. Bioinformatics 20(3), 295–306 (2004)
Lothaire, M.: Combinatorics on Words. Cambridge University Press, Cambridge (1997)
Lothaire, M.: Algebraic Combinatorics on Words. Cambridge University Press, Cambridge (2002)
Lothaire, M.: Applied Combinatorics on Words. Encyclopedia of Mathematics and its Applications, Cambridge University Press (2005). https://doi.org/10.1017/CBO9781107341005
Lothaire, M.: Review of applied combinatorics on words. SIGACT News 39(3), 28–30 (2008)
Thue, A.: Uber unendliche zeichenreihen. Norske Vid Selsk. Skr. I Mat-Nat Kl. (Christiana) 7, 1–22 (1906)
Acknowledgements
The authors would like to thank Roberto Grossi for useful conversations on the topic. GR, NPi are partially, and DG, VG, NPr are supported by the project MIUR-SIR CMACBioSeq (“Combinatorial methods for analysis and compression of biological sequences”) grant n. RBSI146R5L.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2019 Springer Nature Switzerland AG
About this paper
Cite this paper
Alzamel, M. et al. (2019). Online Algorithms on Antipowers and Antiperiods. In: Brisaboa, N., Puglisi, S. (eds) String Processing and Information Retrieval. SPIRE 2019. Lecture Notes in Computer Science(), vol 11811. Springer, Cham. https://doi.org/10.1007/978-3-030-32686-9_13
Download citation
DOI: https://doi.org/10.1007/978-3-030-32686-9_13
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-32685-2
Online ISBN: 978-3-030-32686-9
eBook Packages: Computer ScienceComputer Science (R0)