This Article 
 Bibliographic References 
 Add to: 
The Design of Efficient Algorithms for Two-Dimensional Pattern Matching
April 1995 (vol. 7 no. 2)
pp. 318-327

Abstract—The two-dimensional pattern matching problem is to find the occurrences of a given two-dimensional pattern array in a two-dimensional text array. This paper presents two efficient algorithms, which combine Fan-Su and Aho-Corasick string search algorithms, to solve this problem. The proposed algorithms need not inspect each character of the text array during the pattern matching in most cases. Additionally, unlike the algorithms proposed by Zhu and Takaoka which are based on the hashing method, these new algorithms require no preprocessing of the text array. The comparison of the performance among various algorithms are depicted in this paper. The result shows that the proposed algorithms are about three to six times faster than the best algorithm proposed previously when the size of the pattern array is less than 1/100 of the size of the text array, which occurs frequently in many applications.

[1] T.P. Baker,“A technique for extending rapid exact-match string matching to arrays of more than one dimension,” SIAMJ. Comput., vol. 7, pp. 533-541, Nov. 1978.
[2] D.E. Knuth,J.H. Morris,, and V.R. Pratt,“Fast pattern matching in strings,” SIAMJ. Comput., vol. 6, pp. 323-350, June 1977.
[3] R.S. Bird,“Two dimensional pattern matching,” Information Processing Letters, vol. 6, pp. 168-170, Oct. 1977.
[4] A.V. Aho and M.J. Corasick, “Efficient String Matching: An Aid to Bibliographic Search,” Comm. ACM, vol. 18, pp. 333-340, June 1979.
[5] R.F. Zhu and T. Takaoka, “A Technique for Two-Dimensional Pattern Matching,” Comm. ACM, vol. 32, no. 9, pp. 1110-1120, Sept. 1989.
[6] R. Sedgewick,Algorithms. Reading, MA: Addison-Wesley, 1983.
[7] R.S. Boyer and J.S. Moore, “A Fast String Searching Algorithm,” Comm. ACM, vol. 20 pp. 762-772, Oct. 1977.
[8] J.J. Fan and K.Y. Su, “An Efficient Algorithm for Matching Multiple Patterns,” IEEE Trans. Knowledge and Data Eng., vol. 5, pp. 339-351, Dec. 1993.
[9] Z. Galil,“On improving the worst case running time of the Boyer-Moore string matching algorithm,” Comm. ACM, vol. 22, pp. 505-508, Sept. 1979.

Index Terms:
Two-dimensional pattern matching, multiple-pattern matching, algorithms, finite state automata, computational complexity.
Jang-Jongm Fanm, Keh-Yih Su, "The Design of Efficient Algorithms for Two-Dimensional Pattern Matching," IEEE Transactions on Knowledge and Data Engineering, vol. 7, no. 2, pp. 318-327, April 1995, doi:10.1109/69.382300
Usage of this product signifies your acceptance of the Terms of Use.