arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2403.20326cs.DS
收藏

通过大筛法不等式削减对数因子:稀疏卷积等问题的更快算法

Shaving Logs via Large Sieve Inequality: Faster Algorithms for Sparse Convolution and More

MIT(麻省理工学院)

Ce Jin, Yinzhan Xu

AI总结:

本文利用解析数论中的大筛法不等式改进哈希技术,解决了稀疏卷积类问题中对数因子和去随机化瓶颈,获得了稀疏非负卷积、文本到模式汉明距离及受限稀疏一般卷积的更快算法。

摘要:

在稀疏卷积类问题中,一种常用技术是将输入整数对某个随机素数 $p\in [Q/2,Q]$ 取模哈希,其中 $Q$ 为某个参数,从而在保持其加法结构的同时缩小输入整数的取值范围。然而,这一哈希族存在两个缺点,导致许多最先进算法出现瓶颈:(1)来自 $[N]$ 的两个元素的碰撞概率为 $O(\frac{\log N}{Q})$,而非 $O(\frac{1}{Q})$;(2)$p$ 的选择难以去随机化;已知的去随机化技术会带来超对数级开销 [Chan, Lewenstein STOC'15]。本文通过解析数论中大筛法不等式的新颖应用,在某些场景下部分克服了这些缺点。由此,我们针对多个问题获得了如下改进算法(在标准字 RAM 模型中):稀疏非负卷积:我们得到一个 $O(t\log t)$ 时间的 Las Vegas 算法,用于计算两个非负整数向量 $A,B$ 的卷积 $A\star B$,其中 $t$ 为输出稀疏度 $\\|A\star B\\|_0$。此外,该算法以 $1-1/\mathrm{poly}(t)$ 的概率在 $O(t\log t)$ 时间内终止。文本到模式汉明距离:给定长度为 $m$ 的模式 $P$ 和长度为 $n$ 的文本 $T$,我们得到一个确定性的 $O(n\sqrt{m\log \log m})$ 时间算法,精确计算 $P$ 与 $T$ 的每个长度为 $m$ 的子串之间的汉明距离。稀疏一般卷积:在输入向量长度 $N$ 满足 $N\le t^{1.99}$ 的限制情形下,我们还给出了一个针对可能含负输入的稀疏卷积的 Monte Carlo $O(t\log t)$ 时间算法。

英文摘要:

In sparse convolution-type problems, a common technique is to hash the input integers modulo a random prime $p\in [Q/2,Q]$ for some parameter $Q$, which reduces the range of the input integers while preserving their additive structure. However, this hash family suffers from two drawbacks, which led to bottlenecks in many state-of-the-art algorithms: (1) The collision probability of two elements from $[N]$ is $O(\frac{\log N}{Q})$ rather than $O(\frac{1}{Q})$; (2) It is difficult to derandomize the choice of $p$; known derandomization techniques lead to super-logarithmic overhead [Chan, Lewenstein STOC'15]. In this paper, we partially overcome these drawbacks in certain scenarios, via novel applications of the large sieve inequality from analytic number theory. Consequently, we obtain the following improved algorithms for various problems (in the standard word RAM model): Sparse Nonnegative Convolution: We obtain an $O(t\log t)$-time Las Vegas algorithm that computes the convolution $A\star B$ of two nonnegative integer vectors $A,B$, where $t$ is the output sparsity $\|A\star B\|_0$. Moreover, our algorithm terminates in $O(t\log t)$ time with $1-1/\mathrm{poly}(t)$ probability. Text-to-Pattern Hamming Distances: Given a length-$m$ pattern $P$ and a length-$n$ text $T$, we obtain a deterministic $O(n\sqrt{m\log \log m})$-time algorithm that exactly computes the Hamming distance between $P$ and every length-$m$ substring of $T$. Sparse General Convolution: We also give a Monte Carlo $O(t\log t)$ time algorithm for sparse convolution with possibly negative input in the restricted case where the length $N$ of the input vectors satisfies $N\le t^{1.99}$.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