Skip to main content Accessibility help
×
Home

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 (2000 International Journal of Computer Science and Engineering 15 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.

References

Abeliuk, A., Cánovas, R. and Navarro, G. (2013). Practical compressed suffix trees. Algorithms 6 (2) 319351.CrossRefGoogle Scholar
Abouelhoda, M. I., Kurtz, S. and Ohlebusch, E. (2004). Replacing suffix trees with enhanced suffix arrays. Journal of Discrete Algorithms 2 (1) 5386.CrossRefGoogle 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.CrossRefGoogle Scholar
Ben-Amram, A. M. and Yoffe, S. (2011). A simple and efficient union-find-delete algorithm. Theoretical Computer Science 412 (4–5) 487492.CrossRefGoogle 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.CrossRefGoogle Scholar
Crochemore, M., Hancart, C. and Lecroq, T. (2007). Algorithms on Strings. Cambridge University Press, 392.CrossRefGoogle 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.CrossRefGoogle 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.CrossRefGoogle 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.CrossRefGoogle 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.CrossRefGoogle 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.CrossRefGoogle 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.CrossRefGoogle 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.CrossRefGoogle Scholar
Galil, Z. and Italiano, G. F. (1991). Data structures and algorithms for disjoint set union problems. ACM Computing Surveys 23 (3) 319344.CrossRefGoogle 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.CrossRefGoogle Scholar
Gusfield, D. (1997). Algorithms on Strings, Trees, and Sequences – Computer Science and Computational Biology, Cambridge University Press.CrossRefGoogle Scholar
Gustedt, J. (1998). Efficient Union-Find for planar graphs and other sparse graph classes. Theoretical Computer Science 203 (1) 123141.CrossRefGoogle Scholar
Harel, D. and Tarjan, R. E. (1984). Fast algorithms for finding nearest common ancestors. SIAM Journal on Computing 13 (2) 338355.CrossRefGoogle 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.CrossRefGoogle 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.CrossRefGoogle 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.CrossRefGoogle 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.CrossRefGoogle Scholar
Ko, P. and Aluru, S. (2005). Space efficient linear time construction of suffix arrays. Journal of Discrete Algorithms 3 (2–4) 143156.CrossRefGoogle Scholar
Lin, J., Jiang, Y. and Adjeroh, D. A. (2009). The virtual suffix tree. International Journal of Foundations of Computer Science 20 (6) 11091133.CrossRefGoogle 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.CrossRefGoogle Scholar
Lucas, J. M. (1990). Postorder disjoint set union is linear. SIAM Journal on Computing 19 (5) 868882.CrossRefGoogle 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.CrossRefGoogle Scholar
McCreight, E. M. (1976). A space-economical suffix tree construction algorithm. Journal of ACM 23 (2) 262272.CrossRefGoogle 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).CrossRefGoogle 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.CrossRefGoogle 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.CrossRefGoogle Scholar
Russo, L. M. S., Navarro, G. and Oliveira, A. L. (2011) Fully compressed suffix trees. ACM Transactions on Algorithms 7 (4) 53.CrossRefGoogle Scholar
Sadakane, K. (December 2007). Compressed suffix trees with full functionality. Theor. Comp. Sys. 41 (4) 589607.CrossRefGoogle Scholar
Schieber, B. and Vishkin, U. (1988). On finding lowest common ancestors: Simplification and parallelization. SIAM Journal on Computing 17 (6) 12531262.CrossRefGoogle Scholar
Szpankowski, W. (1993). A generalized suffix tree and its (un)expected asymptotic behaviors. SIAM Journal of Computing 22 11761198.CrossRefGoogle Scholar
Szpankowski, W. (2001). Average Case Analysis of Algorithms on Sequences, Wiley Series in Discrete Mathematics and Optimization, Wiley-Interscience.CrossRefGoogle Scholar
Ukkonen, E. (1995). On-line construction of suffix trees. Algorithmica 14 (3) 249260.CrossRefGoogle Scholar
Weiner, P. (1973). Linear pattern matching algorithms. In: SWAT (FOCS), IEEE Computer Society, 111.Google Scholar

Full text views

Full text views reflects PDF downloads, PDFs sent to Google Drive, Dropbox and Kindle and HTML full text views.

Total number of HTML views: 0
Total number of PDF views: 101 *
View data table for this chart

* Views captured on Cambridge Core between September 2016 - 4th December 2020. This data will be updated every 24 hours.

Hostname: page-component-b4dcdd7-zcwv2 Total loading time: 0.43 Render date: 2020-12-04T05:36:28.365Z Query parameters: { "hasAccess": "0", "openAccess": "0", "isLogged": "0", "lang": "en" } Feature Flags last update: Fri Dec 04 2020 04:59:14 GMT+0000 (Coordinated Universal Time) Feature Flags: { "metrics": true, "metricsAbstractViews": false, "peerReview": true, "crossMark": true, "comments": true, "relatedCommentaries": true, "subject": true, "clr": false, "languageSwitch": true }

Send article to Kindle

To send this article to your Kindle, first ensure no-reply@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about sending to your Kindle. Find out more about sending to your Kindle.

Note you can select to send to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be sent to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

The longest common substring problem
Available formats
×

Send article to Dropbox

To send this article to your Dropbox account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your <service> account. Find out more about sending content to Dropbox.

The longest common substring problem
Available formats
×

Send article to Google Drive

To send this article to your Google Drive account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your <service> account. Find out more about sending content to Google Drive.

The longest common substring problem
Available formats
×
×

Reply to: Submit a response


Your details


Conflicting interests

Do you have any conflicting interests? *