面向单调性距离和非对称编辑距离的空间高效流媒体算法
Space efficient streaming algorithms for the distance to monotonicity and asymmetric edit distance
摘要:
数组的最长递增序列(LIS)的长度近似是一个研究得很好的问题。我们在数据流模型中研究这个问题,该算法允许从左到右通过数组,并且要最小化的关键资源是使用的额外内存量。我们提出了一个算法,对于任何$δ> 0$,给定的流访问长度$n$的数组提供了一个$(1+δ)$乘法近似的\emph{distance to monotonicity}($n$减去LIS的长度),并只使用$O((\log^2 n)/δ)$空间。以前使用多对数空间的最佳近似是乘法2-因子。我们的算法可以用来估计LIS的长度在任何$δ>0$的加性$δn$内,而以前的算法只能实现加性误差$n(1/2-o(1))$。我们的算法非常简单,只有3行伪代码,并且具有很小的更新时间。它本质上是一个计算LIS的经典动态程序的多对数空间近似实现。我们还给出了一个流算法近似$LCS(x,y)$,字符串$x$和$y$之间的最长公共子序列的长度,每个长度$n$。我们的算法工作在不对称的设置(灵感来自\cite{AKO10}),其中我们有随机访问$y$和流式访问$x$,并运行在小空间中提供的,没有一个符号经常出现在$y$。更确切地说,它给出了$LCS(x,y)$的加性- $δn$近似(因此也给出了$E(x,y) = n-LCS(x,y)$的加性- $δn$近似,当允许插入和删除但不允许替换时,$x$和$y$之间的编辑距离),具有空间复杂度$O(k(\log^2 n)/δ)$,其中$k$是任何一个符号在$y$中出现的最大次数。
英文摘要:
Approximating the length of the longest increasing sequence (LIS) of an array is a well-studied problem. We study this problem in the data stream model, where the algorithm is allowed to make a single left-to-right pass through the array and the key resource to be minimized is the amount of additional memory used. We present an algorithm which, for any $δ> 0$, given streaming access to an array of length $n$ provides a $(1+δ)$-multiplicative approximation to the \emph{distance to monotonicity} ($n$ minus the length of the LIS), and uses only $O((\log^2 n)/δ)$ space. The previous best known approximation using polylogarithmic space was a multiplicative 2-factor. Our algorithm can be used to estimate the length of the LIS to within an additive $δn$ for any $δ>0$ while previous algorithms could only achieve additive error $n(1/2-o(1))$. Our algorithm is very simple, being just 3 lines of pseudocode, and has a small update time. It is essentially a polylogarithmic space approximate implementation of a classic dynamic program that computes the LIS. We also give a streaming algorithm for approximating $LCS(x,y)$, the length of the longest common subsequence between strings $x$ and $y$, each of length $n$. Our algorithm works in the asymmetric setting (inspired by \cite{AKO10}), in which we have random access to $y$ and streaming access to $x$, and runs in small space provided that no single symbol appears very often in $y$. More precisely, it gives an additive-$δn$ approximation to $LCS(x,y)$ (and hence also to $E(x,y) = n-LCS(x,y)$, the edit distance between $x$ and $y$ when insertions and deletions, but not substitutions, are allowed), with space complexity $O(k(\log^2 n)/δ)$, where $k$ is the maximum number of times any one symbol appears in $y$.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。