Document Open Access Logo

Faster 0-1-Knapsack via Near-Convex Min-Plus-Convolution

Authors Karl Bringmann, Alejandro Cassis

Thumbnail PDF


  • Filesize: 1.18 MB
  • 16 pages

Document Identifiers

Author Details

Karl Bringmann
  • Saarland University, Saarland Informatics Campus, Saarbrücken, Germany
  • Max Planck Institute for Informatics, Saarland Informatics Campus, Saarbrücken, Germany
Alejandro Cassis
  • Saarland University, Saarland Informatics Campus, Saarbrücken, Germany
  • Max Planck Institute for Informatics, Saarland Informatics Campus, Saarbrücken, Germany

Cite AsGet BibTex

Karl Bringmann and Alejandro Cassis. Faster 0-1-Knapsack via Near-Convex Min-Plus-Convolution. In 31st Annual European Symposium on Algorithms (ESA 2023). Leibniz International Proceedings in Informatics (LIPIcs), Volume 274, pp. 24:1-24:16, Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2023)


We revisit the classic 0-1-Knapsack problem, in which we are given n items with their weights and profits as well as a weight budget W, and the goal is to find a subset of items of total weight at most W that maximizes the total profit. We study pseudopolynomial-time algorithms parameterized by the largest profit of any item p_{max}, and the largest weight of any item w_max. Our main result are algorithms for 0-1-Knapsack running in time Õ(n w_max p_max^{2/3}) and Õ(n p_max w_max^{2/3}), improving upon an algorithm in time O(n p_max w_max) by Pisinger [J. Algorithms '99]. In the regime p_max ≈ w_max ≈ n (and W ≈ OPT ≈ n²) our algorithms are the first to break the cubic barrier n³. To obtain our result, we give an efficient algorithm to compute the min-plus convolution of near-convex functions. More precisely, we say that a function f : [n] ↦ ℤ is Δ-near convex with Δ ≥ 1, if there is a convex function f ̆ such that f ̆(i) ≤ f(i) ≤ f ̆(i) + Δ for every i. We design an algorithm computing the min-plus convolution of two Δ-near convex functions in time Õ(nΔ). This tool can replace the usage of the prediction technique of Bateni, Hajiaghayi, Seddighin and Stein [STOC '18] in all applications we are aware of, and we believe it has wider applicability.

Subject Classification

