Hostname: page-component-76fb5796d-9pm4c Total loading time: 0 Render date: 2024-04-25T10:33:30.440Z Has data issue: false hasContentIssue false

The longest common substring problem

Published online by Cambridge University Press:  29 May 2015

MAXIME CROCHEMORE
Affiliation:
Department of Informatics, King's College London, London, UK Email: Maxime.Crochemore@kcl.ac.uk, Costas.Iliopoulos@kcl.ac.uk, Alessio.Langiu@kcl.ac.uk Université Paris-Est, Marne-La-Vallée, France
COSTAS S. ILIOPOULOS
Affiliation:
Department of Informatics, King's College London, London, UK Email: Maxime.Crochemore@kcl.ac.uk, Costas.Iliopoulos@kcl.ac.uk, Alessio.Langiu@kcl.ac.uk
ALESSIO LANGIU
Affiliation:
Department of Informatics, King's College London, London, UK Email: Maxime.Crochemore@kcl.ac.uk, Costas.Iliopoulos@kcl.ac.uk, Alessio.Langiu@kcl.ac.uk DMI, Università degli Studi di Palermo, Palermo, Italy
FILIPPO MIGNOSI
Affiliation:
DISIM, Università dell'Aquila, L'Aquila, Italy Email: Filippo.Mignosi@di.univaq.it

Abstract

Given a set $\mathcal{D}$ of q documents, the Longest Common Substring (LCS) problem asks, for any integer 2 ⩽ kq, the longest substring that appears in k documents. LCS is a well-studied problem having a wide range of applications in Bioinformatics: from microarrays to DNA sequences alignments and analysis. This problem has been solved by Hui (2000International Journal of Computer Science and Engineering15 73–76) by using a famous constant-time solution to the Lowest Common Ancestor (LCA) problem in trees coupled with the use of suffix trees.

In this article, we present a simple method for solving the LCS problem by using suffix trees (STs) and classical union-find data structures. In turn, we show how this simple algorithm can be adapted in order to work with other space efficient data structures such as the enhanced suffix arrays (ESA) and the compressed suffix tree.

Type
Paper
Copyright
Copyright © Cambridge University Press 2015 

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

References

