English

Modular Subset Sum, Dynamic Strings, and Zero-Sum Sets

Data Structures and Algorithms 2023-10-27 v3

Abstract

The modular subset sum problem consists of deciding, given a modulus mm, a multiset SS of nn integers in 0..m10..m-1, and a target integer tt, whether there exists a subset of SS with elements summing to tmodmt \mod m , and to report such a set if it exists. We give a simple O(mlogm)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(mlog7m)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 2n12n - 1 integers always contains a subset of cardinality exactly nn whose values sum to a multiple of nn. We give an algorithm for finding such a subset in time O(nlogn)O(n \log n) w.h.p. which improves on an O(n2)O(n^2) algorithm due to Del Lungo, Marini, and Mori (Disc. Math. 09).

Keywords

Cite

@article{arxiv.2008.08417,
  title  = {Modular Subset Sum, Dynamic Strings, and Zero-Sum Sets},
  author = {Jean Cardinal and John Iacono},
  journal= {arXiv preprint arXiv:2008.08417},
  year   = {2023}
}

Comments

Revised version of the original which appeared at the 2021 SIAM Symposium on Simplicity in Algorithms (SOSA21)