Longest Common Subsequence in K-Length Substrings for Run-Length Encoded Strings
摘要
The Longest Common Subsequence (LCS) problem is a classical problem in computer science. Numerous variants of the LCS problem have been proposed due to its significance. In this paper, we study a new variant of the LCS problem that combines two settings: the input strings are compressed using run-length encoding (RLE) and the solution must consist of matching substrings of length k, as in the LCSk problem. We propose two algorithms to address the challenges of the k-length substring constraint. The first requires \(O(nM + mN)\) time where n and m are the lengths of the uncompressed input strings, N and M are the lengths of the compressed input strings. The second requires \(O(N+M+ \min \{n+|C| \log \log m,\ m+ |C| \log \log n\})\) time, where |C| denotes the number of required k-length matching substrings between the input strings.