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 条
  • [1] Average-case Complexity
    Trevisan, Luca
    PROCEEDINGS OF THE 49TH ANNUAL IEEE SYMPOSIUM ON FOUNDATIONS OF COMPUTER SCIENCE, 2008, : 11 - 11
  • [2] Average-Case Complexity
    Bogdanov, Andrej
    Trevisan, Luca
    FOUNDATIONS AND TRENDS IN THEORETICAL COMPUTER SCIENCE, 2006, 2 (01): : 1 - 111
  • [3] Fast Average-Case Pattern Matching on Weighted Sequences
    Barton, Carl
    Liu, Chang
    Pissisy, Solon P.
    INTERNATIONAL JOURNAL OF FOUNDATIONS OF COMPUTER SCIENCE, 2018, 29 (08) : 1331 - 1343
  • [4] On the average-case complexity of Shellsort
    Vitanyi, Paul
    RANDOM STRUCTURES & ALGORITHMS, 2018, 52 (02) : 354 - 363
  • [5] STRUCTURAL AVERAGE-CASE COMPLEXITY
    SCHULER, R
    YAMAKAMI, T
    LECTURE NOTES IN COMPUTER SCIENCE, 1992, 652 : 128 - 139
  • [6] FAST AVERAGE-CASE PATTERN-MATCHING BY MULTIPLEXING SPARSE TABLES
    QUONG, RW
    THEORETICAL COMPUTER SCIENCE, 1992, 92 (01) : 165 - 179
  • [7] On the average-case complexity of underdetermined functions
    Chashkin, Aleksandr V.
    DISCRETE MATHEMATICS AND APPLICATIONS, 2018, 28 (04): : 201 - 221
  • [8] Distributional problems and the average-case complexity
    GROUP-BASED CRYPTOGRAPHY, 2008, : 99 - 115
  • [9] ON THE AVERAGE-CASE COMPLEXITY OF BUCKETING ALGORITHMS
    AKL, SG
    MEIJER, H
    JOURNAL OF ALGORITHMS-COGNITION INFORMATICS AND LOGIC, 1982, 3 (01): : 9 - 13
  • [10] Average-case quantum query complexity
    Ambainis, A
    de Wolf, R
    STACS 2000: 17TH ANNUAL SYMPOSIUM ON THEORETICAL ASPECTS OF COMPUTER SCIENCE, 2000, 1770 : 133 - 144