Elsevier

Journal of Algorithms

Volume 24, Issue 2, August 1997, Pages 223-265
Journal of Algorithms

Regular Article
Multi-Dimensional Pattern Matching with Dimensional Wildcards: Data Structures and Optimal On-Line Search Algorithms,☆☆

https://doi.org/10.1006/jagm.1996.0844Get rights and content

Abstract

We introduce a new multidimensional pattern matching problem that is a natural generalization of string matching, a well studied problem1. The motivation for its algorithmic study is mainly theoretical. LetA[1:n1,…,1:nd] be a text matrix withN = n1ndentries andB[1:m1,…,1:mr] be a pattern matrix withM = m1mrentries, whered  r  1 (the matrix entries are taken from an ordered alphabet Σ). We study the problem of checking whether somer-dimensional submatrix ofAis equal toB(i.e., adecisionquery).Acan be preprocessed andBis given on-line. We define a new data structure for preprocessingAand propose CRCW-PRAM algorithms that build it inO(log N) time withN2/nmaxprocessors, wherenmax = max(n1,…,nd), such that the decision query forBtakesO(M) work andO(log M) time. By using known techniques, we would get the same preprocessing bounds but anO((dr)M) work bound for the decision query. The latter bound is undesirable since it can depend exponentially ond; our bound, in contrast, is independent ofdand optimal. We can also answer, in optimal work, two further types of queries: (a) anenumerationquery retrieving all ther-dimensional submatrices ofAthat are equal toBand (b) anoccurrencequery retrieving only the distinct positions inAthat correspond to all of these submatrices. As a byproduct, we also derive the first efficient sequential algorithms for the new problem.

References (38)

  • A. Apostolico et al.

    Parallel construction of a suffix tree with applications

    Algorithmica

    (1988)
  • A.V. Aho et al.

    The Design and Analysis of Computer Algorithms

    (1974)
  • R. Cole, M. Crochemore, Z. Galil, L. Gasieniec, R. Hariharan, S. Muthukrishnan, K. Park, W. Rytter, 1993, Optimally...
  • R. Cole et al.

    The accelerated centroid decomposition technique for optimal parallel tree evaluation in logarithmic time

    Algorithmica

    (1988)
  • M.J. Fischer et al.

    Parallel prefix computation

    Assoc. Comput. Mach.

    (1980)
  • M.J. Fischer et al.

    String matching and other products

  • Z. Galil, K. Park, 1992, A truly alphabet independent two-dimensional pattern matching algorithm, Proceedings, 33th...
  • R. Giancarlo

    An index data structure for matrices, with applications to fast two-dimensional pattern matching

    Proceedings, Workshop on Algorithms and Data Structures

    (1993)
  • Cited by (11)

    • Distance measure for video sequences

      1999, Computer Vision and Image Understanding
    • Image Analysis and Computer Vision: 1997

      1998, Computer Vision and Image Understanding
    • Tree-based 2D indexing

      2011, International Journal of Foundations of Computer Science
    View all citing articles on Scopus

    Work partially supported by MURST of Italy. An extended abstract related to this paper has been presented at the 6th Annual Symposium on Combinatorial Pattern Matching, Helsinki, 1995.

    ☆☆

    J. van Leeuwen, Ed.

    Part of this work was done while the author was a member of technical staff at AT&T Bell Laboratories, Murray Hill, NJ 07974, U.S.A. E-mail: [email protected].

    Part of this work was done while the author was visiting AT&T Bell Laboratories. E-mail: [email protected].

    View full text