Optimal Parallel Algorithms for String Matching

Let WRAM [PRAM]be a parallel computer with p processors (RAMs) which share a common memory and are allowed simultaneous reads and writes [only simultaneous reads]. The only type of simultaneous writes allowed is a simultaneous AND: a subset of the processors may write 0 simultaneously into the same memory cell. Let t be the time bound of the computer. We design below families of parallel algorithms that solve the string matching problem with inputs of size n ( n is the sum of lengths of the pattern and the text) and have the following performance in terms of p, t and n : (1) For WRAM: pt = O ( n ) for p ⩽ n /log n (i.e., t ⩾ log n ). † (2) for PRAM: pt = O ( n ) for p ⩽ n /log 2 n (i.e., t ⩾ log 2 n ). (3) For WRAM: t = constant for p = n 1 + e and any e > 0. (4) For WRAM: t = O (log n /log log n ) for p = n . Similar families are also obtained for the problem of finding all initial palindromes of a given string.

[1]  Richard M. Karp,et al.  Efficient Randomized Pattern-Matching Algorithms , 1987, IBM J. Res. Dev..

[2]  Faith Ellen,et al.  Relations between concurrent-write models of parallel computation , 1984, PODC '84.

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

[4]  Leslie G. Valiant,et al.  Parallelism in Comparison Problems , 1975, SIAM J. Comput..

[5]  Alfred V. Aho,et al.  The Design and Analysis of Computer Algorithms , 1974 .

[6]  Franco P. Preparata,et al.  The cube-connected-cycles: A versatile network for parallel computation , 1979, 20th Annual Symposium on Foundations of Computer Science (sfcs 1979).

[7]  Allan Borodin,et al.  Routing, merging and sorting on parallel models of computation , 1982, STOC '82.

[8]  Arnold L. Rosenberg,et al.  Rapid identification of repeated patterns in strings, trees and arrays , 1972, STOC.

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

[10]  Uzi Vishkin,et al.  Finding the maximum, merging and sorting in a parallel computation model , 1981, CONPAR.

[11]  M. Schützenberger,et al.  The equation $a^M=b^Nc^P$ in a free group. , 1962 .

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

[13]  Stephen A. Cook,et al.  Bounds on the time for parallel RAM's to compute simple functions , 1982, STOC '82.

[14]  Uzi Vishkin,et al.  Optimal parallel generation of a computation tree form , 1985, TOPL.

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