Faster Space-Efficient STR-IC-LCS Computation

Abstract

One of the most fundamental method for comparing two given strings A and B is the longest common subsequence (LCS), where the task is to find (the length) of an LCS of A and B. In this paper, we deal with the STR-IC-LCS problem which is one of the constrained LCS problems proposed by Chen and Chao [J. Comb. Optim, 2011]. A string Z is said to be an STR-IC-LCS of three given strings A, B, and P, if Z is a longest string satisfying that (1) Z includes P as a substring and (2) Z is a common subsequence of A and B. We present three efficient algorithms for this problem: First, we begin with a space-efficient solution which computes the length of an STR-IC-LCS in O(n2) time and O((+1)(n-+1)) space, where is the length of an LCS of A and B of length n. When = O(1) or n- = O(1), then this algorithm uses only linear O(n) space. Second, we present a faster algorithm that works in O(nr/r+n(n-+1)) time, where r is the length of P, while retaining the O((+1)(n-+1)) space efficiency. Third, we give an alternative algorithm that runs in O(nr/r+n(n-'+1)) time with O(('+1)(n-'+1)) space, where ' denotes the STR-IC-LCS length for input strings A, B, and P.

0

Turn this paper into a full lesson

ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…