[Paper Review] A simple linear space algorithm for computing a longest common increasing subsequence
This paper presents a simple, linear-space algorithm for computing the longest common increasing subsequence (LCIS) of two sequences using a novel recursive formula. It achieves O(nm) time complexity with only min{n,m}+1 space, significantly simplifying prior approaches while maintaining optimal time efficiency.
This paper reformulates the problem of finding a longest common increasing subsequence of the two given input sequences in a very succinct way. An extremely simple linear space algorithm based on the new formula can find a longest common increasing subsequence of sizes $n$ and $m$ respectively, in time $O(nm)$ using additional $\min\{n,m\}+1$ space.
Motivation & Objective
- To develop a space-efficient algorithm for computing the longest common increasing subsequence (LCIS) of two sequences.
- To reformulate the LCIS problem using a new recursive formula that simplifies dynamic programming computation.
- To reduce the space complexity from O(nm) to O(min{n,m}+1) without sacrificing time efficiency.
- To provide a practical and implementable linear space algorithm that is simpler than previous divide-and-conquer methods.
- To enable efficient reconstruction of the actual LCIS sequence in additional O(m) time.
Proposed method
- Proposes a new recursive formula for f(i,j), the length of an LCIS ending at position j in sequence Y when processing the i-th element of X.
- Uses the match function δ(i,j) to detect when x_i = y_j, triggering the update f(i,j) = 1 + max_{t ∈ β(i,j)} f(i-1,t).
- Employs a rolling array L of size m+1 to store only the current and previous row values, reducing space to min{n,m}+1.
- Maintains a running maximum θ (stored in L[0]) to efficiently track the best previous value for increasing subsequence extension.
- Reconstructs the actual LCIS by backtracking using a recursive scan function Next(j,v,len) that traces the sequence in reverse.
- Integrates the reconstruction phase into the main algorithm with only O(m) additional time cost.
Experimental results
Research questions
- RQ1Can the LCIS problem be solved in linear space using a simpler dynamic programming formulation than existing divide-and-conquer methods?
- RQ2Is it possible to maintain O(nm) time complexity while reducing space usage to O(min{n,m}+1) for the LCIS problem?
- RQ3Can a space-efficient algorithm be designed that also supports efficient reconstruction of the actual LCIS sequence?
- RQ4Does a novel recursive formula for LCIS enable a more intuitive and implementable algorithm compared to prior approaches?
- RQ5Can the space reduction be achieved without increasing time complexity or complicating the implementation?
Key findings
- The proposed algorithm computes the LCIS in O(nm) time using only min{n,m}+1 space, achieving optimal space efficiency.
- The algorithm is simpler than previous linear-space approaches based on Hirschberg's divide-and-conquer method.
- The LCIS sequence can be reconstructed in additional O(m) time using a backward scanning procedure.
- The new recursive formula enables a clean and efficient implementation that avoids complex recursion or state tracking.
- The space usage is minimized to O(min{n,m}+1), which is asymptotically optimal for this problem.
- The algorithm maintains the same time complexity as the standard dynamic programming solution while drastically reducing memory footprint.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.