An Efficient Algorithm for the All Pairs Suffix-Prefix Problem
For a pair of strings (S 1, S 2), define the suffix-prefix match of (S 1, S 2) to be the longest suffix of string S 1 that matches a prefix of string S 2. The following problem is considered in this paper. Given a collection of strings S 1 , S 2,..., S k of total length m, find the suffix-prefix match for each of the k(k - 1) ordered pairs of strings. We present an algorithm that solves the problem in O(m + k 2) time, for any fixed alphabet. Since the size of the input is O(m) and the size of the output is O(k 2 ) this solution is optimal.
KeywordsInternal Vertex Depth First Search Linear Time Algorithm Suffix Tree Special Symbol
Unable to display preview. Download preview PDF.
- [BJLTY91]A. Blum, T. Jiang, M. Li, J. Tromp, and M. Yanakakis. Linear approximation of shortest superstrings. In Proc. of the 23rd ACM Symp. on Theory of Computing, 328–336, 1991.Google Scholar
- [KM89]J. Kececioglu and E. Myers. A procedural interface for a fragment assembly tool. Technical Report TR 89–5, University of Arizona, Computer Science Dept., April 1989.Google Scholar
- [KM91]J. Kececioglu and E. Myers. A robust and automatic fragment assembly system, 1991. Manuscript.Google Scholar
- [Les88]A. Lesk, editor. Computational Molecular Biology, Sources and Methods for Sequence Analysis. Oxford University Press, Oxford, UK, 1988.Google Scholar
- [Tar83]R.E. Tarjan. Data Structures and Network Algorithms. CBMS-NSF Regional Conference Series in Applied Math. SIAM, Philadelphia, PA, 1983.Google Scholar