ACM Subject Classification
  • Theory of computation → Design and analysis of algorithms
  • Knapsack
  • Fine-Grained Complexity
  • Min-Plus Convolution


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. Alok Aggarwal, Maria M. Klawe, Shlomo Moran, Peter W. Shor, and Robert E. Wilber. Geometric applications of a matrix-searching algorithm. Algorithmica, 2:195-208, 1987. URL:
  2. Kyriakos Axiotis, Arturs Backurs, Karl Bringmann, Ce Jin, Vasileios Nakos, Christos Tzamos, and Hongxun Wu. Fast and simple modular subset sum. In SOSA, pages 57-67. SIAM, 2021. URL:
  3. Kyriakos Axiotis and Christos Tzamos. Capacitated dynamic programming: Faster Knapsack and graph algorithms. In ICALP, volume 132 of LIPIcs, pages 19:1-19:13. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2019. URL:
  4. MohammadHossein Bateni, MohammadTaghi Hajiaghayi, Saeed Seddighin, and Cliff Stein. Fast algorithms for knapsack via convolution and prediction. In STOC, pages 1269-1282. ACM, 2018. URL:
  5. Richard Bellman. Dynamic Programming. Princeton University Press, Princeton, NJ, USA, 1957. URL:
  6. David Bremner, Timothy M. Chan, Erik D. Demaine, Jeff Erickson, Ferran Hurtado, John Iacono, Stefan Langerman, Mihai Patrascu, and Perouz Taslakian. Necklaces, convolutions, and X+Y. Algorithmica, 69(2):294-314, 2014. URL:
  7. Karl Bringmann. A near-linear pseudopolynomial time algorithm for subset sum. In SODA, pages 1073-1084. SIAM, 2017. URL:
  8. Karl Bringmann and Alejandro Cassis. Faster knapsack algorithms via bounded monotone min-plus-convolution. In ICALP, volume 229 of LIPIcs, pages 31:1-31:21. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2022. URL:
  9. Karl Bringmann, Nick Fischer, and Vasileios Nakos. Sparse nonnegative convolution is equivalent to dense nonnegative convolution. In STOC, pages 1711-1724. ACM, 2021. URL:
  10. Karl Bringmann, Nick Fischer, and Vasileios Nakos. Deterministic and las vegas algorithms for sparse nonnegative convolution. In SODA, pages 3069-3090. SIAM, 2022. URL:
  11. Karl Bringmann and Vasileios Nakos. A fine-grained perspective on approximating subset sum and partition. In SODA, pages 1797-1815. SIAM, 2021. URL:
  12. Karl Bringmann and Philip Wellnitz. On near-linear-time algorithms for dense subset sum. In SODA, pages 1777-1796. SIAM, 2021. URL:
  13. Michael R. Bussieck, Hannes Hassler, Gerhard J. Woeginger, and Uwe T. Zimmermann. Fast algorithms for the maximum convolution problem. Oper. Res. Lett., 15(3):133-141, 1994. URL:
  14. Timothy M. Chan. Approximation schemes for 0-1 knapsack. In SOSA, volume 61 of OASIcs, pages 5:1-5:12. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2018. URL:
  15. Timothy M. Chan and Qizheng He. More on change-making and related problems. J. Comput. Syst. Sci., 124:159-169, 2022. URL:
  16. Timothy M. Chan and Moshe Lewenstein. Clustered integer 3sum via additive combinatorics. In STOC, pages 31-40. ACM, 2015. URL:
  17. Timothy M. Chan and R. Ryan Williams. Deterministic APSP, orthogonal vectors, and more: Quickly derandomizing Razborov-Smolensky. ACM Trans. Algorithms, 17(1):2:1-2:14, 2021. URL:
  18. Shucheng Chi, Ran Duan, Tianle Xie, and Tianyi Zhang. Faster min-plus product for monotone instances. In STOC, pages 1529-1542. ACM, 2022. URL:
  19. Richard Cole and Ramesh Hariharan. Verifying candidate matches in sparse and wildcard matching. In STOC, pages 592-601. ACM, 2002. URL:
  20. Marek Cygan, Marcin Mucha, Karol Wegrzycki, and Michal Wlodarczyk. On problems equivalent to (min, +)-convolution. ACM Trans. Algorithms, 15(1):14:1-14:25, 2019. URL:
  21. Mingyang Deng, Ce Jin, and Xiao Mao. Approximating knapsack and partition via dense subset sums. In SODA, pages 2961-2979. SIAM, 2023. URL:
  22. Mingyang Deng, Xiao Mao, and Ziqian Zhong. On problems related to unbounded subsetsum: A unified combinatorial approach. In SODA, pages 2980-2990. SIAM, 2023. URL:
  23. Friedrich Eisenbrand and Robert Weismantel. Proximity results and faster algorithms for integer programming using the steinitz lemma. In SODA, pages 808-816. SIAM, 2018. URL:
  24. Pascal Giorgi, Bruno Grenet, and Armelle Perret du Cray. Essentially optimal sparse polynomial multiplication. In ISSAC, pages 202-209. ACM, 2020. URL:
  25. Ronald L. Graham. An efficient algorithm for determining the convex hull of a finite planar set. Inf. Process. Lett., 1(4):132-133, 1972. URL:
  26. Klaus Jansen and Lars Rohwedder. On integer programming and convolution. In ITCS, volume 124 of LIPIcs, pages 43:1-43:17. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2019. URL:
  27. Ce Jin and Hongxun Wu. A simple near-linear pseudopolynomial time randomized algorithm for subset sum. In SOSA, volume 69 of OASIcs, pages 17:1-17:6. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2019. URL:
  28. Hans Kellerer and Ulrich Pferschy. Improved dynamic programming in connection with an FPTAS for the knapsack problem. J. Comb. Optim., 8(1):5-11, 2004. URL:
  29. Hans Kellerer, Ulrich Pferschy, and David Pisinger. Knapsack problems. Springer, 2004. URL:
  30. Kim-Manuel Klein. On the fine-grained complexity of the unbounded subsetsum and the frobenius problem. In SODA, pages 3567-3582. SIAM, 2022. URL:
  31. Konstantinos Koiliaris and Chao Xu. Faster pseudopolynomial time algorithms for subset sum. ACM Trans. Algorithms, 15(3):40:1-40:20, 2019. URL:
  32. Marvin Künnemann, Ramamohan Paturi, and Stefan Schneider. On the fine-grained complexity of one-dimensional dynamic programming. In ICALP, volume 80 of LIPIcs, pages 21:1-21:15. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2017. URL:
  33. Vasileios Nakos. Nearly optimal sparse polynomial multiplication. IEEE Trans. Inf. Theory, 66(11):7231-7236, 2020. URL:
  34. David Pisinger. Linear time algorithms for Knapsack problems with bounded weights. J. Algorithms, 33(1):1-14, 1999. URL:
  35. Adam Polak, Lars Rohwedder, and Karol Wegrzycki. Knapsack and Subset Sum with small items. In ICALP, volume 198 of LIPIcs, pages 106:1-106:19. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2021. URL:
  36. R. Ryan Williams. Faster All-Pairs Shortest Paths via circuit complexity. SIAM J. Comput., 47(5):1965-1985, 2018. URL:
Questions / Remarks / Feedback

Feedback for Dagstuhl Publishing

Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail