String Matching in Case of Periodicity in the Pattern

  • Armen KostanyanEmail author
  • Ani Karapetyan
Conference paper
Part of the Studies in Systems, Decision and Control book series (SSDC, volume 199)


The string matching problem is an extensively studied computational problem having applications in many areas such as text editors, compilers, data compression, plagiarism detection, pattern recognition, etc. Dozens of algorithms have been designed to solve it. The finite automata method, Knuth-Morris-Pratt and Boyer-Moore algorithms are the ones of particular importance among them. The string matching in these algorithms is preceded by pattern preprocessing during which some structure supporting the string matching process is created, such as the finite automaton in the finite automata method and the table of prefix function in the Knuth-Morris-Pratt algorithm. The periodicity in pattern implies regularity in the supporting structure, which one can use to reduce the preprocessing time. In this paper, the problem of making the preprocessing phase more efficient in case of a periodic pattern is investigated for the finite automata method and the Knuth-Morris-Pratt algorithm. It is proved that the construction of supporting structure for the entire pattern in these cases can be reduced to its construction merely for the period of that pattern without affecting the processing of the text.


String matching Finite automata method Knuth-Morris-Pratt algorithm Periodic pattern 



This work was supported by the Ministry of Education and Science of the Republic of Armenia, project N 18T-1B341.


  1. 1.
    Boyer, R.S., Moore, J.S.: A Fast String Searching Algorithm. Programming Techniques, pp. 762–772 (1997)CrossRefGoogle Scholar
  2. 2.
    Knuth, D.E., Morris, J.H., Pratt, V.R.: Fast pattern matching in strings. SIAM J. Comput. 6, 323–350 (1997)MathSciNetCrossRefGoogle Scholar
  3. 3.
    Baeza-Yates, R., Gonnet, G.: A new approach to text searching. In: ACM SIGIR Forum, vol. 23, no. SI, pp. 68–175. ACM, New York (1992)Google Scholar
  4. 4.
    Navarro, G., Raffinot, M.: A bit-parallel approach to suffix automata: fast extended string matching. In: 9th Annual Symposium on Combinatorial Pattern, pp. 14–33. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  5. 5.
    Al-Khamaiseh, K., Al-Shagarin, S.: A survey of string matching algorithms. Int. J. Eng. Res. Appl. 4(7), 144–156 (2014)Google Scholar
  6. 6.
    Galil, Z.: On improving the worst case running time of the Boyer-Moore string matching algorithm. In: 5th International Colloquium on Automata, Languages and Programming, pp. 241–250. ACM, Italy (1978)CrossRefGoogle Scholar
  7. 7.
    Galil, Z., Seiferas, J.: Time-space optimal string matching. J. Comput. Syst. Sci. 26(3), 280–294 (1981)MathSciNetCrossRefGoogle Scholar
  8. 8.
    Huang, K., Chang, C.: Mining periodic patterns in sequence data. In: Data Warehousing and Knowledge Discovery, 6th International Conference, LNCS, vol. 3181, pp. 401–410. Springer, Spain (2004)CrossRefGoogle Scholar
  9. 9.
    Amir, A., Benson, G.: Detecting multiple periods and periodic patterns in event time sequences. In: Conference on Information and Knowledge Management, pp. 617–626. ACM, Singapore (2017)Google Scholar
  10. 10.
    Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 3rd edn. The MIT Press, USA (2009)zbMATHGoogle Scholar
  11. 11.
    Smyth, W.F.: Computing Patterns in Strings, 1st edn. Addison-Wesley, UK (2003)Google Scholar
  12. 12.
    Aho, A., Hopcroft, J., Ullman, J.: The Design and Analysis of Computer Algorithms, 1st edn. Addison-Wesley, UK (1974)zbMATHGoogle Scholar
  13. 13.
    Kostanyan A.: Fuzzy string matching with finite automata. In: Proceedings on 2017 IEEE Conference CSIT-2017, Yerevan, Armenia, pp. 25–29. IEEE Press, USA (2018)Google Scholar
  14. 14.
    Simon, I.: String matching algorithms and automata. In: Results and Trends in Theoretical Computer Science, pp. 386–395 (2005)Google Scholar
  15. 15.
    Apostolico, A., Breslauer, D., Galil, Z.: Optimal parallel algorithms for periods, palindromes and squares. In: 19th International Colloquium on Automata Languages and Programming, pp. 296–307. Springer, Berlin (1992)CrossRefGoogle Scholar

Copyright information

© Springer Nature Switzerland AG 2019

Authors and Affiliations

  1. 1.IT Educational and Research CenterYerevan State UniversityYerevanArmenia

Personalised recommendations