We study sketching and streaming algorithms for the Longest Common Subsequence problem (LCS) on strings of small alphabet size . For the problem of deciding whether the LCS of strings has length at least , we obtain a sketch size and streaming space usage of $(L^{|\Sigma| - 1} \log L)$. We also prove matching unconditional lower bounds. As an application, we study a variant of LCS where each alphabet symbol is equipped with a weight that is given as input, and the task is to compute a common subsequence of maximum total weight. Using our sketching algorithm, we obtain an $({nm, n + m^{{\lvert \Sigma \rvert}}})x,yn,m$, with . We prove optimality of this running time up to lower order factors, assuming the Strong Exponential Time Hypothesis.

生成讲解博客的中文版本

生成AI智能校验的中文版本