skip to main content
research-article
Public Access

Space-Efficient Approximations for Subset Sum

Published: 29 June 2016 Publication History

Abstract

SubsetSum is a well-known NP-complete problem: given tZ+ and a set S of m positive integers, output YES if and only if there is a subset S′⊆S such that the sum of all numbers in S′ equals t. The problem and its search and optimization versions are known to be solvable in pseudopolynomial time in general.
We develop a one-pass deterministic streaming algorithm that uses space O(log t / ε) and decides if some subset of the input stream adds up to a value in the range {(1 ± ϵ)t}. Using this algorithm, we design space-efficient fully polynomial-time approximation schemes (FPTAS) solving the search and optimization versions of SubsetSum. Our algorithms run in O(1 / ϵ m2) time and O(1 / ϵ) space on unit-cost RAMs, where 1 + ϵ is the approximation factor. This implies constant space quadratic time FPTAS on unit-cost RAMs when ϵ is a constant. Previous FPTAS used space linear in m.
In addition, we show that on certain inputs, when a solution is located within a short prefix of the input sequence, our algorithms may run in sublinear time. We apply our techniques to the problem of finding balanced separators, and we extend our results to some other variants of the more general knapsack problem.
When the input numbers are encoded in unary, the decision version has been known to be in log space. We give streaming space lower and upper bounds for unary SubsetSum (USS). If the input length is N when the numbers are encoded in unary, we show that randomized s-pass streaming algorithms for exact SubsetSum need space Ω (√N/s) and give a simple deterministic two-pass streaming algorithm using O(√N log N) space.
Finally, we formulate an encoding under which USS is monotone and show that the exact and approximate versions in this formulation have monotone O(log2t) depth Boolean circuits. We also show that any circuit using ε-approximator gates for SubsetSum under this encoding needs Ω(n/logn) gates to compute the disjointness function.

References

