DOI QR코드

DOI QR Code

Exploring Efficient Solutions for the 0/1 Knapsack Problem

  • Dalal M. Althawadi (Department of Networks and Communication, College of Computer Science and Information Technology, Imam Abdulrahman Bin Faisal University) ;
  • Sara Aldossary (Department of Networks and Communication, College of Computer Science and Information Technology, Imam Abdulrahman Bin Faisal University) ;
  • Aryam Alnemari (Department of Networks and Communication, College of Computer Science and Information Technology, Imam Abdulrahman Bin Faisal University) ;
  • Malak Alghamdi (Department of Networks and Communication, College of Computer Science and Information Technology, Imam Abdulrahman Bin Faisal University) ;
  • Fatema Alqahtani (Department of Networks and Communication, College of Computer Science and Information Technology, Imam Abdulrahman Bin Faisal University) ;
  • Atta-ur Rahman (Department of Computer Science, College of Computer Science and Information Technology, Imam Abdulrahman Bin Faisal University) ;
  • Aghiad Bakry (Department of Computer Science, College of Computer Science and Information Technology, Imam Abdulrahman Bin Faisal University) ;
  • Sghaier Chabani (Department of Networks and Communication, College of Computer Science and Information Technology, Imam Abdulrahman Bin Faisal University)
  • Received : 2024.02.05
  • Published : 2024.02.29

Abstract

One of the most significant issues in combinatorial optimization is the classical NP-complete conundrum known as the 0/1 Knapsack Problem. This study delves deeply into the investigation of practical solutions, emphasizing two classic algorithmic paradigms, brute force, and dynamic programming, along with the metaheuristic and nature-inspired family algorithm known as the Genetic Algorithm (GA). The research begins with a thorough analysis of the dynamic programming technique, utilizing its ability to handle overlapping subproblems and an ideal substructure. We evaluate the benefits of dynamic programming in the context of the 0/1 Knapsack Problem by carefully dissecting its nuances in contrast to GA. Simultaneously, the study examines the brute force algorithm, a simple yet comprehensive method compared to Branch & Bound. This strategy entails investigating every potential combination, offering a starting point for comparison with more advanced techniques. The paper explores the computational complexity of the brute force approach, highlighting its limitations and usefulness in resolving the 0/1 Knapsack Problem in contrast to the set above of algorithms.

Keywords

