Multiple Matching of Rectangular Patterns

We describe the first worst-case efficient algorithm for simultaneously matching multiple rectangular patterns of varying sizes and aspect ratios in a rectangular text. Efficient means significantly more efficient asymptotically than applying known algorithms that handle one height (or width or aspect ratio) at a time for each height. Our algorithm features an interesting use of multidimensional range searching, as well as new adaptations of several known techniques for two-dimensional string matching. We also extend our algorithm to a dynamic setting where the set of patterns can change over time.

[1]  R.S. Bird,et al.  Two Dimensional Pattern Matching , 1977, Inf. Process. Lett..

[2]  Paul F. Dietz,et al.  Two algorithms for maintaining order in a list , 1987, STOC.

[3]  Mark H. Overmars,et al.  The Design of Dynamic Data Structures , 1987, Lecture Notes in Computer Science.

[4]  Gaston H. Gonnet,et al.  Handbook Of Algorithms And Data Structures , 1984 .

[5]  Ricardo Baeza-Yates,et al.  Fast Algorithms for Two Dimensional and Multiple Pattern Matching (Preliminary Version) , 1990, SWAT.

[6]  Zvi Galil,et al.  Truly alphabet-independent two-dimensional pattern matching , 1992, Proceedings., 33rd Annual Symposium on Foundations of Computer Science.

[7]  George S. Lueker,et al.  Adding range restriction capability to dynamic data structures , 1985, JACM.

[8]  Raffaele Giancarlo,et al.  The Suffix of a square matrix, with applications , 1993, SODA '93.

[9]  Hermann A. Maurer,et al.  Efficient worst-case data structures for range searching , 1978, Acta Informatica.

[10]  Alejandro A. Schäffer,et al.  Dynamic Dictionary Matching with Failure Functions (Extended Abstract) , 1992, CPM.

[11]  Ricardo A. Baeza-Yates,et al.  An Algorithm for String Matching with a Sequence of don't Cares , 1991, Inf. Process. Lett..

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

[13]  Bertrand Meyer Incremental String Matching , 1985, Inf. Process. Lett..

[14]  Alejandro A. Schäffer,et al.  Improved dynamic dictionary matching , 1995, SODA '93.

[15]  Amihood Amir,et al.  Efficient 2-dimensional approximate matching of non-rectangular figures , 1991, SODA '91.

[16]  Gad M. Landau,et al.  Efficient pattern matching with scaling , 1990, SODA '90.

[17]  Raffaele Giancarlo,et al.  Dynamic Dictionary Matching , 1994, J. Comput. Syst. Sci..

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

[19]  Mark H. Overmars,et al.  On the Equivalence of Some Rectangle Problems , 1982, Inf. Process. Lett..

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

[21]  Gary Benson,et al.  Alphabet independent two dimensional matching , 1992, STOC '92.

[22]  Gaston H. Gonnet Efficient Two-dimensional Searching , 1992, SWAT.

[23]  Amihood Amir,et al.  Adaptive dictionary matching , 1991, [1991] Proceedings 32nd Annual Symposium of Foundations of Computer Science.

[24]  Chak-Kuen Wong,et al.  Finding Intersection of Rectangles by Range Search , 1981, J. Algorithms.

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

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