A fast and simple algorithm for computing the longest common subsequence of run-length encoded strings

Let X and Y be two strings of lengths n and m, respectively, and k and l, respectively, be the numbers of runs in their corresponding run-length encoded forms. We propose a simple algorithm for computing the longest common subsequence of two given strings X and Y in O(kl+min{p"1,p"2}) time, where p"1 and p"2 denote the numbers of elements in the bottom and right boundaries of the matched blocks, respectively. It improves the previously known time bound O(min{nl,km}) and outperforms the time bounds O(kllogkl) or O((k+l+q)log(k+l+q)) for some cases, where q denotes the number of matched blocks.

[1]  János Csirik,et al.  An Improved Algorithm for Computing the Edit Distance of Run-Length Coded Strings , 1995, Inf. Process. Lett..

[2]  Michael J. Fischer,et al.  The String-to-String Correction Problem , 1974, JACM.

[3]  Michael A. Bender,et al.  The LCA Problem Revisited , 2000, LATIN.

[4]  Richard C. T. Lee,et al.  Finding a longest common subsequence between a run-length-encoded string and an uncompressed string , 2008, J. Complex..

[5]  Daniel S. Hirschberg,et al.  Algorithms for the Longest Common Subsequence Problem , 1977, JACM.

[6]  Richard C. T. Lee,et al.  Edit distance for a run-length-encoded string and an uncompressed string , 2007, Inf. Process. Lett..

[7]  Gad M. Landau,et al.  Edit distance of run-length encoded strings , 2002, Inf. Process. Lett..

[8]  Alessandro Bogliolo,et al.  Longest common subsequence between run-length-encoded strings: a new algorithm with improved parallelism , 2004, Inf. Process. Lett..

[9]  Gad M. Landau,et al.  Matching for Run-Length Encoded Strings , 1999, J. Complex..

[10]  Claus Rick Simple and fast linear space computation of longest common subsequences , 2000, Inf. Process. Lett..

[11]  Joseph S. B. Mitchell A Geometric Shortest Path Problem, with Application to Computing a Longest Common Subsequence in Run-length Encoded Strings , 2008 .

[12]  Richard C. T. Lee,et al.  Systolic algorithms for the longest common subsequence problem , 1987 .

[13]  Robert E. Tarjan,et al.  Fast Algorithms for Finding Nearest Common Ancestors , 1984, SIAM J. Comput..

[14]  Thomas G. Szymanski,et al.  A fast algorithm for computing longest common subsequences , 1977, CACM.

[15]  Jean Vuillemin,et al.  A unifying look at data structures , 1980, CACM.