[1]
Anna Adamaszek and Michal Adamaszek. 2010. Combinatorics of the change-making problem. European Journal of Combinatorics, 47--63.
[2]
Noga Alon, Yossi Matias, and Mario Szegedy. 1999. The space complexity of approximating the frequency moments. Journal of Computer and System Sciences 58, 1, 137--147.
[3]
Noga Alon, Paul D. Seymour, and Robin Thomas. 1990. A separator theorem for graphs with an excluded minor and its applications. In Proceedings of the 22nd Annual ACM Symposium on Theory of Computing. 293--299.
[4]
Sanjeev Arora and Boaz Barak. 2009. Computational Complexity: A Modern Approach. Cambridge University Press.
[5]
Z. Bar-Yossef, T. S. Jayram, R. Kumar, and D. Sivakumar. 2002. Information theory methods in communication complexity. In Proceedings of the 17th Annual IEEE Conference on Computational Complexity. 93--102.
[6]
Z. Bar-Yossef, T. S. Jayram, R. Kumar, and D. Sivakumar. 2004. An information statistics approach to data stream and communication complexity. Journal of Computer and System Sciences 68, 4, 702--732.
[7]
Cristina Bazgan, Miklos Santha, and Zsolt Tuza. 2002. Efficient approximation algorithms for the SUBSET-SUMS EQUALITY problem. Journal of Computer and System Sciences 64, 2, 160--170.
[8]
Richard Bellman. 1957. Dynamic Programming. Princeton University Press, Princeton, NJ.
[9]
T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein. 2009. Introduction to Algorithms (3rd ed.). MIT Press, Cambridge, MA.
[10]
George Dantzig. 1957. Discrete-variable extremum problems. Operations Research 5, 266--277.
[11]
Michael Elberfeld, Andreas Jakoby, and Till Tantau. 2010. Logspace versions of the theorems of Bodlaender and Courcelle. In Proceedings of the 2010 51st Annual IEEE Symposium on Foundations of Computer Science (FOCS’10). 143--152.
[12]
Michael Elberfeld, Andreas Jakoby, and Till Tantau. 2012. Algorithmic meta theorems for circuit classes of constant and logarithmic depth. In Proceedings of the Symposium on Theoretical Aspects of ComputerScience (STACS’12). 66--77.
[13]
M. R. Garey and D. S. Johnson. 1979. Computers and Intractability: A Guide to the Theory of NP-Completeness. W. H. Freeman, San Francisco, CA.
[14]
George Gens and Eugene Levner. 1980. Complexity of approximation algorithms for combinatorial problems: A survey. ACM SIGACT News 12, 3, 52--65.
[15]
George Gens and Eugene Levner. 1979. Computational complexity of approximation algorithms for combinatorial problems. In Proceedings of the 8th Symposium of the Mathematical Foundations of Computer Science. 292--300.
[16]
A. C. Gilbert, Y. Kotidis, S. Muthukrishnan, and M. Strauss. 2001. Surfing wavelets on streams: One-pass summaries for approximate aggregate queries. In Proceedings of 27th International Conference on Very Large Data Bases (VLDB’01). 79--88. http://www.vldb.org/conf/2001/P079.pdf.
[17]
Laurent Hyafil and Ronald L. Rivest. 1973. Graph Partitioning and Constructing Optimal Decision Trees are Polynomial Complete Problems. Technical Report Rapport de Recherche no. 33. IRIA: Laboratoire de Recherche en Informatique et Automatique.
[18]
Oscar H. Ibarra and Chul E. Kim. 1975. Fast approximation algorithms for the knapsack and sum of subset problems. Journal of the ACM 22, 4, 463--468.
[19]
T. Imai, K. Nakagawa, A. Pavan, N. V. Vinodchandran, and O. Watanabe. 2013. An O(n1/2 + ε) space and polynomial-time algorithm for directed planar reachability. In Proceedings of the IEEE Conference on Computational Complexity. IEEE, Los Alamitos, CA, 277--286.
[20]
Bala Kalyanasundaram and Georg Schnitger. 1992. The probabilistic communication complexity of set intersection. SIAM Journal on Discrete Mathematics 5, 4, 545--557.
[21]
Daniel M. Kane. 2010. Unary Subset-Sum is in logspace. arXiv:10102.1336.
[22]
Richard M. Karp. 1972. Reducibility among combinatorial problems. In Complexity of Computer Computations. IBM Research Symposia Series. Springer, 85--103.
[23]
Hans Kellerer, Renata Mansini, Ulrich Pferschy, and Maria Grazia Speranza. 2003. An efficient fully polynomial approximation scheme for the subset-sum problem. Journal of Computer and System Sciences 66, 2, 349--370.
[24]
Hans Kellerer, Ulrich Pferschy, and David Pisinger. 2004. Knapsack Problems. Springer.
[25]
Dexter Kozen and Shmuel Zaks. 1994. Optimal bounds for the change-making problem. Theoretical Computer Science 123, 2, 377--388.
[26]
Ilan Kremer, Noam Nisan, and Dana Ron. 1995. On randomized one-round communication complexity. Computational Complexity 8, 596--605.
[27]
Nutan Limaye, Meena Mahajan, and Karteek Sreenivasaiah. 2012. The complexity of unary Subset Sum. In Computing and Combinatorics. Lecture Notes in Computer Science, Vol. 7434. Springer, 458--469.
[28]
Richard J. Lipton and Robert Endre Tarjan. 1979. A separator theorem for planar graphs. SIAM Journal on Applied Mathematics 36, 177--189.
[29]
Richard J. Lipton and Robert Endre Tarjan. 1980. Applications of a planar separator theorem. SIAM Journal on Computing 9, 3, 615--627.
[30]
Daniel Lokshtanov and Jesper Nederlof. 2010. Saving space by algebraization. In Proceedings of the 42nd ACM Symposium on Theory of Computing (STOC’10). 321--330.
[31]
George Lueker. 1975. Two NP-Complete Problems in Nonnegative Integer Programming. Technical Report 178. Computer Science Laboratory, Princeton University, Princeton, NJ.
[32]
Silvano Martello and Paolo Toth. 1990. Knapsack Problems: Algorithms and Computer Implementations. Wiley.
[33]
Gary L. Miller. 1986. Finding small simple cycle separators for 2-connected planar graphs. Journal of Computer and System Sciences 32, 3, 265--279.
[34]
B. Monien and I. H. Sudborough. 1980. The interface between language theory and complexity theory. In Formal Language Theory, R.V. Book (Ed.). Academic Press, 287--324.
[35]
S. Muthukrishnan. 2005. Data streams: Algorithms and applications. Foundations and Trends in Theoretical Computer Science 1, 2, 117--236.
[36]
Noam Nisan. 1994. The communication complexity of threshold gates. In Proceedings of Combinatorics, Paul Erdos Is Eighty. 301--315.
[37]
Alexander A. Razborov. 1992. On the distributional complexity of disjointness. Theoretical Computer Science 106, 2, 385--390.
[38]
Omer Reingold. 2008. Undirected connectivity in log-space. Journal of the ACM 55, 4, Article No. 17.
[39]
W. Savitch. 1970. Relationships between nondeterministic and deterministic tape complexities. Journal of Computer and System Sciences 4, 2, 177--192.
[40]
Rocco A. Servedio. 2004. Monotone Boolean formulas can approximate monotone linear threshold functions. Discrete Applied Mathematics 142, 1--3, 181--187.
[41]
Jeffrey D. Ullman. 1984. Computational Aspects of VLSI. Computer Science Press, Rockville, MD.
[42]
L. G. Valiant. 1984. Short monotone formulae for the majority function. Journal of Algorithms 5, 3, 363--366.
[43]
Vijay V. Vazirani. 2001. Approximation Algorithms. Springer.
[44]
Gerhard J. Woeginger and Zhongliang Yu. 1992. On the equal-subset-sum problem. Information Processing Letters 42, 6, 299--302.
[45]
A. C. Yao. 1989. Circuits and local computation. In Proceedings of the 21st Annual ACM Symposium on Theory of Computing (STOC’89). ACM, New York, NY, 186--196.

