Even Faster Knapsack via Rectangular Monotone Min-Plus Convolution and Balancing (2404.05681v2)
Abstract: We present a pseudopolynomial-time algorithm for the Knapsack problem that has running time $\widetilde{O}(n + t\sqrt{p_{\max}})$, where $n$ is the number of items, $t$ is the knapsack capacity, and $p_{\max}$ is the maximum item profit. This improves over the $\widetilde{O}(n + t \, p_{\max})$-time algorithm based on the convolution and prediction technique by Bateni et al.~(STOC 2018). Moreover, we give some evidence, based on a strengthening of the Min-Plus Convolution Hypothesis, that our running time might be optimal. Our algorithm uses two new technical tools, which might be of independent interest. First, we generalize the $\widetilde{O}(n{1.5})$-time algorithm for bounded monotone min-plus convolution by Chi et al.~(STOC 2022) to the \emph{rectangular} case where the range of entries can be different from the sequence length. Second, we give a reduction from general knapsack instances to \emph{balanced} instances, where all items have nearly the same profit-to-weight ratio, up to a constant factor. Using these techniques, we can also obtain algorithms that run in time $\widetilde{O}(n + OPT\sqrt{w_{\max}})$, $\widetilde{O}(n + (nw_{\max}p_{\max}){1/3}t{2/3})$, and $\widetilde{O}(n + (nw_{\max}p_{\max}){1/3} OPT{2/3})$, where $OPT$ is the optimal total profit and $w_{\max}$ is the maximum item weight.
- Geometric applications of a matrix-searching algorithm. Algorithmica, 2:195–208, 1987. doi:10.1007/BF01840359.
- Capacitated dynamic programming: Faster knapsack and graph algorithms. In 46th International Colloquium on Automata, Languages, and Programming, ICALP 2019, volume 132 of LIPIcs, pages 19:1–19:13. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2019. doi:10.4230/LIPICS.ICALP.2019.19.
- Fast algorithms for knapsack via convolution and prediction. In Proceedings of the 50th Annual ACM SIGACT Symposium on Theory of Computing, STOC 2018, pages 1269–1282. ACM, 2018. doi:10.1145/3188745.3188876.
- Richard Bellman. Notes on the theory of dynamic programming IV - maximization over discrete sets. Naval Research Logistics Quarterly, 3(1-2):67–70, mar 1956. doi:10.1002/nav.3800030107.
- Karl Bringmann. A near-linear pseudopolynomial time algorithm for subset sum. In Proceedings of the Twenty-Eighth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2017, pages 1073–1084. SIAM, 2017. doi:10.1137/1.9781611974782.69.
- Karl Bringmann. Knapsack with small items in near-quadratic time. In Proceedings of the 56th Annual ACM Symposium on Theory of Computing, STOC 2024. ACM, 2024.
- Faster knapsack algorithms via bounded monotone min-plus-convolution. In 49th International Colloquium on Automata, Languages, and Programming, ICALP 2022, volume 229 of LIPIcs, pages 31:1–31:21. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2022. doi:10.4230/LIPIcs.ICALP.2022.31.
- Faster 0-1-knapsack via near-convex min-plus-convolution. In 31st Annual European Symposium on Algorithms, ESA 2023, volume 274 of LIPIcs, pages 24:1–24:16. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2023. doi:10.4230/LIPICS.ESA.2023.24.
- Clustered integer 3SUM via additive combinatorics. In Proceedings of the Forty-Seventh Annual ACM on Symposium on Theory of Computing, STOC 2015, pages 31–40. ACM, 2015. doi:10.1145/2746539.2746568.
- Faster algorithms for bounded knapsack and bounded subset sum via fine-grained proximity results. In Proceedings of the 2024 ACM-SIAM Symposium on Discrete Algorithms, SODA 2024, pages 4828–4848. SIAM, 2024. URL: https://doi.org/10.1137/1.9781611977912.171.
- Faster min-plus product for monotone instances. In STOC ’22: 54th Annual ACM SIGACT Symposium on Theory of Computing, pages 1529–1542. ACM, 2022. doi:10.1145/3519935.3520057.
- On problems equivalent to (min, +)-convolution. ACM Trans. Algorithms, 15(1):14:1–14:25, 2019. doi:10.1145/3293465.
- Concentration of Measure for the Analysis of Randomized Algorithms. Cambridge University Press, 2009. URL: http://www.cambridge.org/gb/knowledge/isbn/item2327542/.
- Simple and faster algorithms for knapsack. In 2024 Symposium on Simplicity in Algorithms, SOSA 2024, pages 56–62. SIAM, 2024. doi:10.1137/1.9781611977936.6.
- Wassily Hoeffding. Probability inequalities for sums of bounded random variables. Journal of the American Statistical Association, 58(301):13–30, 1963. doi:10.1080/01621459.1963.10500830.
- Graham James Oscar Jameson. The prime number theorem. Number 53 in London Mathematical Society Student Texts. Cambridge University Press, 2003. doi:10.1017/CBO9781139164986.
- Ce Jin. Solving knapsack with small items via L0-proximity. CoRR, abs/2307.09454, 2023. arXiv:2307.09454, doi:10.48550/ARXIV.2307.09454.
- Ce Jin. 0-1 knapsack in nearly quadratic time. In Proceedings of the 56th Annual ACM Symposium on Theory of Computing, STOC 2024. ACM, 2024.
- R. Kaas and J.M. Buhrman. Mean, median and mode in binomial distributions. Statistica Neerlandica, 34(1):13–18, 1980. doi:https://doi.org/10.1111/j.1467-9574.1980.tb00681.x.
- Richard M. Karp. Reducibility among combinatorial problems. In Proceedings of a symposium on the Complexity of Computer Computations, 1972, The IBM Research Symposia Series, pages 85–103. Plenum Press, New York, 1972. doi:10.1007/978-1-4684-2001-2_9.
- Improved dynamic programming in connection with an FPTAS for the knapsack problem. J. Comb. Optim., 8(1):5–11, 2004. doi:10.1023/B:JOCO.0000021934.29833.6B.
- Knapsack problems. Springer, 2004. doi:10.1007/978-3-540-24777-7.
- On the fine-grained complexity of one-dimensional dynamic programming. In 44th International Colloquium on Automata, Languages, and Programming, ICALP 2017, volume 80 of LIPIcs, pages 21:1–21:15. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2017. doi:10.4230/LIPICS.ICALP.2017.21.
- David Pisinger. Linear time algorithms for knapsack problems with bounded weights. J. Algorithms, 33(1):1–14, 1999. doi:10.1006/JAGM.1999.1034.
- Knapsack and subset sum with small items. In 48th International Colloquium on Automata, Languages, and Programming, ICALP 2021, volume 198 of LIPIcs, pages 106:1–106:19. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2021. doi:10.4230/LIPICS.ICALP.2021.106.