We consider the problem of computing the Boolean convolution (with wraparound) of $n$~vectors of dimension $m$, or, equivalently, the problem of computing the sumset $A_1+A_2+\ldots+A_n$ for $A_1,\ldots,A_n \subseteq \mathbb{Z}_m$. Boolean convolution formalizes the frequent task of combining two subproblems, where the whole problem has a solution of size $k$ if for some $i$ the first subproblem has a solution of size~$i$ and the second subproblem has a solution of size $k-i$. Our problem formalizes a natural generalization, namely combining solutions of $n$ subproblems subject to a modular constraint. This simultaneously generalises Modular Subset Sum and Boolean Convolution (Sumset Computation). Although nearly optimal algorithms are known for special cases of this problem, not even tiny improvements are known for the general case. We almost resolve the computational complexity of this problem, shaving essentially a factor of $n$ from the running time of previous algorithms. Specifically, we present a \emph{deterministic} algorithm running in \emph{almost} linear time with respect to the input plus output size $k$. We also present a \emph{Las Vegas} algorithm running in \emph{nearly} linear expected time with respect to the input plus output size $k$. Previously, no deterministic or randomized $o(nk)$ algorithm was known. At the heart of our approach lies a careful usage of Kneser's theorem from Additive Combinatorics, and a new deterministic almost linear output-sensitive algorithm for non-negative sparse convolution. In total, our work builds a solid toolbox that could be of independent interest.
翻译:我们考虑的是计算Boolean Convolution(以包装方式) 的问题。 计算Boolean convolution(以包装方式) 的经常任务是合并两个子问题, 整个问题有股本的解决方案, 如果对于某些美元来说, 第一个子问题的计算法有 美元 的解算法, 或者, 等量的计算总和 A_ 1+A_ 2 ⁇ ldots+A_ n$, A_ 1\ldots, A_ n_ subseteqeq \ mumathb ⁇ m 。 Bolean convolution 既可以同时将Modular Subset Sum 和 Boolean Convolution (Sums Compation) 合并在一起, 如果对于第一个问题的特殊案例来说, 整个问题有近乎最佳的算法方法。 对于一般案例来说,甚至没有微小的改进。 我们几乎可以解决一个 美元的内值的内值的内值的内值 和内值的内值 。