Cited By

View all
  • (2022)Knapsack problems — An overview of recent advances. Part I: Single knapsack problemsComputers & Operations Research10.1016/j.cor.2021.105692143(105692)Online publication date: Jul-2022
  • (2021)Fast low-space algorithms for subset sumProceedings of the Thirty-Second Annual ACM-SIAM Symposium on Discrete Algorithms10.5555/3458064.3458170(1757-1776)Online publication date: 10-Jan-2021
  • (2018)Binary Solutions to Some Systems of Linear EquationsOptimization Problems and Their Applications10.1007/978-3-319-93800-4_15(183-192)Online publication date: 17-Jun-2018

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Computation Theory
ACM Transactions on Computation Theory  Volume 8, Issue 4
July 2016
97 pages
ISSN:1942-3454
EISSN:1942-3462
DOI:10.1145/2956681
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 29 June 2016
Accepted: 01 February 2016
Revised: 01 February 2016
Received: 01 March 2015
Published in TOCT Volume 8, Issue 4

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. One-pass streaming algorithm
  2. fully polynomial-time approximations chemes FPTAS
  3. knapsack problem
  4. monotone circuits

Qualifiers

  • Research-article
  • Research
  • Refereed

Funding Sources

  • NSF

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)82
  • Downloads (Last 6 weeks)18
Reflects downloads up to 17 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2022)Knapsack problems — An overview of recent advances. Part I: Single knapsack problemsComputers & Operations Research10.1016/j.cor.2021.105692143(105692)Online publication date: Jul-2022
  • (2021)Fast low-space algorithms for subset sumProceedings of the Thirty-Second Annual ACM-SIAM Symposium on Discrete Algorithms10.5555/3458064.3458170(1757-1776)Online publication date: 10-Jan-2021
  • (2018)Binary Solutions to Some Systems of Linear EquationsOptimization Problems and Their Applications10.1007/978-3-319-93800-4_15(183-192)Online publication date: 17-Jun-2018

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media