ABSTRACT
The 0/1-Knapsack Problem is a classic NP-hard problem. There are two common approaches to obtain the exact solution: branch-and-bound (BB) and dynamic programming (DP). A so-called, “sparse” DP algorithm (SKPDP) that performs fewer operations than the standard algorithm (KPDP) is well known. To the best of our knowledge, there has been no quantitative analysis of the benefits of sparsity. We provide a careful empirical evaluation of SKPDP and observe that for a “large enough” capacity, C, the number of operations performed by SKPDP is invariant with respect to C for many problem instances. This leads to the possibility of an exponential improvement over the conventional KPDP. We experimentally explore SKPDP over a large range of knapsack problem instances and provide a detailed study of the attributes that impact the performance.
DP algorithms have a nice regular structure and are amenable to highly parallel implementations. However, due to the dependence structure, parallelizing SKPDP is challenging. We propose two parallelization strategies (fine-grain and coarse-grain) for SKPDP on modern multi-core processors and demonstrate a scalable improvement in the performance. We also compare SKPDP with Branch-and-Bound algorithm.
- R. Andonov and S. Rajopadhye. 1997. Knapsack on VLSI: from Algorithm to Optimal Circuit. IEEE Transactions on Parallel and Distributed Systems 8, 6 (June 1997), 545–561.Google ScholarDigital Library
- R. Andonov and S. V. Rajopadhye. 1994. A Sparse Knapsack Algo-tech-cuit and its Synthesis. In International Conference on Application-Specific Array Processors (ASAP-94). IEEE, San Francisco, 302–313.Google ScholarCross Ref
- Victor C.B. Camargo, Leandro Mattiolli, and Franklina M.B. Toledo. 2012. A knapsack problem as a tool to solve the production planning problem in small foundries. Computers and Operations Research 39, 1 (2012), 86–92. https://doi.org/10.1016/j.cor.2010.10.023 Special Issue on Knapsack Problems and Applications.Google ScholarDigital Library
- Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. 2009. Introduction to Algorithms, Third Edition(3rd ed.). The MIT Press.Google ScholarDigital Library
- Leonardo Dagum and Ramesh Menon. 1998. OpenMP: An Industry-Standard API for Shared-Memory Programming. IEEE Comput. Sci. Eng. 5, 1 (Jan. 1998), 46–55. https://doi.org/10.1109/99.660313Google ScholarDigital Library
- F. de Dinechin, D. Wilde, S. Rajopadhye, and R. Andonov. 1996. A Regular VLSI Array for an Irregular Algorithm. In Irregular 96: Third International Workshop on Parallel Algorithms for Irregularly Structured Problems. Springer Verlag, Santa Barbara, CA, 195–200.Google Scholar
- D. S. Hirschberg. 1975. A Linear Space Algorithm for Computing Maximal Common Subsequences. Commun. ACM 18, 6 (June 1975), 341–343. https://doi.org/10.1145/360825.360861Google ScholarDigital Library
- Ellis Horowitz and Sartaj Sahni. 1974. Computing Partitions with Applications to the Knapsack Problem. J. ACM 21, 2 (April 1974), 277–292. https://doi.org/10.1145/321812.321823Google ScholarDigital Library
- T. C. Hu. 1969. Integer Programming and Network Flows. Addison Wesley.Google Scholar
- Fariborz Jolai, M.J. Rezaee, M. Rabbani, J. Razmi, and Pariviz Fattahi. 2007. Exact algorithm for bi-objective 0-1 knapsack problem. Appl. Math. Comput. 194, 2 (2007), 544–551. https://doi.org/10.1016/j.amc.2007.04.062Google ScholarCross Ref
- H. Kellerer, U. Pferschy, and D. Pisinger. 2004. Knapsack Problems. Springer, Berlin, Heidelberg.Google Scholar
- S. Y. Kung. 1988. VLSI Array Processors. Prentice Hall.Google Scholar
- S. Y. Kung, K. S. Arun, R. J. Gal-Ezer, and D. V. B. Rao. 1982. Wavefront Array Processor: Language, Architecture and Applications. IEEE Trans. Comput. C-31(1982), 1054–1066.Google Scholar
- Saeed Maleki, Madanlal Musuvathi, and Todd Mytkowicz. 2016. Efficient Parallelization Using Rank Convergence in Dynamic Programming Algorithms. Commun. ACM 59, 10 (Sept. 2016), 85–92. https://doi.org/10.1145/2983553Google ScholarDigital Library
- S. Martello and P. Toth. 1990. Knapsack Problems: Algorithms and Computer Implementation. John Wiley and Sons.Google ScholarDigital Library
- K. Nibbelink, S. Rajopadhye, and R. McConnell. 2007. 0/1 Knapsack on Hardware: A Complete Solution. In ASAP 2007: 18th IEEE International Conference on Application-specific Systems, Architectures and Processors. Montréal, Québec, Canada.Google Scholar
- David Pisinger. 1995. An expanding-core algorithm for the exact 0–1 knapsack problem. European Journal of Operational Research 87, 1 (1995), 175 – 187. https://doi.org/10.1016/0377-2217(94)00013-3Google ScholarCross Ref
- David Pisinger. 2005. Where Are the Hard Knapsack Problems?Comput. Oper. Res. 32, 9 (Sept. 2005), 2271–2284. https://doi.org/10.1016/j.cor.2004.03.002Google ScholarDigital Library
- P. Quinton, S. V. Rajopadhye, and T. Risset. 1996. Extension of the Alpha language to recurrences on sparse periodic domains. In IEEE Conference on Application-specific Systems, Architectures and Processors. Chicago, IL.Google Scholar
- Hammad Rashid, Clara Novoa, and Apan Qasem. 2010. An Evaluation of Parallel Knapsack Algorithms on Multicore Architectures. In CSC.Google Scholar
- Robert P. Rooderkerk and Harald J. van Heerde. 2016. Robust optimization of the 0-1 knapsack problem: Balancing risk and return in assortment optimization. European Journal of Operational Research 250, 3 (2016), 842–854. https://doi.org/10.1016/j.ejor.2015.10.014Google ScholarCross Ref
Recommendations
An alternative dynamic programming solution for the 0/1 knapsack
The 0/1 knapsack (or knapsack without repetition) has a dynamic programming solution driven by a table in which each item is consecutively considered. The problem can also be approached by generating a table in which the optimal knapsack for each ...
Dynamic-Programming-Based Inequalities for the Unbounded Integer Knapsack Problem
We propose a new hybrid approach to solve the unbounded integer knapsack problem (UKP), where valid inequalities are generated based on intermediate solutions of an equivalent forward dynamic programming formulation. These inequalities help tighten the ...
Using a Mixed Integer Programming Tool for Solving the 0-1 Quadratic Knapsack Problem
In this paper we will consider the 0-1 quadratic knapsack problem (QKP). Our purpose is to show that using a linear reformulation of this problem and a standard mixed integer programming tool, it is possible to solve the QKP efficiently in terms of ...
Comments