Efficient pattern matching with scaling

Abstract The problem of pattern matching with scaling is defined. The input for the two-dimensional version of the problem consists of an n × n “text” matrix and an m × m “pattern” matrix. We want to find all occurrences of the pattern in the text, scaled to all natural multiples. That is, for every natural number i, 1 ≤ i ≤ [ n m ] we seek all occurrences of the pattern in the text, where each character of the pattern corresponds to an i × i square in the text. This problem is useful for some tasks in computer vision. Our main contribution is a linear time algorithm for the problem. We also consider situations where the text is provided in a less redundant form. For instance, suppose that a repeating character is compressed into one character, along with the number of repetitions. We show how to enhance our algorithm so that its running time may become sublinear with respect to the original redundant input representation. Our algorithms are based on a new algorithmic approach to two-dimensional string matching. Unlike existing approaches, the new approach does not work by reducing a two-dimensional problem into an one-dimensional problem.

[1]  Uzi Vishkin,et al.  Matching Patterns in Strings Subject to Multi-Linear Transformations , 1988, Theor. Comput. Sci..

[2]  Robert E. Tarjan,et al.  Scaling and related techniques for geometry problems , 1984, STOC '84.

[3]  Uzi Vishkin,et al.  Deterministic Sampling - A New Technique for Fast Pattern Matching , 1991, SIAM J. Comput..

[4]  Uzi Vishkin,et al.  On Finding Lowest Common Ancestors: Simplification and Parallelization , 1988, AWOC.

[5]  Alfred V. Aho,et al.  Efficient string matching , 1975, Commun. ACM.

[6]  Azriel Rosenfeld,et al.  Digital Picture Processing , 1976 .

[7]  Peter Weiner,et al.  Linear Pattern Matching Algorithms , 1973, SWAT.

[8]  Uzi Vishkin,et al.  Recursive *-tree parallel data-structure , 1989, 30th Annual Symposium on Foundations of Computer Science.

[9]  Kamala Krithivasan,et al.  Efficient two-dimensional pattern matching in the presence of errors , 1987, Inf. Sci..

[10]  Robert E. Tarjan,et al.  Fast Algorithms for Finding Nearest Common Ancestors , 1984, SIAM J. Comput..

[11]  Esko Ukkonen,et al.  Finding Approximate Patterns in Strings , 1985, J. Algorithms.

[12]  M. Fischer,et al.  STRING-MATCHING AND OTHER PRODUCTS , 1974 .

[13]  Zvi Galil,et al.  An Improved Algorithm for Approximate String Matching , 1989, SIAM J. Comput..

[14]  Hanan Samet,et al.  The Design and Analysis of Spatial Data Structures , 1989 .

[15]  Uzi Vishkin,et al.  Highly parallelizable problems , 1989, STOC '89.

[16]  V AhoAlfred,et al.  Efficient string matching , 1975 .

[17]  Gad M. Landau,et al.  Fast Parallel and Serial Approximate String Matching , 1989, J. Algorithms.

[18]  Gad M. Landau,et al.  Fast parallel and serial multidimensional approximate array matching , 1990 .

[19]  Theodore P. Baker A Technique for Extending Rapid Exact-Match String Matching to Arrays of More Than One Dimension , 1978, SIAM J. Comput..

[20]  Robert S. Boyer,et al.  A fast string searching algorithm , 1977, CACM.

[21]  Edward M. McCreight,et al.  A Space-Economical Suffix Tree Construction Algorithm , 1976, JACM.

[22]  Uzi Vishkin,et al.  Optimal Parallel Pattern Matching in Strings (Extended Summary) , 1985, ICALP.

[23]  Donald E. Knuth,et al.  Fast Pattern Matching in Strings , 1977, SIAM J. Comput..

[24]  Zvi Galil,et al.  Time-Space-Optimal String Matching , 1983, J. Comput. Syst. Sci..

[25]  Zvi Galil,et al.  An Improved Algorithm for Approximate String Matching , 1989, ICALP.