References

  1. Terh, F. (2019). How to solve the Knapsack problem with dynamic programming. Retrieved from https://medium.com/@fabianterh/how-to-solve-the-knapsack-problem-with-dynamic-programming-eb88c706d3cf 
  2. Al-Fareed, H., Alghamdi, O., Alshuraya, A., Alqahtani, M., Alwasfer, S., Aljomea, A., Rahman, A., Aljameel, S., Krishnasamy, G. (2022). Simulator for scheduling real-time systems with reduced power consumption. Mathematical Modelling of Engineering Problems, Vol. 9, No. 5, pp. 1225-1232.  https://doi.org/10.18280/mmep.090509
  3. W. Hantom, A. Aldweesh, R. Alzaher, A. Rahman, "A Survey on Scheduling Algorithms in Real-Time Systems," IJCSNS - International Journal of Computer Science and Network Security 22(4), 686-690, 2022. 
  4. N. AlDossary, S. AlQahtani, H. AlUbaidan, A. Rahman, "A Survey on Resource Allocation Algorithms and Models in Cloud Computing," IJCSNS International Journal of Computer Science and Network Security 22 (3), 776-782, 2022. 
  5. A. Obregon, "Introduction to sorting algorithms in java: A beginner's guide," Medium, https://medium.com/@AlexanderObregon/introduction-to-sorting-algorithms-in-java-abeginners-guide-db522047effb (accessed Nov. 30, 2023). 
  6. "Counting sort - data structures and algorithms tutorials," GeeksforGeeks, https://www.geeksforgeeks.org/counting-sort/ (accessed Nov. 30, 2023). 
  7. I. Qureshi, "CPU Scheduling Algorithms: A Survey," Int. J. Advanced Networking and Applications, vol. 5, no. 4, pp. 1968-2973, 2014. 
  8. I. Alrashide, H. Alkhalifah, A.A. Al-Momen, I. Alali, G. Alshaikh et al., "AIMS: AI based Mental Healthcare System," IJCSNS - International Journal of Computer Science and Network Security 23(12), 225-234, 2023. 
  9. A. Alhashem, A. Abdulbaset, F. Almudarra, H. Alshareef, M. Alqasoumi et al., "Diabetes Detection and Forecasting using Machine Learning Approaches: Current State-of-the-art," IJCSNS - International Journal of Computer Science and Network Security 23(10), 199-208, 2023. 
  10. A. Albassam, F. Almutairi, N. Majoun, R. Althukair, Z. Alturaiki et al., "Integration of Blockchain and Cloud Computing in Telemedicine and Healthcare," IJCSNS - International Journal of Computer Science and Network Security 23(6), 17-26, 2023. 
  11. M Mahmud, A Rahman, M Lee, JY Choi, "Evolutionary-based image encryption using RNA codons truth table," Optics & Laser Technology 121, 105818, 2020. 
  12. Atta-ur-Rahman, Dash, S., Luhach, A.K. et al. A Neuro-fuzzy approach for user behaviour classification and prediction. J Cloud Comp 8, 17 (2019). https://doi.org/10.1186/s13677-019-0144-9. 
  13. Atta-ur-Rahman, Sultan, K., Aldhafferi, N., Alqahtani, A. (2018). Differential Evolution Assisted MUD for MC-CDMA Systems Using Non-Orthogonal Spreading Codes. In: Abraham, A., Haqiq, A., Muda, A., Gandhi, N. (eds) Innovations in Bio-Inspired Computing and Applications. IBICA 2017. Advances in Intelligent Systems and Computing, vol 735. Springer, Cham. 
  14. A Rahman, M Mahmud, K Sultan, N Aldhafferi, A Alqahtani, D Musleh, "Medical Image Watermarking for Fragility and Robustness: A Chaos, ECC and RRNS Based Approach," Journal of Medical Imaging and Health Informatics 8 (6), 1192-1200, 2018.  https://doi.org/10.1166/jmihi.2018.2431
  15. A Rahman, IM Qureshi, AN Malik, MT Naseem, "Dynamic resource allocation in OFDM systems using DE and FRBS," Journal of Intelligent and Fuzzy Systems 26 (4), 2035-2046, 2014.  https://doi.org/10.3233/IFS-130880
  16. Atta-ur-Rahman, D. -e. -N. Zaidi, M. H. Salam and S. Jamil, "User behaviour classification using Fuzzy Rule Based System," 13th International Conference on Hybrid Intelligent Systems (HIS 2013), Gammarth, Tunisia, 2013, pp. 117-122. 
  17. Atta-Ur-Rahman, I. M. Qureshi, M. H. Salam and M. Z. Muzaffar, "Adaptive communication using softcomputing techniques," 2013 International Conference on Soft Computing and Pattern Recognition (SoCPaR), Hanoi, Vietnam, 2013, pp. 19-24, doi: 10.1109/SOCPAR.2013.7054131. 
  18. Atta-ur-Rahman, M. H. Salam, M. T. Naseem and M. Z. Muzaffar, "An intelligent link adaptation scheme for OFDM based Hyperlans," 2013 International Conference on Soft Computing and Pattern Recognition (SoCPaR), Hanoi, Vietnam, 2013, pp. 360-365, doi: 10.1109/SOCPAR.2013.7054159. 
  19. Atta-ur-Rahman, I. M. Qureshi, M. H. Salam and M. T. Naseem, "Efficient link adaptation in OFDM systems using a hybrid intelligent technique," 13th International Conference on Hybrid Intelligent Systems (HIS 2013), Gammarth, Tunisia, 2013, pp. 12-17, doi: 10.1109/HIS.2013.6920471. 
  20. RA Qamar, M Sarfraz, A Rahman, SA Ghauri, "Multi-Criterion Multi-UAV Task Allocation under Dynamic Conditions," Journal of King Saud University-Computer and Information Sciences 35 (9), 101734, 2023. 
  21. Z Alsadeq, H Alubaidan, A Aldweesh, A Rahman, T Iqbal, "A Proposed Model for Supply Chain using Blockchain Framework," IJCSNS - International Journal of Computer Science and Network Security 23(6), 91-98, 2023. 
  22. S. Arooj, M. F. Khan, T. Shahzad, M. A. Khan, M. U. Nasir et al., "Data fusion architecture empowered with deep learning for breast cancer classification," Computers, Materials & Continua, vol. 77, no.3, pp. 2813-2831, 2023.  https://doi.org/10.32604/cmc.2023.043013
  23. Jan, F.; Rahman, A.; Busaleh, R.; Alwarthan, H.; Aljaser, S.; Al-Towailib, S.; Alshammari, S.; Alhindi, K.R.; Almogbil, A.; Bubshait, D.A.; et al. Assessing Acetabular Index Angle in Infants: A Deep Learning-Based Novel Approach. J. Imaging 2023, 9, 242. 
  24. M. M. Qureshi, F. B. Yunus, J. Li, A. Ur-Rahman, T. Mahmood and Y. A. A. Ali, "Future Prospects and Challenges of On-Demand Mobility Management Solutions," in IEEE Access, vol. 11, pp. 114864-114879, 2023, doi: 10.1109/ACCESS.2023.3324297. 
  25. M. Gollapalli, A. -U. Rahman, A. Osama, A. Alfaify, M. Yassin and A. Alabdullah, "Data Mining and Visualization to Understand Employee Attrition and Work Performance," 2023 3rd International Conference on Computing and Information Technology (ICCIT), Tabuk, Saudi Arabia, 2023, pp. 149-154, doi: 10.1109/ICCIT58132.2023.10273889. 
  26. Musleh, D.A.; Olatunji, S.O.; Almajed, A.A.; Alghamdi, A.S.; Alamoudi, B.K.; Almousa, F.S.; Aleid, R.A.; Alamoudi, S.K.; Jan, F.; Al-Mofeez, K.A.; et al. Ensemble Learning Based Sustainable Approach to Carbonate Reservoirs Permeability Prediction. Sustainability 2023, 15, 14403. 
  27. Ahmed, M.I.B.; Saraireh, L.; Rahman, A.; Al-Qarawi, S.; Mhran, A.; Al-Jalaoud, J.; Al-Mudaifer, D.; Al-Haidar, F.; AlKhulaifi, D.; Youldash, M.; et al. Personal Protective Equipment Detection: A Deep-Learning-Based Sustainable Approach. Sustainability 2023, 15, 13990. 
  28. Ahmed, M.I.B.; Alabdulkarem, H.; Alomair, F.; Aldossary, D.; Alahmari, M.; Alhumaidan, M.; Alrassan, S.; Rahman, A.; Youldash, M.; Zaman, G. A Deep-Learning Approach to Driver Drowsiness Detection. Safety 2023, 9, 65. 
  29. Ahmed, M.I.B.; Alotaibi, R.B.; Al-Qahtani, R.A.; Al-Qahtani, R.S.; Al-Hetela, S.S.; Al-Matar, K.A.; Al-Saqer, N.K.; Rahman, A.; Saraireh, L.; Youldash, M.; et al. Deep Learning Approach to Recyclable Products Classification: Towards Sustainable Waste Management. Sustainability 2023, 15, 11138. 
  30. Sajid, N.A.; Rahman, A.; Ahmad, M.; Musleh, D.; Basheer Ahmed, M.I.; Alassaf, R.; Chabani, S.; Ahmed, M.S.; Salam, A.A.; AlKhulaifi, D. Single vs. Multi-Label: The Issues, Challenges and Insights of Contemporary Classification Schemes. Appl. Sci. 2023, 13, 6804. 
  31. Gollapalli, M.; Rahman, A.; Alkharraa, M.; Saraireh, L.; AlKhulaifi, D.; Salam, A.A.; Krishnasamy, G.; Alam Khan, M.A.; Farooqui, M.; Mahmud, M.; et al. SUNFIT: A Machine Learning-Based Sustainable University Field Training Framework for Higher Education. Sustainability 2023, 15, 8057. 
  32. Talha, M.; Sarfraz, M.; Rahman, A.; Ghauri, S.A.; Mohammad, R.M.; Krishnasamy, G.; Alkharraa, M. Voting-Based Deep Convolutional Neural Networks (VB-DCNNs) for M-QAM and M-PSK Signals Classification. Electronics 2023, 12, 1913. 
  33. T. A. Khan et al., "Secure IoMT for Disease Prediction Empowered with Transfer Learning in Healthcare 5.0, the Concept and Case Study," in IEEE Access, vol. 11, pp. 39418-39430, 2023, doi: 10.1109/ACCESS.2023.3266156. 
  34. Musleh, D.; Alotaibi, M.; Alhaidari, F.; Rahman, A.; Mohammad, R.M. Intrusion Detection System Using Feature Extraction with Machine Learning Algorithms in IoT. J. Sens. Actuator Netw. 2023, 12, 29. https://doi.org/10.3390/jsan12020029. 
  35. Alghamdi, A.S.; Rahman, A. Data Mining Approach to Predict Success of Secondary School Students: A Saudi Arabian Case Study. Educ. Sci. 2023, 13, 293. 
  36. MA Qureshi, M Asif, S Anwar, U Shaukat, MA Khan, A Mosavi, "Aspect Level Songs Rating Based Upon Reviews in English," Computers, Materials & Continua 74 (2), 2589-2605, 2023.  https://doi.org/10.32604/cmc.2023.032173
  37. NA Sajid, M Ahmad, A Rahman, G Zaman, MS Ahmed, N Ibrahim et al., "A Novel Metadata Based Multi-Label Document Classification Technique," Computer Systems Science and Engineering 46 (2), 2195-2214, 2023.  https://doi.org/10.32604/csse.2023.033844
  38. Basheer Ahmed, M.I.; Zaghdoud, R.; Ahmed, M.S.; Sendi, R.; Alsharif, S.; Alabdulkarim, J.; Albin Saad, B.A.; Alsabt, R.; Rahman, A.; Krishnasamy, G. A Real-Time Computer Vision Based Approach to Detection and Classification of Traffic Incidents. Big Data Cogn. Comput. 2023, 7, 22. 
  39. Alqarni, A.; Rahman, A. Arabic Tweets-Based Sentiment Analysis to Investigate the Impact of COVID-19 in KSA: A Deep Learning Approach. Big Data Cogn. Comput. 2023, 7, 16. 
  40. S Abbas, SA Raza, MA Khan, A Rahman, K Sultan, A Mosavi, "Automated File Labeling for Heterogeneous Files Organization Using Machine Learning," Computers, Materials & Continua 74 (2), 3263-3278, 2023.  https://doi.org/10.32604/cmc.2023.032864
  41. MS Farooq, S Abbas, A Rahman, K Sultan, MA Khan, A Mosavi, "A Fused Machine Learning Approach for Intrusion Detection System," Computers, Materials & Continua 74 (2), 2607-2623, 2023.  https://doi.org/10.32604/cmc.2023.032617
  42. Alhaidari, F., Rahman, A. & Zagrouba, R. Cloud of Things: architecture, applications and challenges. J Ambient Intell Human Comput 14, 5957-5975 (2023). https://doi.org/10.1007/s12652-020-02448-3. 
  43. Rahman, A. GRBF-NN based ambient aware realtime adaptive communication in DVB-S2. J Ambient Intell Human Comput 14, 5929-5939 (2023).  https://doi.org/10.1007/s12652-020-02174-w
  44. Ahmad, M., Qadir, M.A., Rahman, A. et al. Enhanced query processing over semantic cache for cloud-based relational databases. J Ambient Intell Human Comput 14, 5853-5871 (2023).  https://doi.org/10.1007/s12652-020-01943-x
  45. M Jamal, NA Zafar, D Musleh, MA Gollapalli, S Chabani, "Modeling and Verification of Aircraft Takeoff Through Novel Quantum Nets," Computers, Materials & Continua 72 (2), 3331-3348, 2022.  https://doi.org/10.32604/cmc.2022.025205
  46. M.U. Nasir, T.M. Ghazal, M.A. Khan, M. Zubair, Atta-ur Rahman, R. Ahmed, H. AlHamadi, C.Y.Yeun, "Breast Cancer Prediction Empowered with Fine-Tuning", Computational Intelligence and Neuroscience, vol. 2022, Article ID 5918686, 2022. 
  47. A Rahman, M Ahmed, G Zaman, T Iqbal, MAA Khan et al., "Geo-Spatial Disease Clustering for Public Health Decision Making," Informatica 46 (6), 21-32, 2022. 
  48. Atta-ur-Rahman, Ibrahim, N.M., Musleh, D., Khan, M.A.A., Chabani, S., Dash, S. (2022). Cloud-Based Smart Grids: Opportunities and Challenges. In: Dehuri, S., Prasad Mishra, B.S., Mallick, P.K., Cho, SB. (eds) Biologically Inspired Techniques in Many Criteria Decision Making. Smart Innovation, Systems and Technologies, vol 271. Springer, Singapore. 
  49. M.B.S Khan, Atta-ur-Rahman, M.S. Nawaz, R. Ahmed, M.A. Khan, A. Mosavi. Intelligent breast cancer diagnostic system empowered by deep extreme gradient descent optimization[J] Mathematical Biosciences and Engineering, 2022, 19(8): 7978-8002. doi: 10.3934/mbe.2022373. 
  50. F Al-Jawad, R Alessa, S Alhammad, B Ali, M Al-Qanbar, A Rahman, "Applications of 5G and 6G in Smart Health Services," IJCSNS, 22 (3): 173-182, 2022. 
  51. A Rahman, K Sultan, I Naseer, R Majeed, D Musleh et al., "Supervised machine learning-based prediction of COVID-19," Computers, Materials and Continua 69 (1), 21-34, 2021.  https://doi.org/10.32604/cmc.2021.013453
  52. R Zagrouba, A AlAbdullatif, K AlAjaji et al., "Authenblue: A New Authentication Protocol for the Industrial Internet of Things," Computers, Materials & Continua 67 (1), 1103- 1119, 2021.  https://doi.org/10.32604/cmc.2021.014035
  53. G Zaman, H Mahdin, K Hussain, A Rahman, et al., "Digital Library of Online PDF Sources: An ETL Approach," IJCSNS 20 (11), 172-181, 2020. 
  54. A Rahman, "Memetic computing based numerical solution to Troesch problem," Journal of Intelligent and Fuzzy Systems 36 (6), 1-10, 2019.  https://doi.org/10.3233/JIFS-17063
  55. A Rahman, "Optimum information embedding in digital watermarking," Journal of Intelligent and Fuzzy Systems 37 (1), 553-564, 2019.  https://doi.org/10.3233/JIFS-162405
  56. Pan, X. and Zhang, T. (2018) 'Comparison and analysis of algorithms for the 0/1 Knapsack problem', Journal of Physics: Conference Series, 1069, p. 012024. doi:10.1088/1742-6596/1069/1/012024. 
  57. Algorithm Design, "What are the pros and cons of dynamic programming vs. greedy methods for the knapsack problem?" www.linkedin.com. Accessed on Nov. 20, 2023. 
  58. T. Pradhan, A. Israni and M. Sharma, "Solving the 0-1 Knapsack problem using Genetic Algorithm and Rough Set Theory," IEEE International Conference on Advanced Communications, Control and Computing Technologies, Ramanathapuram, India, 2014, pp. 1120-1125. 
  59. Florian, "0/1 Knapsack problem," Medium, https://medium.com/@florian_algo/0-1-knapsack-problem-eec333f4a991 (accessed Nov. 30, 2023). 
  60. "0/1 knapsack using branch and bound," GeeksforGeeks, https://www.geeksforgeeks.org/0-1-knapsack-using-branch-and-bound/ (accessed Nov. 30, 2023). 
  61. I.A. Qureshi, K.A. Bhatti, A. Rahman, et al., "GFuCWO: A genetic fuzzy logic technique to optimize contention window of IEEE-802.15. 6 WBAN," Ain Shams Engineering Journal, 10268, 2024, doi: 10.1016/j.asej.2024.102681. 
  62. M.A. Khan, S. Abbas, A. Atta et al., "Intelligent cloud based heart disease prediction system empowered with supervised machine learning," Computers, Materials & Continua 65 (1), 139-151, 2020.  https://doi.org/10.32604/cmc.2020.011416
  63. A Rahman, IM Qureshi, AN Malik, "Adaptive Resource Allocation in OFDM Systems Using GA and Fuzzy Rule Base System," World Applied Sciences Journal 18 (6), 836-844, 2021. 
  64. S Dash, BK Tripathy, A Rahman, "Handbook of Research on Modeling, Analysis, and Application of Nature-Inspired Metaheuristic Algorithms," IGI Global 1, 540, 2017. 
  65. M. T. Naseem, I. M. Qureshi, A. Rahman and M. Z. Muzaffar, "Robust watermarking for medical images resistant to geometric attacks," in Proc. INMIC, Islamabad, Pakistan, 2012, pp. 224-228.