在流模型中识别带括号的表达式
Recognizing well-parenthesized expressions in the streaming model
摘要:
出于一个具体的问题和理解的意义上的流算法的复杂性与形式语言的复杂性的目标,我们调查的问题Dyck(S)检查匹配括号,与$s$不同类型的括号。我们提出了一个Dyck(2)的单通道随机流算法,具有空间$\Order(\sqrt{n}\log n)$,每个字母的时间$\polylog (n)$和单侧误差。我们证明,这种一次通过算法是最佳的,一个$\polylog n$的因素,即使当双侧错误是允许的。对于下界,我们证明了一个直接和硬实例的结果,通过以下的“信息成本”的方法,但有一些曲折。事实上,我们在公共和私人硬币之间玩着微妙的游戏。公共和私人硬币之间的这种混合是由于直接和结果与基本情况的组合下限之间的平衡行为。令人惊讶的是,如果我们可以反向访问输入流,空间需求会大大减少。我们提出了一个Dyck(2)的两遍随机流算法,该算法具有空间$\Order((\log n)^2)$、时间$\polylog (n)$和单侧误差,其中第二遍是反向的.这两个算法都可以扩展到Dyck(s),因为这个问题可以简化为Dyck(2),以便在流模型中找到合适的简化概念。
英文摘要:
Motivated by a concrete problem and with the goal of understanding the sense in which the complexity of streaming algorithms is related to the complexity of formal languages, we investigate the problem Dyck(s) of checking matching parentheses, with $s$ different types of parenthesis. We present a one-pass randomized streaming algorithm for Dyck(2) with space $\Order(\sqrt{n}\log n)$, time per letter $\polylog (n)$, and one-sided error. We prove that this one-pass algorithm is optimal, up to a $\polylog n$ factor, even when two-sided error is allowed. For the lower bound, we prove a direct sum result on hard instances by following the "information cost" approach, but with a few twists. Indeed, we play a subtle game between public and private coins. This mixture between public and private coins results from a balancing act between the direct sum result and a combinatorial lower bound for the base case. Surprisingly, the space requirement shrinks drastically if we have access to the input stream in reverse. We present a two-pass randomized streaming algorithm for Dyck(2) with space $\Order((\log n)^2)$, time $\polylog (n)$ and one-sided error, where the second pass is in the reverse direction. Both algorithms can be extended to Dyck(s) since this problem is reducible to Dyck(2) for a suitable notion of reduction in the streaming model.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。