English

Faster Deterministic Modular Subset Sum

Data Structures and Algorithms 2021-09-21 v2

Abstract

We consider the Modular Subset Sum problem: given a multiset XX of integers from Zm\mathbb{Z}_m and a target integer tt, decide if there exists a subset of XX with a sum equal to t(modm)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(mlogm)O(m \log m) time, while Axiotis et al. gave a deterministic algorithm that runs in O(m polylog m)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 Monte-Carlo randomized and matches the O(mlogm)O(m \log m) runtime of the Las-Vegas algorithm by Cardinal and Iacono. The second algorithm is fully deterministic and runs in O(mlogmα(m))O(m \log m \cdot \alpha(m)) time, where α\alpha is the inverse Ackermann function.

Keywords

Cite

@article{arxiv.2012.06062,
  title  = {Faster Deterministic Modular Subset Sum},
  author = {Krzysztof Potępa},
  journal= {arXiv preprint arXiv:2012.06062},
  year   = {2021}
}

Comments

16 pages, accepted at ESA 2021