Algorithms for approximate string matching
Information and Control
An O(NP) sequence comparison algorithm
Information Processing Letters
Algorithms on strings, trees, and sequences: computer science and computational biology
Algorithms on strings, trees, and sequences: computer science and computational biology
The String-to-String Correction Problem
Journal of the ACM (JACM)
LATIN '00 Proceedings of the 4th Latin American Symposium on Theoretical Informatics
Linear-Time Longest-Common-Prefix Computation in Suffix Arrays and Its Applications
CPM '01 Proceedings of the 12th Annual Symposium on Combinatorial Pattern Matching
A Survey of Longest Common Subsequence Algorithms
SPIRE '00 Proceedings of the Seventh International Symposium on String Processing Information Retrieval (SPIRE'00)
Practical Algorithms for the Longest Common Extension Problem
SPIRE '09 Proceedings of the 16th International Symposium on String Processing and Information Retrieval
Theoretical and practical improvements on the RMQ-Problem, with applications to LCA and LCE
CPM'06 Proceedings of the 17th Annual conference on Combinatorial Pattern Matching
Hi-index | 0.00 |
The longest common subsequence problem is a very important computational problem for which there are many algorithms. We present a new algorithm for this problem. Let X and Y be any two given strings each of length O(n). We observe that a longest common subsequence can be obtained by using longest common prefixes of suffixes (longest common extensions) of X and Y. The longest common extension problem asks for the longest common prefix of suffixes starting in a given pair of positions in X and Y, respectively. Let e be the number of edit operations, insert, delete, and substitute to change X to Y (i.e. let e be the edit distance between X and Y). Our algorithm visits $O(\min\{en,(1+\sqrt{2})^{2e+1})$ nodes in the edit graph, and for every visited node, performs one longest common extension query. Each of these queries can be answered in constant time if we represent the strings by a suffix tree or a suffix array. These data structures can be created in linear time. We do not assume that the edit distance e is known beforehand, therefore we try values for e starting with e=1 (without loss of generality X≠Y) and double e until our algorithm finds a longest common subsequence. The total time complexity of our algorithm is $O(\min\{en\log{n},n+e(1+\sqrt{2})^{2e+1}\})$. This is a better time complexity result compared to those of existing solutions for the problem when e is small. For example, when $e\leq \frac{1}{3}((\log_{(1+\sqrt{2})}~{n})-1)$ our algorithm finds an optimal solution in time O(n).