# Faster STR-IC-LCS computation via RLE

**Authors:** Keita Kuboi, Yuta Fujishige, Shunsuke Inenaga, Hideo Bannai, Masayuki, Takeda

arXiv: 1703.04954 · 2017-03-16

## TL;DR

This paper introduces a faster algorithm for the STR-IC-LCS problem that leverages run-length encoding to improve efficiency on compressible strings, outperforming previous methods in such cases.

## Contribution

The authors develop an $O(mN + nM)$-time algorithm for STR-IC-LCS using RLE, which is faster for compressible strings compared to the previous $O(MN)$ approach.

## Key findings

- Algorithm is faster on RLE-compressible strings.
- Runs in $O(mN + nM)$ time, improving efficiency.
- Always as fast as previous algorithms, faster on certain inputs.

## Abstract

The constrained LCS problem asks one to find a longest common subsequence of two input strings $A$ and $B$ 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 $C$ as a substring. Given two strings $A$ and $B$ of respective lengths $M$ and $N$, and a constraint string $C$ of length at most $\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)$ time. In this work, we present an $O(mN + nM)$-time solution to the STR-IC-LCS problem, where $m$ and $n$ denote the sizes of the run-length encodings of $A$ and $B$, respectively. Since $m \leq M$ and $n \leq N$ always hold, our algorithm is always as fast as Deorowicz's algorithm, and is faster when input strings are compressible via RLE.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1703.04954/full.md

## Figures

3 figures with captions in the complete paper: https://tomesphere.com/paper/1703.04954/full.md

## References

17 references — full list in the complete paper: https://tomesphere.com/paper/1703.04954/full.md

---
Source: https://tomesphere.com/paper/1703.04954