21
19

Faster Space-Efficient Algorithms for Subset Sum, k-Sum and Related Problems

Abstract

We present space efficient Monte Carlo algorithms that solve Subset Sum and Knapsack instances with nn items using O(20.86n)O^*(2^{0.86n}) time and polynomial space, where the O()O^*(\cdot) notation suppresses factors polynomial in the input size. Both algorithms assume random read-only access to random bits. Modulo this mild assumption, this resolves a long-standing open problem in exact algorithms for NP-hard problems. These results can be extended to solve Binary Linear Programming on nn variables with few constraints in a similar running time. We also show that for any constant k2k\geq 2, random instances of kk-Sum can be solved using O(nk0.5polylog(n))O(n^{k-0.5}polylog(n)) time and O(logn)O(\log n) space, without the assumption of random access to random bits. Underlying these results is an algorithm that determines whether two given lists of length nn with integers bounded by a polynomial in nn share a common value. Assuming random read-only access to random bits, we show that this problem can be solved using O(logn)O(\log n) space significantly faster than the trivial O(n2)O(n^2) time algorithm if no value occurs too often in the same list.

View on arXiv
Comments on this paper

We use cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from. See our policy.