Efficient representation and counting of antipower factors in words

Abstract A k-antipower (for k ≥ 2 ) is a concatenation of k distinct words of the same length. Fici et al. (ICALP 2016) initiated the study of antipowers occurring as fragments of a word, whereas Badkobeh et al. (Inf. Process. Lett., 2018) presented first algorithms computing such fragments. We address two open problems originating from the latter work and propose efficient algorithms for counting and reporting fragments being k-antipowers. For a length-n word, our algorithms cost O ( n k log ⁡ k ) and O ( n k log ⁡ k + C ) time, respectively, where C is the number of reported fragments. We also show that the number of different k-antipower factors of a length-n word can be computed in O ( n k 4 log ⁡ k log ⁡ n ) time. Finally, we present an improved data structure that checks whether a given fragment is a k-antipower for a given integer k ≥ 2 . Our main algorithmic tools are runs and maximal gapped repeats.

[1]  Tomasz Kociumaka Minimal Suffix and Rotation of a Substring in Optimal Time , 2016, CPM.

[2]  Antonio Restivo,et al.  Anti-Powers in Infinite Words , 2016, ICALP.

[3]  Wojciech Rytter,et al.  Extracting powers and periods in a word from its runs structure , 2014, Theor. Comput. Sci..

[4]  I Tomohiro,et al.  Improved Upper Bounds on all Maximal α-gapped Repeats and Palindromes , 2019, Theor. Comput. Sci..

[5]  Robert E. Tarjan,et al.  A data structure for dynamic trees , 1981, STOC '81.

[6]  Kazuya Tsuruta,et al.  The "Runs" Theorem , 2014, SIAM J. Comput..

[7]  Hideo Bannai,et al.  A Faster Algorithm for Computing Maximal \alpha -gapped Repeats in a String , 2015, SPIRE.

[8]  Frantisek Franek,et al.  How many double squares can a string contain? , 2015, Discret. Appl. Math..

[9]  Jens Stoye,et al.  Linear time algorithms for finding and representing all the tandem repeats in a string , 2004, J. Comput. Syst. Sci..

[10]  Stepan Holub Prefix frequency of lost positions , 2017, Theor. Comput. Sci..

[11]  Aviezri S. Fraenkel,et al.  How Many Squares Can a String Contain? , 1998, J. Comb. Theory, Ser. A.

[12]  Simon J. Puglisi,et al.  Algorithms for Anti-Powers in Strings , 2018, Inf. Process. Lett..

[13]  Huacheng Yu,et al.  Cell-probe lower bounds for dynamic problems via a new communication model , 2015, STOC.

[14]  Shunsuke Inenaga,et al.  Tighter Bounds and Optimal Algorithms for All Maximal α-gapped Repeats and Palindromes , 2017, Theory of Computing Systems.

[15]  S. Muthukrishnan,et al.  On the sorting-complexity of suffix tree construction , 2000, JACM.

[16]  Steven Skiena,et al.  Lowest common ancestors in trees and directed acyclic graphs , 2005, J. Algorithms.

[17]  Gregory Kucherov,et al.  Finding maximal repetitions in a word in linear time , 1999, 40th Annual Symposium on Foundations of Computer Science (Cat. No.99CB37039).

[18]  Florin Manea,et al.  Longest Gapped Repeats and Palindromes , 2017, Discret. Math. Theor. Comput. Sci..

[19]  Maxime Crochemore,et al.  Optimal bounds for computing α-gapped repeats , 2019, Inf. Comput..

[20]  JOHANNES FISCHER,et al.  Beyond the Runs Theorem , 2015, SPIRE.

[21]  Costas S. Iliopoulos,et al.  Computing the Antiperiod(s) of a String , 2019, CPM.

[22]  Mikhail Posypkin,et al.  Searching of gapped repeats and subrepetitions in a word , 2017, J. Discrete Algorithms.

[23]  Wojciech Rytter,et al.  Efficient Representation and Counting of Antipower Factors in Words , 2018, LATA.

[24]  Ronald L. Rivest,et al.  Introduction to Algorithms, third edition , 2009 .

[25]  Wojciech Rytter,et al.  A Linear-Time Algorithm for Seeds Computation , 2020, ACM Trans. Algorithms.

[26]  Xin-She Yang,et al.  Introduction to Algorithms , 2021, Nature-Inspired Optimization Algorithms.

[27]  Arseny M. Shur,et al.  Counting Palindromes in Substrings , 2017, SPIRE.

[28]  Dmitry Kosolobov Online Detection of Repetitions with Backtracking , 2015, CPM.