English

Algorithms for Galois Words: Detection, Factorization, and Rotation

Data Structures and Algorithms 2024-04-24 v2

Abstract

Lyndon words are extensively studied in combinatorics on words -- they play a crucial role on upper bounding the number of runs a word can have [Bannai+, SIAM J. Comput.'17]. We can determine Lyndon words, factorize a word into Lyndon words in lexicographically non-increasing order, and find the Lyndon rotation of a word, all in linear time within constant additional working space. A recent research interest emerged from the question of what happens when we change the lexicographic order, which is at the heart of the definition of Lyndon words. In particular, the alternating order, where the order of all odd positions becomes reversed, has been recently proposed. While a Lyndon word is, among all its cyclic rotations, the smallest one with respect to the lexicographic order, a Galois word exhibits the same property by exchanging the lexicographic order with the alternating order. Unfortunately, this exchange has a large impact on the properties Galois words exhibit, which makes it a nontrivial task to translate results from Lyndon words to Galois words. Up until now, it has only been conjectured that linear-time algorithms with constant additional working space in the spirit of Duval's algorithm are possible for computing the Galois factorization or the Galois rotation. Here, we affirm this conjecture as follows. Given a word TT of length nn, we can determine whether TT is a Galois word, in O(n)O(n) time with constant additional working space. Within the same complexities, we can also determine the Galois rotation of TT, and compute the Galois factorization of TT online. The last result settles Open Problem~1 in [Dolce et al., TCS 2019] for Galois words.

Keywords

Cite

@article{arxiv.2403.02636,
  title  = {Algorithms for Galois Words: Detection, Factorization, and Rotation},
  author = {Diptarama Hendrian and Dominik Köppl and Ryo Yoshinaka and Ayumi Shinohara},
  journal= {arXiv preprint arXiv:2403.02636},
  year   = {2024}
}

Comments

16 pages,3 figures,accepted to CPM 2024

R2 v1 2026-06-28T15:09:18.320Z