New Variants of Pattern Matching with Constants and Variables

Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10706)


Given a text and a pattern over two types of symbols called constants and variables, the parameterized pattern matching problem is to find all occurrences of substrings of the text that the pattern matches by substituting a variable in the text for each variable in the pattern, where the substitution should be injective. The function matching problem is a variant of it that lifts the injection constraint. In this paper, we discuss variants of those problems, where one can substitute a constant or a variable for each variable of the pattern. We give two kinds of algorithms for both problems, a convolution-based method and an extended KMP-based method, and analyze their complexity.


Pattern matching Parameterized pattern matching Function matching Parameterized pattern queries 



This work is supported by Tohoku University Division for Interdisciplinary Advance Research and Education, ImPACT Program of Council for Science, Technology and Innovation (Cabinet Office, Government of Japan), and JSPS KAKENHI Grant Number JP15H05706.


  1. 1.
    Amir, A., Aumann, Y., Lewenstein, M., Porat, E.: Function matching. SIAM J. Comput. 35(5), 1007–1022 (2006)MathSciNetCrossRefzbMATHGoogle Scholar
  2. 2.
    Amir, A., Farach, M., Muthukrishnan, S.: Alphabet dependence in parameterized matching. Inf. Process. Lett. 49(3), 111–115 (1994)CrossRefzbMATHGoogle Scholar
  3. 3.
    Amir, A., Nor, I.: Generalized function matching. J. Discrete Algorithms 5(3), 514–523 (2007)MathSciNetCrossRefzbMATHGoogle Scholar
  4. 4.
    Baker, B.S.: Parameterized pattern matching: algorithms and applications. J. Comput. Syst. Sci. 52(1), 28–42 (1996)MathSciNetCrossRefzbMATHGoogle Scholar
  5. 5.
    Cole, R., Hariharan, R.: Verifying candidate matches in sparse and wildcard matching. In: Proceedings of the Thirty-Fourth Annual ACM Symposium on Theory of Computing, pp. 592–601. ACM (2002)Google Scholar
  6. 6.
    Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C., et al.: Introduction to algorithms, vol. 44, pp. 97–138. MIT Press, Cambridge (1990)zbMATHGoogle Scholar
  7. 7.
    Du Mouza, C., Rigaux, P., Scholl, M.: Parameterized pattern queries. Data Knowl. Eng. 63(2), 433–456 (2007)CrossRefGoogle Scholar
  8. 8.
    Fischer, M.J., Paterson, M.S.: String-matching and other products. Technical report, DTIC Document (1974)Google Scholar
  9. 9.
    Igarashi, Y.: A study on the parameterized pattern matching problems for real data (in Japanese). Bachelor thesis, Tohoku University (2017)Google Scholar
  10. 10.
    Igarashi, Y., Diptarama, Yoshinaka, R., Shinohara, A.: New variants of pattern matching with constants and variables. CoRR abs/1705.09504 (2017)Google Scholar
  11. 11.
    Iliopoulos, C.S., Rahman, M.S.: Pattern matching algorithms with don’t cares. In: Proceedings of the 33rd SOFSEM, pp. 116–126. Citeseer (2007)Google Scholar
  12. 12.
    Knuth, D.E., Morris Jr., J.H., Pratt, V.R.: Fast pattern matching in strings. SIAM J. Comput. 6(2), 323–350 (1977)MathSciNetCrossRefzbMATHGoogle Scholar
  13. 13.
    Mendivelso, J., Pinzón, Y.J.: Parameterized matching: solutions and extensions. In: Stringology, pp. 118–131. Citeseer (2015)Google Scholar
  14. 14.
    Tarjan, R.E.: Efficiency of a good but not linear set union algorithm. J. ACM (JACM) 22(2), 215–225 (1975)MathSciNetCrossRefzbMATHGoogle Scholar

Copyright information

© Springer International Publishing AG 2018

Authors and Affiliations

  1. 1.Graduate School of Information SciencesTohoku UniversityAoba-ku, SendaiJapan

Personalised recommendations