On the average-case complexity of pattern matching with wildcards

被引:1
|
作者
Barton, Carl [1 ]
机构
[1] Birkbeck Univ London, Malet St, London WC1E 7HX, England
关键词
Average case complexity; Pattern matching with wildcards; Stringology; Pattern matching; Pattern matching with don't care symbols;
D O I
10.1016/j.tcs.2022.04.009
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
Pattern matching with wildcards is a string matching problem with the goal of finding all factors of a text t of length n that match a pattern x of length m, where wildcards (characters that match everything) may be present. In this paper we present a number of complexity results and fast average-case algorithms for pattern matching where wildcards are allowed in the pattern, however, the results are easily adapted to the case where wildcards are allowed in the text as well. We analyse the average-case complexity of these algorithms and derive non-trivial time bounds. These are the first results on the average-case complexity of pattern matching with wildcards which provide a provable separation in time complexity between exact pattern matching and pattern matching with wildcards. We introduce the wc-period of a string which is the period of the binary mask x(b) where x(b)[i] = a iff x[i] not equal phi and b otherwise. We denote the length of the wc-period of a string x by wcp(x). We show the following results for constant 0 < epsilon < 1 and a pattern xof length m and gwildcards with wcp(x) = p the prefix of length p contains g(p) wildcards: If lim(m ->infinity) g(p)/p= 0 there is an optimal algorithm running in O(nlog(sigma)m/m)-time on average. If lim(m ->infinity) g(p)/p= 1 - epsilon there is an algorithm running in O(nlog(sigma)mlog(2)p/m)-time on average. If lim(m ->infinity) g/m= lim(m ->infinity) 1 - f(m) = 1 any algorithm takes at least Omega(nlog(sigma)m/f(m))-time on average. (C) 2022 The Author(s). Published by Elsevier B.V.
引用
收藏
页码:37 / 45
页数:9
相关论文
共 50 条
  • [31] Online Pattern Matching with Wildcards
    Qiang, Jipeng
    Tian, Weidong
    Guo, Dan
    Wu, Xindong
    2012 IEEE INTERNATIONAL CONFERENCE ON GRANULAR COMPUTING (GRC 2012), 2012, : 394 - 399
  • [32] Pattern Matching with Flexible Wildcards
    Xindong Wu
    Ji-Peng Qiang
    Fei Xie
    Journal of Computer Science and Technology, 2014, 29 : 740 - 750
  • [33] Pattern Matching with Flexible Wildcards
    Wu, Xindong
    Qiang, Ji-Peng
    Xie, Fei
    JOURNAL OF COMPUTER SCIENCE AND TECHNOLOGY, 2014, 29 (05) : 740 - 750
  • [34] Pattern Matching with Flexible Wildcards
    吴信东
    强继朋
    谢飞
    Journal of Computer Science & Technology, 2014, 29 (05) : 740 - 751
  • [35] Relations between Average-Case and Worst-Case Complexity
    A. Pavan
    N. V. Vinodchandran
    Theory of Computing Systems, 2008, 42 : 596 - 607
  • [36] Pseudorandomness and average-case complexity via uniform reductions
    Trevisan, Luca
    Vadhan, Salil
    COMPUTATIONAL COMPLEXITY, 2007, 16 (04) : 331 - 364
  • [37] Average-case bounds for the complexity of path-search
    Pippenger, N
    ADVANCES IN SWITCHING NETWORKS, 1998, 42 : 1 - 13
  • [38] Average-case complexity and decision problems in group theory
    Kapovich, I
    Myasnikov, A
    Schupp, P
    Shpilrain, V
    ADVANCES IN MATHEMATICS, 2005, 190 (02) : 343 - 359
  • [39] Relations between average-case and worst-case complexity
    Pavan, A.
    Vinodchandran, N. V.
    THEORY OF COMPUTING SYSTEMS, 2008, 42 (04) : 596 - 607
  • [40] Relations between average-case and worst-case complexity
    Pavan, A
    Vinodchandran, NV
    FUNDAMENTALS OF COMPUTATIONAL THEORY, PROCEEDINGS, 2005, 3623 : 422 - 432