Fast and Simple Modular Subset Sum
Abstract
We revisit the Subset Sum problem over the finite cyclic group for some given integer . A series of recent works has provided near-optimal algorithms for this problem under the Strong Exponential Time Hypothesis. Koiliaris and Xu (SODA'17, TALG'19) gave a deterministic algorithm running in time , which was later improved to randomized time by Axiotis et al. (SODA'19). In this work, we present two simple algorithms for the Modular Subset Sum problem running in near-linear time in , both efficiently implementing Bellman's iteration over . The first one is a randomized algorithm running in time , that is based solely on rolling hash and an elementary data-structure for prefix sums; to illustrate its simplicity we provide a short and efficient implementation of the algorithm in Python. Our second solution is a deterministic algorithm running in time , that uses dynamic data structures for string manipulation. We further show that the techniques developed in this work can also lead to simple algorithms for the All Pairs Non-Decreasing Paths Problem (APNP) on undirected graphs, matching the near-optimal running time of provided in the recent work of Duan et al. (ICALP'19).
Cite
@article{arxiv.2008.10577,
title = {Fast and Simple Modular Subset Sum},
author = {Kyriakos Axiotis and Arturs Backurs and Karl Bringmann and Ce Jin and Vasileios Nakos and Christos Tzamos and Hongxun Wu},
journal= {arXiv preprint arXiv:2008.10577},
year = {2020}
}
Comments
accepted at SOSA'21