On the structure of compacted subword graphs of Thue–Morse words and their applications

Jakub Radoszewski, Wojciech Rytter
2012 Journal of Discrete Algorithms  
We investigate how syntactic properties of Thue-Morse words are related to special type of automata/graphs. The directed acyclic subword graph (dawg, in short) is a useful deterministic automaton accepting all suxes of the word. Its compacted version (resulted by compressing chains of states) is denoted by cdawg. The cdawgs of Thue-Morse words have regular and very simple structure, in particular they oer a powerful (exponential) compression of the set of all subwords in case of nite Thue-Morse
more » ... words. Using the special structure of cdawgs we present several unknown properties of Thue-Morse words as well as new (graph-based) proofs of some well-known properties. In particular we show a simple algorithm that checks, for a given string w, if w is a subword of a Thue-Morse word and computes its number of occurrences in nth Thue-Morse word in O(|w| + log n) time and O(1) space. Additionally, a slight modication of the compact dawg of the innite Thue-Morse word yields an innite graph with 2-counting property.
doi:10.1016/j.jda.2011.01.001 fatcat:zwcdbja6azbulpp3d42pkdb2fe