Finding a longest common subsequence between a run-length-encoded string and an uncompressed string

  • Authors:
  • J. J. Liu;Y. L. Wang;R. C. T. Lee

  • Affiliations:
  • Department of Information Management, National Taiwan University of Science and Technology, Taipei, Taiwan, ROC;Department of Computer Science and Information Engineering, National Chi Nan University, Nantou, 1 University Rd. Puli, Nantou Hsien, Taiwan 545, ROC;Department of Computer Science and Information Engineering, National Chi Nan University, Nantou, 1 University Rd. Puli, Nantou Hsien, Taiwan 545, ROC

  • Venue:
  • Journal of Complexity
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

In this paper, we propose an O(min{mN,Mn}) time algorithm for finding a longest common subsequence of strings X and Y with lengths M and N, respectively, and run-length-encoded lengths m and n, respectively. We propose a new recursive formula for finding a longest common subsequence of Y and X which is in the run-length-encoded format. That is, Y=y"1y"2...y"N and X=r"1^l^"^1r"2^l^"^2...r"m^l^"^m, where r"i is the repeated character of run i and l"i is the number of its repetitions. There are three cases in the proposed recursive formula in which two cases are for r"i matching y"j. The third case is for r"i mismatching y"j. We will look specifically at the prior two cases that r"i matches y"j. To determine which case will be used when r"i matches y"j, we have to find a specific value which can be obtained by using another of our proposed recursive formulas.