Table of Contents
Fetching ...

Algorithms for Galois Words: Detection, Factorization, and Rotation

Diptarama Hendrian, Dominik Köppl, Ryo Yoshinaka, Ayumi Shinohara

TL;DR

The paper addresses efficient processing of Galois words—words minimal under the alternating order—by developing a Duval-style framework. It yields $O(n)$-time, $O(1)$-space algorithms for Galois word testing, Galois rotation, and online Galois factorization, resolving Open Problem 1 from Dolce et al. (2019). The work introduces SPref-based factorization and proves a linear-time Galois rotation method, enabling space-efficient construction of alternating-BWT variants indexed to Galois words. These results bridge combinatorial theory with practical, low-memory text indexing applications, advancing both theory and potential implementations in compressed indexing workflows.

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 $T$ of length $n$, we can determine whether $T$ is a Galois word, in $O(n)$ time with constant additional working space. Within the same complexities, we can also determine the Galois rotation of $T$, and compute the Galois factorization of $T$ online. The last result settles Open Problem~1 in [Dolce et al., TCS 2019] for Galois words.

Algorithms for Galois Words: Detection, Factorization, and Rotation

TL;DR

The paper addresses efficient processing of Galois words—words minimal under the alternating order—by developing a Duval-style framework. It yields -time, -space algorithms for Galois word testing, Galois rotation, and online Galois factorization, resolving Open Problem 1 from Dolce et al. (2019). The work introduces SPref-based factorization and proves a linear-time Galois rotation method, enabling space-efficient construction of alternating-BWT variants indexed to Galois words. These results bridge combinatorial theory with practical, low-memory text indexing applications, advancing both theory and potential implementations in compressed indexing workflows.

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 of length , we can determine whether is a Galois word, in time with constant additional working space. Within the same complexities, we can also determine the Galois rotation of , and compute the Galois factorization of online. The last result settles Open Problem~1 in [Dolce et al., TCS 2019] for Galois words.
Paper Structure (10 sections, 27 theorems, 5 equations, 3 figures, 1 table)

This paper contains 10 sections, 27 theorems, 5 equations, 3 figures, 1 table.

Key Result

Lemma 1

Let $p$ and $q$ be periods of a word $T$. If $p + q - r \le |T|$, then $r$ is also a period of $T$, where $r$ is the greatest common divisor of $p$ and $q$.

Figures (3)

  • Figure 1: Left: Sketch of the proofs of \ref{['lem:PreGaloisPerOdd']} and \ref{['lem:PreGaloisPerEven']}. Right: Sketch of the proof of \ref{['lemGaloisRoot']}. As both Galois roots are prefixes of $T$, we obtain a border $X$ of $G_2$ with even length which contradicts \ref{['lem:OddBorder']}.
  • Figure 2: Sketch of the proof of \ref{['lem:isPreGalois']}. The caption $p_e$ can be also considered as $p_o$ for the latter case.
  • Figure 3: Sketch of the proof of \ref{['lem:factorPrefix']} (left) and of \ref{['lem:factorprefixeven']} (right).

Theorems & Definitions (49)

  • Example 1
  • Lemma 1: fine65uniqueness
  • Lemma 2: dolce19generalized
  • Lemma 3: dolce19generalized
  • Lemma 4: dolce19generalized, reutenauer05mots
  • Definition 1: Pre-Galois word
  • Lemma 5
  • proof
  • Lemma 6
  • proof
  • ...and 39 more