Table of Contents
Fetching ...

Space-Efficient and Output-Sensitive Algorithms for the Longest Common Bitonic Subsequence

Md. Tanzeem Rahat, Md. Manzurul Hasan

TL;DR

LCBS seeks the longest subsequence common to two sequences that is bitonic. The paper presents two complementary exact solvers: a linear-space refinement of the classic $Θ(nm)$-time DP implemented with rolling rows, and an output-sensitive sparse-DAG approach that builds a compact DAG from matching pairs and computes the optimum via two 2-D range-tree passes, achieving $O((n+m)\log n + M\log^2 M)$ time and $O(M)$ space where $M$ is the number of matches. A streaming, Hirschberg-like variant further reduces space to $Θ(m)$ while preserving $Θ(nm)$ time. Together, these results show that exact LCBS computation can be practical on larger inputs and establish a fine-grained complexity landscape that motivates instance-sensitive preprocessing and future exploration.

Abstract

The longest common bitonic subsequence (LCBS) of two sequences A and B is the longest subsequence that increases to a single peak and then decreases while appearing, in order, in both inputs. Although LCBS naturally models rise-fall patterns in bioinformatics, finance, and signal analysis, the only previously documented solution was a quadratic dynamic program that needs θ(nm) time and space. We show that this space barrier is not inherent: a refined rolling-row implementation evaluates the same recurrence in θ(nm) time with only θ(min(n, m)) additional memory. By isolating the M symbol matches and their C bitonic-compatible pairs, we cast LCBS as a longest-path problem in a sparse DAG and solve it in O((n + m) log n + M log M) time and O(M) space, which is asymptotically faster than the quadratic baseline whenever M << n m. These results make exact LCBS computation practical for inputs that were previously out of reach and expose a new fine-grained complexity landscape that invites further exploration.

Space-Efficient and Output-Sensitive Algorithms for the Longest Common Bitonic Subsequence

TL;DR

LCBS seeks the longest subsequence common to two sequences that is bitonic. The paper presents two complementary exact solvers: a linear-space refinement of the classic -time DP implemented with rolling rows, and an output-sensitive sparse-DAG approach that builds a compact DAG from matching pairs and computes the optimum via two 2-D range-tree passes, achieving time and space where is the number of matches. A streaming, Hirschberg-like variant further reduces space to while preserving time. Together, these results show that exact LCBS computation can be practical on larger inputs and establish a fine-grained complexity landscape that motivates instance-sensitive preprocessing and future exploration.

Abstract

The longest common bitonic subsequence (LCBS) of two sequences A and B is the longest subsequence that increases to a single peak and then decreases while appearing, in order, in both inputs. Although LCBS naturally models rise-fall patterns in bioinformatics, finance, and signal analysis, the only previously documented solution was a quadratic dynamic program that needs θ(nm) time and space. We show that this space barrier is not inherent: a refined rolling-row implementation evaluates the same recurrence in θ(nm) time with only θ(min(n, m)) additional memory. By isolating the M symbol matches and their C bitonic-compatible pairs, we cast LCBS as a longest-path problem in a sparse DAG and solve it in O((n + m) log n + M log M) time and O(M) space, which is asymptotically faster than the quadratic baseline whenever M << n m. These results make exact LCBS computation practical for inputs that were previously out of reach and expose a new fine-grained complexity landscape that invites further exploration.

Paper Structure

This paper contains 19 sections, 11 theorems, 10 equations, 2 figures, 1 table, 5 algorithms.

Key Result

Lemma 1

Algorithm algo:lcis returns, for every match $(i,j)$ where $A[i]=B[j]$, the length of a longest common strictly increasing subsequence ending at that match, together with a valid predecessor pointer.

Figures (2)

  • Figure 1: Match matrix for $A=\langle2,1,3,4,6,5,4\rangle$ and $B=\langle1,2,3,5,6,4\rangle$. The LCBS $\langle 1,3,5,4\rangle$ follows $(i,j)=(2,1)\!\to\!(3,3)\!\to\!(6,4)\!\to\!(7,6)$ with peak at $(6,4)$.
  • Figure 2: Execution graph (compatibility DAG) with cover edges only. Solid edges form the Hasse diagram of the increasing half; the dashed edge is the post-peak step. The highlighted path $1\!\to\!3\!\to\!5\!\dashrightarrow\!4$ attains $INC(i^{*},j^{*})=3$, $DEC(i^{*},j^{*})=2$, so $INC+DEC-1=4$.

Theorems & Definitions (11)

  • Lemma 1
  • Theorem 2
  • Proposition 3: Tight time–space bounds
  • Corollary 4
  • Lemma 5
  • Theorem 6
  • Proposition 7: Linear-space bounds
  • Lemma 8
  • Lemma 9
  • Theorem 10
  • ...and 1 more