Linear-Time Version of Holub’s Algorithm for Morphic Imprimitivity Testing
Stepan Holub (Discr. Math., 2009) gave the first polynomial algorithm deciding whether a given word is a nontrivial fixed point of a morphism. His algorithm works in quadratic time for large alphabets. We improve the algorithm to work in linear time. Our improvement starts with a careful choice of a subset of rules used in Holub’s algorithm that is necessary to grant correctness of the algorithm.Afterwards we show how to choose the order of applying the rules that allows to avoid unnecessary operations on sets. We obtain linear time using efficient data structures for implementation of the rules. Holub’s algorithm maintains connected components of a graph corresponding to specially marked positions in a word. This graph is of quadratic size for large alphabet. In our algorithm only a linear number of edges of this conceptual graph is processed.
Unable to display preview. Download preview PDF.
- 1.Crochemore, M., Hancart, C., Lecroq, T.: Algorithms on Strings. Cambridge University Press (2007)Google Scholar
- 3.Gabow, H.N., Tarjan, R.E.: A linear-time algorithm for a special case of disjoint set union. In: Proceedings of the 15th Annual ACM Symposium on Theory of Computing (STOC), pp. 246–251 (1983)Google Scholar
- 6.Head, T., Lando, B.: Fixed and stationary ω-words and ω-languages. In: Rozenberg, G., Salomaa, A. (eds.) The Book of L, pp. 147–156. Springer (1986)Google Scholar
- 7.Holub, S.: Algorithm for fixed points of morphisms — visualization, http://www.karlin.mff.cuni.cz/~holub/soubory/Vizual/stranka2.html
- 10.Matocha, V., Holub, S.: Complexity of testing morphic primitivity. CoRR abs/1207.5690v1 (2012)Google Scholar