Table of Contents
Fetching ...

Computing and Enumerating Minimal Common Supersequences Between Two Strings

Braeden Sopp, Adiesha Liyanage, Mingyang Gong, Binhai Zhu

Abstract

Given \(k\) strings each of length at most $n$, computing the shortest common supersequence of them is a well-known NP-hard problem (when \(k\) is unbounded). On the other hand, when \(k=2\), such a shortest common supersequence can be computed in \(O(n^2)\) time using dynamic programming as a textbook example. In this paper, we consider the problem of computing a \emph{minimal} common supersequence and enumerating all minimal common supersequences for \(k=2\) input strings. Our results are summarized as follows. A minimal common supersequence of \(k=2\) input strings can be computed in $O(n)$ time. (The method also works when \(k\) is a constant). All minimal common supersequences between two input strings can be enumerated with a data structure of $O(n^2)$ space and an $O(n)$ time delay, and the data structure can be constructed in $O(n^3)$ time.

Computing and Enumerating Minimal Common Supersequences Between Two Strings

Abstract

Given strings each of length at most , computing the shortest common supersequence of them is a well-known NP-hard problem (when is unbounded). On the other hand, when , such a shortest common supersequence can be computed in \(O(n^2)\) time using dynamic programming as a textbook example. In this paper, we consider the problem of computing a \emph{minimal} common supersequence and enumerating all minimal common supersequences for input strings. Our results are summarized as follows. A minimal common supersequence of input strings can be computed in time. (The method also works when is a constant). All minimal common supersequences between two input strings can be enumerated with a data structure of space and an time delay, and the data structure can be constructed in time.
Paper Structure (11 sections, 21 theorems, 12 equations, 2 figures, 2 algorithms)

This paper contains 11 sections, 21 theorems, 12 equations, 2 figures, 2 algorithms.

Key Result

Lemma 2.1

Given strings $A, B$, let $i \in [1:|S|]$, we define $S' = S[1:i)\circ S(i:|S|]$. We say that $S$ is a minimal common supersequence of $A$ and $B$ if and only if $\forall i \in [1:|S|]: S'(i) \text{~is not a common supersequence of } A \text{~and~}B.$

Figures (2)

  • Figure 1: Depicted on the left is $G(A, B)$ containing all nodes with the vertices of $G_{st}(A,B)$ colored in terms of their respective partitions. Red vertices belong partition $V_A$ and blue vertices belong to partition $V_B$. On the right we have $G_{st}(A,B)$ with the vertices labeled. $A=bacba, B=abcca$.
  • Figure 2: On the left hand side, we show characters used in a right embedding of $A_1 =abbc$ into $S=abccbacc$ in orange cells. On the right, we depict the output data structure for $S$ and $A_1$. On the bottom is the result of $\textsc{MergeRightEmbedding}(S;A_1,A_2)$ where $A_2=ac$.

Theorems & Definitions (26)

  • Definition 2.1: $\mathop{\mathrm{\mathbf{MCSupEnum}}}\nolimits$
  • Lemma 2.1
  • Definition 2.2: Embedding of a string
  • Definition 2.3: Left (Right) Embedding
  • Definition 3.1
  • Lemma 3.1
  • Lemma 3.2
  • Lemma 4.1
  • Lemma 4.2
  • Theorem 4.1
  • ...and 16 more