skip to main content
research-article
Public Access

Space-Efficient Approximations for Subset Sum

Published:29 June 2016Publication History
Skip Abstract Section

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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. DOI:http://dx.doi.org/10.1145/100216.100254 Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Sanjeev Arora and Boaz Barak. 2009. Computational Complexity: A Modern Approach. Cambridge University Press. Google ScholarGoogle ScholarCross RefCross Ref
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. DOI:http://dx.doi.org/10.1006/jcss.2001.1784 Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Richard Bellman. 1957. Dynamic Programming. Princeton University Press, Princeton, NJ.Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein. 2009. Introduction to Algorithms (3rd ed.). MIT Press, Cambridge, MA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. George Dantzig. 1957. Discrete-variable extremum problems. Operations Research 5, 266--277. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. George Gens and Eugene Levner. 1980. Complexity of approximation algorithms for combinatorial problems: A survey. ACM SIGACT News 12, 3, 52--65. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. DOI:http://dx.doi.org/10.1007/3-540-09526-8_26Google ScholarGoogle ScholarCross RefCross Ref
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  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. DOI:http://dx.doi.org/10.1145/321906.321909 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  20. Bala Kalyanasundaram and Georg Schnitger. 1992. The probabilistic communication complexity of set intersection. SIAM Journal on Discrete Mathematics 5, 4, 545--557. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Daniel M. Kane. 2010. Unary Subset-Sum is in logspace. arXiv:10102.1336.Google ScholarGoogle Scholar
  22. Richard M. Karp. 1972. Reducibility among combinatorial problems. In Complexity of Computer Computations. IBM Research Symposia Series. Springer, 85--103.Google ScholarGoogle Scholar
  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. DOI:http://dx.doi.org/10.1016/S0022-0000(03)00006-0 Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Hans Kellerer, Ulrich Pferschy, and David Pisinger. 2004. Knapsack Problems. Springer.Google ScholarGoogle Scholar
  25. Dexter Kozen and Shmuel Zaks. 1994. Optimal bounds for the change-making problem. Theoretical Computer Science 123, 2, 377--388. DOI:http://dx.doi.org/10.1016/0304-3975(94)90134-1 Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Ilan Kremer, Noam Nisan, and Dana Ron. 1995. On randomized one-round communication complexity. Computational Complexity 8, 596--605. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  28. Richard J. Lipton and Robert Endre Tarjan. 1979. A separator theorem for planar graphs. SIAM Journal on Applied Mathematics 36, 177--189. DOI:http://dx.doi.org/10.1137/0209046Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Richard J. Lipton and Robert Endre Tarjan. 1980. Applications of a planar separator theorem. SIAM Journal on Computing 9, 3, 615--627. DOI:http://dx.doi.org/10.1137/0209046Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. DOI:http://dx.doi.org/10.1145/1806689.1806735 Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. George Lueker. 1975. Two NP-Complete Problems in Nonnegative Integer Programming. Technical Report 178. Computer Science Laboratory, Princeton University, Princeton, NJ.Google ScholarGoogle Scholar
  32. Silvano Martello and Paolo Toth. 1990. Knapsack Problems: Algorithms and Computer Implementations. Wiley. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. DOI:http://dx.doi.org/10.1016/0022-0000(86)90030-9 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  35. S. Muthukrishnan. 2005. Data streams: Algorithms and applications. Foundations and Trends in Theoretical Computer Science 1, 2, 117--236. DOI:http://dx.doi.org/10.1561/0400000002 Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Noam Nisan. 1994. The communication complexity of threshold gates. In Proceedings of Combinatorics, Paul Erdos Is Eighty. 301--315.Google ScholarGoogle Scholar
  37. Alexander A. Razborov. 1992. On the distributional complexity of disjointness. Theoretical Computer Science 106, 2, 385--390. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Omer Reingold. 2008. Undirected connectivity in log-space. Journal of the ACM 55, 4, Article No. 17. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. W. Savitch. 1970. Relationships between nondeterministic and deterministic tape complexities. Journal of Computer and System Sciences 4, 2, 177--192. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Rocco A. Servedio. 2004. Monotone Boolean formulas can approximate monotone linear threshold functions. Discrete Applied Mathematics 142, 1--3, 181--187.Google ScholarGoogle ScholarCross RefCross Ref
  41. Jeffrey D. Ullman. 1984. Computational Aspects of VLSI. Computer Science Press, Rockville, MD. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. L. G. Valiant. 1984. Short monotone formulae for the majority function. Journal of Algorithms 5, 3, 363--366.Google ScholarGoogle ScholarCross RefCross Ref
  43. Vijay V. Vazirani. 2001. Approximation Algorithms. Springer. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Gerhard J. Woeginger and Zhongliang Yu. 1992. On the equal-subset-sum problem. Information Processing Letters 42, 6, 299--302. DOI:http://dx.doi.org/10.1016/0020-0190(92)90226-L Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Space-Efficient Approximations for Subset Sum

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!