paper

Faster STR-IC-LCS computation via RLE

arXiv:1703.04954

Abstract

The constrained LCS problem asks one to find a longest common subsequence of two input strings and with some constraints. The STR-IC-LCS problem is a variant of the constrained LCS problem, where the solution must include a given constraint string as a substring. Given two strings and of respective lengths and , and a constraint string of length at most , the best known algorithm for the STR-IC-LCS problem, proposed by Deorowicz~({\em Inf. Process. Lett.}, 11:423--426, 2012), runs in time. In this work, we present an -time solution to the STR-IC-LCS problem, where and denote the sizes of the run-length encodings of and , respectively. Since and always hold, our algorithm is always as fast as Deorowicz's algorithm, and is faster when input strings are compressible via RLE.