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.
翻译:两个序列A和B的最长公共双调子序列(LCBS)是指同时出现在两个输入序列中、按顺序先单调递增至单一峰值后单调递减的最长子序列。尽管LCBS在生物信息学、金融和信号分析中自然模拟了先升后降的模式,但先前唯一记录的解决方案是二次动态规划方法,需要θ(nm)的时间和空间复杂度。我们证明这一空间障碍并非固有:一种改进的滚动行实现能以仅θ(min(n, m))的额外内存,在θ(nm)时间内评估相同的递推关系。通过分离M个符号匹配及其C个双调兼容对,我们将LCBS转化为稀疏有向无环图中的最长路径问题,并以O((n + m) log n + M log M)时间和O(M)空间求解,当M << n m时,该算法在渐进意义上快于二次基准方法。这些结果使得精确计算LCBS对于以往无法处理的输入变得可行,并揭示了一个新的细粒度复杂度图景,值得进一步探索。