Using Heuristic Algorithms to Solve the 0-1 Knapsack Problem

Authors

  • Sanatan Mishra Homestead High School
  • David Perkins Hamilton College

DOI:

https://doi.org/10.47611/jsrhs.v12i4.5660

Keywords:

NP-Complete Problem, Heuristic Algorithms, 0-1 Knapsack Problem, Novel Heuristics, Performance and Accuracy Analysis

Abstract

The 0-1 Knapsack problem is an NP-complete optimization problem with applications in many places where the most valuable items must be selected for a finite pool. Heuristic algorithms are used to solve that problem, as the exact solutions take far too much time to be useful in such applications. This paper introduces ten novel heuristic algorithms. After that, the paper analyzes their performance on 29 publicly available datasets against one existing heuristic algorithm named “Standard Greedy.” The results show that one of the novel heuristics, “Defensive Greedy,” is the best in balancing speed and accuracy with a time complexity of O(n log n). The advantages of “Defensive Greedy” include that it is around 44.8% faster than “Standard Greedy” and much faster than any exact solution. However, its primary disadvantage is that it lags behind “Standard Greedy” in accuracy by approximately 28%. The nine other novel heuristics were not as fast as “Defensive Greedy,” but two novel heuristics, “Max of All” and “Max of Two,” had a higher accuracy of 2.9% and 2.6%, respectively, than that of “Standard Greedy.”

Downloads

Download data is not yet available.

References or Bibliography

Michail G. Lagoudakis. The 0-1 knapsack problem – an introductory survey. 1996. https://www.semanticscholar.org/paper/The-0-%E2%80%93-1-Knapsack-Problem-An-Introductory-Survey-Lagoudakis/6bd62e0ba7233c5086fe4b9061926d191894714b (accessed 2022-07-13).

V. Reddy Dondeti and Bidhu B. Mohanty. Impact of learning and fatigue factors on single machine scheduling with penalties for tardy jobs. 1996. https://www.sciencedirect.com/science/article/abs/pii/S0377221797000702 (accessed 2022-08-07).

Kayode Badiru. Knapsack problems; methods, models and applications. 2009. https://shareok.org/handle/11244/319274 (accessed 2022-07-16).

Hans Kellerer, Ulrich Pferschy, and David Pisinger. Knapsack Problems. Springer, 2004. https://link.springer.com/book/10.1007/978-3-540-24777-7 (accessed 2022-07-16).

MIT OpenCourseWare. Lecture 17 complexity and np-completeness. https://ocw.mit.edu/courses/6-046j-design-and-analysis-of-algorithms-spring-2012/b4562881f2af637e09e806450e9b62c8_MIT6_046JS12_lec17.pdf (accessed 2022-07-14).

Paul Black. Np-hard. https://xlinux.nist.gov/dads/HTML/nphard.html (accessed 2022-06-28).

Xinyang Wang, Yuncheng Jia, and Simin Li. The complete proof of knapsack problem is np-completeness. https://www.scribd.com/document/446317042/The-Complete-Proof-of-Knapsack-Problem-is-NP-Completeness (accessed 2022-08-05)

Maya Hristakeva and Dipti Shrestha. Different approaches to solve the 0/1 knapsack problem. 2005. https://www.micsymposium.org/mics_2005/papers/paper102.pdf (accessed 2022-07-13).

Ellis Horowitz and Sartaj Sahni. Computing partitions with applications to the knapsack problem. 1974. https://dl.acm.org/doi/10.1145/321812.321823 (accessed 2022-08-03).

Vijay Vazirani. Approximation Algorithms. Springer, 2001. https://www.ics.uci.edu/~vazirani/book.pdf (accessed 2022-07-12).

Paul E. Black. greedy algorithm. https://xlinux.nist.gov/dads//HTML/greedyalgo.html (accessed 2022-07-04).

George B. Dantzig. Discrete-variable extremum problems. 1957. https://www.jstor.org/stable/167356 (accessed 2022-07-27).

Johny Ortega. Instances of 0/1 knapsack problem. http://artemisa.unicauca.edu.co/~johnyortega/instances_01_KP/ (accessed 2022-07-23).

John Burkardt. Knapsack_ 01 data for the 01 knapsack problem. https://people.sc.fsu.edu/~jburkardt/datasets/knapsack_01/knapsack_01.html (accessed 2022-07-21).

Published

11-30-2023

How to Cite

Mishra, S., & Perkins, D. (2023). Using Heuristic Algorithms to Solve the 0-1 Knapsack Problem. Journal of Student Research, 12(4). https://doi.org/10.47611/jsrhs.v12i4.5660

Issue

Section

HS Research Articles