Abeliuk, A., Cánovas, R. and Navarro, G. (2013). Practical compressed suffix trees. Algorithms 6 (2) 319351.Google Scholar
Abouelhoda, M. I., Kurtz, S. and Ohlebusch, E. (2004). Replacing suffix trees with enhanced suffix arrays. Journal of Discrete Algorithms 2 (1) 5386.Google Scholar
Aho, A. V., Hopcroft, J. E. and Ullman, J. D. (1976). On finding lowest common ancestors in trees. SIAM Journal on Computing 5 (1) 115132.CrossRefGoogle Scholar
Alstrup, S., Gørtz, I. L., Rauhe, T., Thorup, M. and Zwick, U. (2005). Union-find with constant time deletions. In: Caires, L., Italiano, G. F., Monteiro, L., Palamidessi, C. and Yung, M. (eds.) ICALP, Springer Lecture Notes in Computer Science 3580 7889.Google Scholar
Ben-Amram, A. M. and Yoffe, S. (2011). A simple and efficient union-find-delete algorithm. Theoretical Computer Science 412 (4–5) 487492.Google Scholar
Bender, M. A. and Farach-Colton, M. (2000). The LCA problem revisited. In: Gonnet, G. H., Panario, D. and Viola, A. (eds.) Proceedings of the Theoretical Informatics, 4th Latin American Symposium, Punta del Este, Uruguay, April 10–14, 2000. Springer Lecture Notes in Computer Science 1776 8894.Google Scholar
Berkman, O. and Vishkin, U. (1993). Recursive star-tree parallel data structure. SIAM Journal on Computing 22 (2) 221242.CrossRefGoogle Scholar
Breslauer, D. and Italiano, G. F. (2013). Near real-time suffix tree construction via the fringe marked ancestor problem. Journal of Discrete Algorithms 18 3248.Google Scholar
Crochemore, M., Hancart, C. and Lecroq, T. (2007). Algorithms on Strings. Cambridge University Press, 392.Google Scholar
Dillencourt, M. B., Samet, H. and Tamminen, M. (1992). A general approach to connected-component labelling for arbitrary image representations. Journal of ACM 39 (2) 253280.Google Scholar
Farach-Colton, M., Ferragina, P. and Muthukrishnan, S. (November 2000). On the sorting-complexity of suffix tree construction. Journal of ACM 47 (6) 9871011.CrossRefGoogle Scholar
Fiorio, C. and Gustedt, J. (1996). Two linear time Union-Find strategies for image processing. Theoretical Computer Science 154 (2) 165181.Google Scholar
Fischer, J. and Heun, V. (2006). Theoretical and practical improvements on the RMQ-problem, with applications to LCA and LCE. In: Lewenstein, M. and Valiente, G. (eds.) CPM, Springer Lecture Notes in Computer Science 4009 3648.Google Scholar
Fischer, J. and Heun, V. (2007). A new succinct representation of RMQ-information and improvements in the enhanced suffix array. In: Chen, B., Paterson, M. and Zhang, G. (eds.) ESCAPE, Springer Lecture Notes in Computer Science 4614 459470.Google Scholar
Fischer, J. and Heun, V. (2008). Range median of minima queries, super-cartesian trees, and text indexing. In: Miller, M. and Wada, K. (eds.) IWOCA, College Publications 239252.Google Scholar
Fischer, J., Mäkinen, V. and Navarro, G. (2009). Faster entropy-bounded compressed suffix trees. Theoretical Computer Science 410 (51) 53545364.Google Scholar
Gabow, H. N. and Tarjan, R. E. (1985). A linear-time algorithm for a special case of disjoint set union. Journal of Computer and System Sciences 30 (2) 209221.Google Scholar
Gagie, T., Kärkkäinen, J., Navarro, G. and Puglisi, S. J. (2013). Colored range queries and document retrieval. Theoretical Computer Science 483 3650.Google Scholar
Galil, Z. and Italiano, G. F. (1991). Data structures and algorithms for disjoint set union problems. ACM Computing Surveys 23 (3) 319344.Google Scholar
Gog, S. and Ohlebusch, E. (2013). Compressed suffix trees: Efficient computation and storage of LCP-values. ACM Journal of Experimental Algorithmics 18 2.1:12.1:31.Google Scholar
Gonnet, G. H., Panario, D. and Viola, A. (eds.) (2000). In: Proceedings of the LATIN Theoretical Informatics, 4th Latin American Symposium, Punta del Este, Uruguay, April 10–14, 2000. Springer Lecture Notes in Computer Science 1776.Google Scholar
Grossi, R. and Vitter, J. S. (2005). Compressed suffix arrays and suffix trees with applications to text indexing and string matching. SIAM Journal on Computing 35 (2) 378407.Google Scholar
Gusfield, D. (1997). Algorithms on Strings, Trees, and Sequences – Computer Science and Computational Biology, Cambridge University Press.Google Scholar
Gustedt, J. (1998). Efficient Union-Find for planar graphs and other sparse graph classes. Theoretical Computer Science 203 (1) 123141.Google Scholar
Harel, D. and Tarjan, R. E. (1984). Fast algorithms for finding nearest common ancestors. SIAM Journal on Computing 13 (2) 338355.Google Scholar
Hui, L. C. K. (1992). Color set size problem with application to string matching. In: Apostolico, A., Crochemore, M., Galil, Z. and Manber, U. (eds.) CPM, Springer Lecture Notes in Computer Science 644 230243.Google Scholar
Hui, L. C. K. (2000). A practical algorithm to find longest common substring in linear time. International Journal of Computer Science and Engineering 15 7376.Google Scholar
Kärkkäinen, J., Sanders, P. and Burkhardt, S. (2006). Simple linear work suffix array construction. Journal of ACM 53 (6) 918936.Google Scholar
Kim, D. K., Kim, M. and Park, H. (2008). Linearized suffix tree: An efficient index data structure with the capabilities of suffix trees and suffix arrays. Algorithmica 52 (3) 350377.Google Scholar
Kim, D. K. and Park, H. (2005). A new compressed suffix tree supporting fast search and its construction algorithm using optimal working space. In: Apostolico, A., Crochemore, M. and Park, K. (eds.) CPM. Springer Lecture Notes in Computer Science 3537 3344.Google Scholar
Kim, D. K., Sim, J. S., Park, H. and Park, K. (2005). Constructing suffix arrays in linear time. Journal of Discrete Algorithms 3 (2–4) 126142.Google Scholar
Ko, P. and Aluru, S. (2005). Space efficient linear time construction of suffix arrays. Journal of Discrete Algorithms 3 (2–4) 143156.Google Scholar
Lin, J., Jiang, Y. and Adjeroh, D. A. (2009). The virtual suffix tree. International Journal of Foundations of Computer Science 20 (6) 11091133.Google Scholar
Loebl, M. and Nesetril, J. (1988a). Linearity and unprovability of set union problem strategies. In: Simon, J. (eds.) STOC, ACM 360366.Google Scholar
Loebl, M. and Nesetril, J. (1988b). Postorder hierarchy for path compressions and set union. In: Dassow, J. and Kelemen, J. (eds.) IMYCS, Springer Lecture Notes in Computer Science 381 146151.Google Scholar
Lucas, J. M. (1990). Postorder disjoint set union is linear. SIAM Journal on Computing 19 (5) 868882.Google Scholar
Manber, U. and Myers, E. W. (1993). Suffix arrays: A new method for on-line string searches. SIAM Journal on Computing 22 (5) 935948.Google Scholar
McCreight, E. M. (1976). A space-economical suffix tree construction algorithm. Journal of ACM 23 (2) 262272.Google Scholar
Navarro, G. (March 2014) Spaces, trees, and colors: The algorithmic landscape of document retrieval on sequences. ACM Computing Surveys 46 (4) 52:152:47.CrossRefGoogle Scholar
Navarro, G. and Mäkinen, V. (2007). Compressed full-text indexes. ACM Computing Surveys 39 (1).Google Scholar
Ohlebusch, E. (2013). Bioinformatics Algorithms: Sequence Analysis, Genome Rearrangements, and Phylogenetic Reconstruction, Oldenbusch Verlag.Google Scholar
Ohlebusch, E. and Gog, S. (2009). A compressed enhanced suffix array supporting fast string matching. In: Karlgren, J., Tarhio, J. and Hyyrö, H. (eds.) SPIRE, Springer Lecture Notes in Computer Science 5721 5162.Google Scholar
Puglisi, S. J., Smyth, W. F. and Turpin, A. H. (2007). A taxonomy of suffix array construction algorithms. ACM Computing Surveys 39 (2) 131.Google Scholar
Russo, L. M. S., Navarro, G. and Oliveira, A. L. (2011) Fully compressed suffix trees. ACM Transactions on Algorithms 7 (4) 53.Google Scholar
Sadakane, K. (December 2007). Compressed suffix trees with full functionality. Theor. Comp. Sys. 41 (4) 589607.Google Scholar
Schieber, B. and Vishkin, U. (1988). On finding lowest common ancestors: Simplification and parallelization. SIAM Journal on Computing 17 (6) 12531262.Google Scholar
Szpankowski, W. (1993). A generalized suffix tree and its (un)expected asymptotic behaviors. SIAM Journal of Computing 22 11761198.Google Scholar
Szpankowski, W. (2001). Average Case Analysis of Algorithms on Sequences, Wiley Series in Discrete Mathematics and Optimization, Wiley-Interscience.Google Scholar
Ukkonen, E. (1995). On-line construction of suffix trees. Algorithmica 14 (3) 249260.Google Scholar
Weiner, P. (1973). Linear pattern matching algorithms. In: SWAT (FOCS), IEEE Computer Society, 111.Google Scholar