The modular subset sum problem consists of deciding, given a modulus $m$, a multiset $S$ of $n$ integers in $0..m-1$, and a target integer $t$, whether there exists a subset of $S$ with elements summing to $t \mod m $, and to report such a set if it exists. We give a simple $O(m \log m)$-time with high probability (w.h.p.) algorithm for the modular subset sum problem. This builds on and improves on a previous $O(m \log^7 m)$ w.h.p. algorithm from Axiotis, Backurs, Jin, Tzamos, and Wu (SODA 19). Our method utilizes the ADT of the dynamic strings structure of Gawrychowski et al. (SODA~18). However, as this structure is rather complicated we present a much simpler alternative which we call the Data Dependent Tree. As an application, we consider the computational version of a fundamental theorem in zero-sum Ramsey theory. The Erd\H{o}s-Ginzburg-Ziv Theorem states that a multiset of $2n - 1$ integers always contains a subset of cardinality exactly $n$ whose values sum to a multiple of $n$. We give an algorithm for finding such a subset in time $O(n \log n)$ w.h.p. which improves on an $O(n^2)$ algorithm due to Del Lungo, Marini, and Mori (Disc. Math. 09).
翻译:模块子集和问题涉及:给定模数 $m$、一个包含 $n$ 个整数(取值范围在 $0..m-1$ 之间)的多重集 $S$,以及目标整数 $t$,判断是否存在 $S$ 的子集,其元素和对 $m$ 取模后等于 $t$,若存在则报告该子集。我们提出了一种算法,其时间复杂度为 $O(m \log m)$,且以高概率(w.h.p.)成功。该算法基于并改进了 Axiotis、Backurs、Jin、Tzamos 和 Wu(SODA 19)提出的 $O(m \log^7 m)$ w.h.p. 算法。我们的方法利用了 Gawrychowski 等人(SODA 18)的动态字符串结构的 ADT。然而,由于该结构较为复杂,我们提出了一种更简单的替代方案,称为“数据依赖树”。作为应用,我们考虑了零和拉姆齐理论中一个基本定理的计算版本。Erdős–Ginzburg–Ziv 定理指出,一个包含 $2n - 1$ 个整数的多重集总是存在一个大小为 $n$ 的子集,其元素之和为 $n$ 的倍数。我们给出了一个算法,可在 $O(n \log n)$ 时间内(w.h.p.)找到这样的子集,这改进了 Del Lungo、Marini 和 Mori(Disc. Math. 09)提出的 $O(n^2)$ 算法。