English

Faster STR-IC-LCS computation via RLE

Data Structures and Algorithms 2017-03-16 v1

Abstract

The constrained LCS problem asks one to find a longest common subsequence of two input strings AA and BB 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 CC as a substring. Given two strings AA and BB of respective lengths MM and NN, and a constraint string CC of length at most min{M,N}\min\{M, N\}, the best known algorithm for the STR-IC-LCS problem, proposed by Deorowicz~({\em Inf. Process. Lett.}, 11:423--426, 2012), runs in O(MN)O(MN) time. In this work, we present an O(mN+nM)O(mN + nM)-time solution to the STR-IC-LCS problem, where mm and nn denote the sizes of the run-length encodings of AA and BB, respectively. Since mMm \leq M and nNn \leq N always hold, our algorithm is always as fast as Deorowicz's algorithm, and is faster when input strings are compressible via RLE.

Keywords

Cite

@article{arxiv.1703.04954,
  title  = {Faster STR-IC-LCS computation via RLE},
  author = {Keita Kuboi and Yuta Fujishige and Shunsuke Inenaga and Hideo Bannai and Masayuki Takeda},
  journal= {arXiv preprint arXiv:1703.04954},
  year   = {2017}
}
R2 v1 2026-06-22T18:45:48.935Z