Online and Dynamic Recognition of Squarefree Strings
The online squarefree recognition problem is to detect the first occurrence of a square in a string whose characters are provided as input one at a time. We present an efficient algorithm to solve this problem for strings over arbitrarily ordered alphabets. Its running time is O(n log n), where n is the ending position of the first square, which matches the running times of the fastest known algorithms for the analogous offline problem. We also present a very simple algorithm for a dynamic version of the problem over general alphabets in which we are initially given a squarefree string, followed by a series of updates, and the objective is to determine after each update if the resulting string contains a square and if so, report it and stop.
Unable to display preview. Download preview PDF.
- 4.Breslauer, D.: Efficient String Algorithmics. PhD thesis, Columbia University (1992)Google Scholar
- 6.Choffrut, C., Karhumäki, J.: Combinatorics of words. In: Salomaa, A., Rozenberg, G. (eds.) Handbook of Formal Languages, vol. 1, pp. 329–438. Springer, Heidelberg (1997)Google Scholar
- 13.Kumar, V.: Algorithms for constraint satisfaction problems: A survey. AI Magazine 12(1), 32–44 (1992)Google Scholar
- 14.Lee, J.H.M., Leung, H.-F., Won, H.W.: Performance of a comprehensive and efficient constraint library based on local search. In: Proceedings of the 11th Australian Joint Conference on Artificial Intelligence, pp. 191–202 (1998)Google Scholar
- 18.Main, M.G., Lorentz, R.J.: Linear time recognition of squarefree strings. In: Apostolico, A., Galil, Z. (eds.) Combinatorial Algorithms on Words. NATO ASI Series, vol. F 12, pp. 271–278. Springer, Heidelberg (1985)Google Scholar
- 19.Wong, J.H.Y., Leung, H.-F.: Solving fuzzy constraint satisfaction problems with fuzzy GENET. In: Proceedings of the 10th IEEE International Conference on Tools with Artificial Intelligence, pp. 184–191 (1998)Google Scholar