We consider the Modular Subset Sum problem: given a multiset $X$ of integers from $\mathbb{Z}_m$ and a target integer $t$, decide if there exists a subset of $X$ with a sum equal to $t \pmod{m}$. Recent independent works by Cardinal and Iacono (SOSA'21), and Axiotis et al. (SOSA'21) provided simple and near-linear algorithms for this problem. Cardinal and Iacono gave a randomized algorithm that runs in $O(m \log m)$ time, while Axiotis et al. gave a deterministic algorithm that runs in $O(m \text{ polylog } m)$ time. Both results work by reduction to a text problem, which is solved using a dynamic strings data structure. In this work, we develop a simple data structure, designed specifically to handle the text problem that arises in the algorithms for Modular Subset Sum. Our data structure, which we call the shift-tree, is a simple variant of a segment tree. We provide both a hashing-based and a deterministic variant of the shift-trees. We then apply our data structure to the Modular Subset Sum problem and obtain two algorithms. The first algorithm is randomized and matches the $O(m \log m)$ runtime of the algorithm by Cardinal and Iacono. The second algorithm is fully deterministic and runs in $O(m \log m \cdot \alpha(m))$ time, where $\alpha$ is the inverse Ackermann function.
翻译:我们考虑模块子子设置问题 : 鉴于一个由$\mathb ⁇ m美元和一个目标整数美元组成的多设美元, 确定是否存在一个以$(m\text{polog{m}m)美元计算的子X$子集。 由红衣主教和Iacono( SOSA'21) 和 Axiotis 等人( SOSA'21) 最近的独立工作为这一问题提供了简单和近线算法。 红衣主教和Iacono给出了一个随机化算法, 该算法以$( m) 来运行, 而Axiotis 等人( Axiotis etal) 给出了一个以$( mlog m) 来运行的确定性算法算法, 以美元为单位运行的确定性算法值计算。 我们同时提供一种以 $( mexcial) 值算法的计算方法, 也就是以美元序算算法 。 我们的货币算法和 亚程的变法是 。 。 我们提供一种基于和亚程的变算法 。