Skip to main content
Log in

An efficient population-based simulated annealing algorithm for 0–1 knapsack problem

  • Original Article
  • Published:
Engineering with Computers Aims and scope Submit manuscript

Abstract

0–1 knapsack problem (KP01) is one of the classic variants of knapsack problems in which the aim is to select the items with the total profit to be in the knapsack. In contrast, the constraint of the maximum capacity of the knapsack is satisfied. KP01 has many applications in real-world problems such as resource distribution, portfolio optimization, etc. The purpose of this work is to gather the latest SA-based solvers for KP01 together and compare their performance with the state-of-the-art meta-heuristics in the literature to find the most efficient one(s). This paper not only studies the introduced and non-introduced single-solution SA-based algorithms for KP01 but also proposes a new population-based SA (PSA) for KP01 and compares it with the existing methods. Computational results show that the proposed PSA is the most efficient optimization algorithm for KP01 among all SA-based solvers. Also, PSA’s exploration and exploitation are stronger than the other SA-based algorithms since it generates several initial solutions instead of one. Moreover, it finds the neighbor solutions based on the greedy repair and improvement mechanism and uses both mutation and crossover operators to explore and exploit the solution space. Suffice to say that the next version of SA algorithms for KP01 can be enhanced by designing a population-based version of them and choosing the greedy-based approaches for the initial solution phase and local search policy.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15

Similar content being viewed by others

Notes

  1. Single-solution based SA (SSA) works with one solution during the algorithm; however, population-based SA (PSA) starts with several initial solutions and improves them instead of working with only one solution.

References

  1. Abdel-Basset M, El-Shahat D, Faris H, Mirjalili S (2019) A binary multi-verse optimizer for 0–1 multidimensional knapsack problems with application in interactive multimedia systems. Comput Ind Eng 132:187–206

    Article  Google Scholar 

  2. Khemaja M, Khalfallah S (2019) Towards a knapsack model for optimizing e-training services delivery: application to hybrid intelligent tutoring systems. Procedia Comput Sci 164:257–264

    Article  Google Scholar 

  3. Samavati M, Essam D, Nehring M, Sarker R (2017) A methodology for the large-scale multi-period precedence-constrained knapsack problem: an application in the mining industry. Int J Prod Econ 193:12–20

    Article  Google Scholar 

  4. Simon J, Apte A, Regnier E (2017) An application of the multiple knapsack problem: the self-sufficient marine. Eur J Oper Res 256:868–876

    Article  MathSciNet  MATH  Google Scholar 

  5. Fischetti M, Ljubić I, Monaci M, Sinnl M (2019) Interdiction games and monotonicity, with application to knapsack problems. INFORMS J Comput 31:390–410

    Article  MathSciNet  MATH  Google Scholar 

  6. Khemaja M (2016) Using a knapsack model to optimize continuous building of a hybrid intelligent tutoring system: application to information technology professionals. Int J Hum Cap Inf Technol Prof (IJHCITP) 7:1–18

    Google Scholar 

  7. Abdel-Basset M, El-Shahat D, El-Henawy I (2019) Solving 0–1 knapsack problem by binary flower pollination algorithm. Neural Comput Appl 31:5477–5495

    Article  Google Scholar 

  8. Bazgan C, Hugot H, Vanderpooten D (2009) Solving efficiently the 0–1 multi-objective knapsack problem. Comput Oper Res 36:260–279

    Article  MathSciNet  MATH  Google Scholar 

  9. Gandibleux X, Freville A (2000) Tabu search based procedure for solving the 0–1 multiobjective knapsack problem: the two objectives case. J Heuristics 6:361–383

    Article  MATH  Google Scholar 

  10. Fleszar K, Hindi KS (2009) Fast, effective heuristics for the 0–1 multi-dimensional knapsack problem. Comput Oper Res 36:1602–1607

    Article  MathSciNet  MATH  Google Scholar 

  11. Chu PC, Beasley JE (1998) A genetic algorithm for the multidimensional knapsack problem. J Heuristics 4:63–86

    Article  MATH  Google Scholar 

  12. Ünal AN, Kayakutlu G (2016) A Partheno-genetic algorithm for dynamic 0–1 multidimensional knapsack problem. RAIRO Oper Res 50:47–66

    Article  MathSciNet  MATH  Google Scholar 

  13. Dell’Amico M, Delorme M, Iori M, Martello S (2019) Mathematical models and decomposition methods for the multiple knapsack problem. Eur J Oper Res 274:886–899

    Article  MathSciNet  MATH  Google Scholar 

  14. He C, Leung JY, Lee K, Pinedo ML (2016) An improved binary search algorithm for the multiple-choice knapsack problem. RAIRO Oper Res 50:995–1001

    Article  MathSciNet  MATH  Google Scholar 

  15. Chen Y, Hao J-K (2017) An iterated “hyperplane exploration” approach for the quadratic knapsack problem. Comput Oper Res 77:226–239

    Article  MathSciNet  MATH  Google Scholar 

  16. König D, Lohrey M, Zetzsche G (2016) Knapsack and subset sum problems in nilpotent, polycyclic, and co-context-free groups. Algebra Comput Sci 677:138–153

    MathSciNet  MATH  Google Scholar 

  17. Bortfeldt A, Winter T (2009) A genetic algorithm for the two-dimensional knapsack problem with rectangular pieces. Int Trans Oper Res 16:685–713

    Article  MATH  Google Scholar 

  18. Dantzig GB (1957) Discrete-variable extremum problems. Oper Res 5:266–288

    Article  MathSciNet  MATH  Google Scholar 

  19. Pisinger D (1995) An expanding-core algorithm for the exact 0–1 knapsack problem. Eur J Oper Res 87:175–187

    Article  MATH  Google Scholar 

  20. Della Croce F, Salassa F, Scatamacchia R (2017) An exact approach for the 0–1 knapsack problem with setups. Comput Oper Res 80:61–67

    Article  MathSciNet  MATH  Google Scholar 

  21. Shaheen A, Sleit A (2016) Comparing between different approaches to solve the 0/1 knapsack problem. Int J Comput Sci Netw Secur (IJCSNS) 16:1

    Google Scholar 

  22. Awasthi Y (2020) Contrasting of various algorithmic techniques to solve knapsack 0–1 problem. J Syst Integr 10:1–9

    Google Scholar 

  23. Shen J, Shigeoka K, Ino F, Hagihara K (2019) GPU-based branch-and-bound method to solve large 0–1 knapsack problems with data-centric strategies. Concurr Comput Pract Exp 31:e4954

    Article  Google Scholar 

  24. Shen J, Shigeoka K, Ino F, Hagihara K (2017) An out-of-core branch and bound method for solving the 0–1 knapsack problem on a GPU. In: International conference on algorithms and architectures for parallel processing. Springer, pp 254–267

  25. Kolahan F, Kayvanfar V (2009) A heuristic algorithm approach for scheduling of multi-criteria unrelated parallel machines. In: Proceeding of international conference on industrial and mechanical engineering—ICIME09 (World Academy of Science, Engineering and Technology, WASET), vol 59, pp 102–105

  26. Sapre S, Patel H, Vaishnani K, Thaker R, Shastri AS (2019) Solution to small size 0–1 knapsack problem using cohort intelligence with educated approach, socio-cultural inspired metaheuristics. Springer, Berlin, pp 137–149

    Google Scholar 

  27. Abdel-Basset M, El-Shahat D, Sangaiah AK (2019) A modified nature inspired meta-heuristic whale optimization algorithm for solving 0–1 knapsack problem. Int J Mach Learn Cybern 10:495–514

    Article  Google Scholar 

  28. Gómez-Herrera F, Ramirez-Valenzuela RA, Ortiz-Bayliss JC, Amaya I, Terashima-Marín H (2017) A quartile-based hyper-heuristic for solving the 0/1 knapsack problem. In: Mexican international conference on artificial intelligence. Springer, pp 118–128

  29. Hu F (2018) A probabilistic solution discovery algorithm for solving 0–1 knapsack problem. Int J Parallel Emerg Distrib Syst 33:618–626

    Article  Google Scholar 

  30. Gao Y, Zhang F, Zhao Y, Li C (2018) Quantum-inspired wolf pack algorithm to solve the 0–1 knapsack problem. In: Mathematical problems in engineering, 2018

  31. Zhan S, Wang L, Zhang Z, Zhong Y (2020) Noising methods with hybrid greedy repair operator for 0–1 knapsack problem. Memet Comput 12:37–50

    Article  Google Scholar 

  32. Truong TK, Li K, Xu Y, Ouyang A, Nguyen TT (2015) Solving 0–1 knapsack problem by artificial chemical reaction optimization algorithm with a greedy strategy. J Intell Fuzzy Syst 28:2179–2186

    Article  MathSciNet  MATH  Google Scholar 

  33. Feng Y, Wang G-G, Deb S, Lu M, Zhao X-J (2017) Solving 0–1 knapsack problem by a novel binary monarch butterfly optimization. Neural Comput Appl 28:1619–1634

    Article  Google Scholar 

  34. Abdel-Basset M, Mohamed R, Mirjalili S (2020) A Binary Equilibrium Optimization Algorithm for 0–1 Knapsack Problems. Comput Ind Eng 106946. https://doi.org/10.1016/j.cie.2020.106946

  35. Abdel-Basset M, Mohamed R, Chakrabortty RK, Ryan M, Mirjalili S (2020) New binary marine predators optimization algorithm for 0–1 knapsack problems. Comput Ind Eng 106949. https://doi.org/10.1016/j.cie.2020.106949

  36. Zhang X, Huang S, Hu Y, Zhang Y, Mahadevan S, Deng Y (2013) Solving 0–1 knapsack problems based on amoeboid organism algorithm. Appl Math Comput 219:9959–9970

    MathSciNet  MATH  Google Scholar 

  37. Bhattacharjee KK, Sarmah SP (2017) Modified swarm intelligence based techniques for the knapsack problem. Appl Intell 46:158–179

    Article  Google Scholar 

  38. Rizk-Allah RM, Hassanien AE (2018) New binary bat algorithm for solving 0–1 knapsack problem. Complex Intell Syst 4:31–53

    Article  Google Scholar 

  39. Cao J, Yin B, Lu X, Kang Y, Chen X (2018) A modified artificial bee colony approach for the 0–1 knapsack problem. Appl Intell 48:1582–1595

    Article  Google Scholar 

  40. Zhou Y, Bao Z, Luo Q, Zhang S (2017) A complex-valued encoding wind driven optimization for the 0–1 knapsack problem. Appl Intell 46:684–702

    Article  Google Scholar 

  41. Zhou Y, Li L, Ma M (2016) A complex-valued encoding bat algorithm for solving 0–1 knapsack problem. Neural Process Lett 44:407–430

    Article  Google Scholar 

  42. Kong X, Gao L, Ouyang H, Li S (2015) A simplified binary harmony search algorithm for large scale 0–1 knapsack problems. Expert Syst Appl 42:5337–5355

    Article  Google Scholar 

  43. Sonuc E, Sen B, Bayir S (2016) A parallel approach for solving 0/1 knapsack problem using simulated annealing algorithm on CUDA platform. Int J Comput Sci Inf Secur 14:1096

    Google Scholar 

  44. Zhou Y, Chen X, Zhou G (2016) An improved monkey algorithm for a 0–1 knapsack problem. Appl Soft Comput 38:817–830

    Article  Google Scholar 

  45. Sajedi H, Razavi SF (2017) DGSA: discrete gravitational search algorithm for solving knapsack problem. Oper Res Int J 17:563–591

    Article  Google Scholar 

  46. Feng L, Gupta A, Ong Y-S (2019) Compressed representation for higher-level meme space evolution: a case study on big knapsack problems. Memet Comput 11:3–17

    Article  Google Scholar 

  47. Zhang L, Lv J (2018) A heuristic algorithm based on expectation efficiency for 0–1 knapsack problem. Int J Innov Comput Inf Control 14:1833–1854

    Google Scholar 

  48. Zhan S-H, Zhang Z-J, Wang L-J, Zhong Y-W (2018) List-based simulated annealing algorithm with hybrid greedy repair and optimization operator for 0–1 knapsack problem. IEEE Access 6:54447–54458

    Article  Google Scholar 

  49. Abdel-Basset M, Zhou Y (2018) An elite opposition-flower pollination algorithm for a 0–1 knapsack problem. Int J Bio-Inspired Comput 11:46–53

    Article  Google Scholar 

  50. Feng Y, Yang J, Wu C, Lu M, Zhao X-J (2018) Solving 0–1 knapsack problems by chaotic monarch butterfly optimization algorithm with Gaussian mutation. Memet Comput 10:135–150

    Article  Google Scholar 

  51. Li J, Li W (2018) A new quantum evolutionary algorithm in 0-1 knapsack problem. In: International symposium on intelligence computation and applications. Springer, pp 142–151

  52. Feng Y, Wang G-G, Dong J, Wang L (2018) Opposition-based learning monarch butterfly optimization with Gaussian perturbation for large-scale 0–1 knapsack problem. Comput Electr Eng 67:454–468

    Article  Google Scholar 

  53. Nouioua M, Li Z, Jiang S (2018) New binary artificial bee colony for the 0–1 knapsack problem. In: International conference on swarm intelligence. Springer, pp 153–165

  54. Buayen P, Werapun J (2018) Parallel time–space reduction by unbiased filtering for solving the 0/1-knapsack problem. J Parallel Distrib Comput 122:195–208

    Article  Google Scholar 

  55. Huang Y, Wang P, Li J, Chen X, Li T (2019) A binary multi-scale quantum harmonic oscillator algorithm for 0–1 knapsack problem with genetic operator. IEEE Access 7:137251–137265

    Article  Google Scholar 

  56. Xue J, Xiao J, Zhu J (2019) Binary fireworks algorithm for 0–1 knapsack problem. In: 2019 international conference on artificial intelligence and advanced manufacturing (AIAM). IEEE, pp 218–222

  57. Ye L, Zheng J, Guo P, Pérez-Jiménez MJ (2019) Solving the 0–1 knapsack problem by using tissue P system with cell division. IEEE Access 7:66055–66067

    Article  Google Scholar 

  58. Ezugwu AE, Pillay V, Hirasen D, Sivanarain K, Govender M (2019) A comparative study of meta-heuristic optimization algorithms for 0–1 knapsack problem: some initial results. IEEE Access 7:43979–44001

    Article  Google Scholar 

  59. Czyzżak P, Jaszkiewicz A (1998) Pareto simulated annealing—a metaheuristic technique for multiple-objective combinatorial optimization. J Multi-Criteria Decis Anal 7:34–47

    Article  MATH  Google Scholar 

  60. Nahar S, Sahni S, Shragowitz E (1986) Simulated annealing and combinatorial optimization. In: 23rd ACM/IEEE design automation conference. IEEE, pp 293–299

  61. Yip PP, Pao Y-H (1995) Combinatorial optimization with use of guided evolutionary simulated annealing. IEEE Trans Neural Netw 6:290–295

    Article  Google Scholar 

  62. Glover FW, Kochenberger GA (2006) Handbook of metaheuristics. Springer Science & Business Media, Berlin

    MATH  Google Scholar 

  63. Kort BW, Bertsekas DP (1972) A new penalty function method for constrained minimization. In: Proceedings of the 1972 IEEE conference on decision and control and 11th symposium on adaptive processes. IEEE, pp 162–166

  64. Silberholz J, Golden B (2010) Comparison of metaheuristics, Handbook of metaheuristics. Springer, Berlin, pp 625–640

    Book  Google Scholar 

  65. Kayvanfar V, Moattar Husseini SM, Karimi B, Sajadieh MS (2017) Bi-objective intelligent water drops algorithm to a practical multi-echelon supply chain optimization problem. J Manuf Syst 44(1):93–114

    Article  Google Scholar 

  66. Teymourian E, Kayvanfar V, Komaki GHM, Khodarahmi M (2016) An enhanced intelligent water drops algorithm for scheduling of an agile manufacturing system. Int J Inf Technol Decis Mak 15(2):239–266

    Article  Google Scholar 

  67. Shahdi-Pashaki S, Teymourian E, Kayvanfar V, Komaki GHM, Sajadi A (2015) Group technology-based model and cuckoo optimization algorithm for resource allocation in cloud computing. In: Proceedings of 15th IFAC symposium on information control problems in manufacturing, Ottawa, Canada, May 2015

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Vahid Kayvanfar.

Ethics declarations

Conflict of interest

The authors reported no potential conflict of interest.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Moradi, N., Kayvanfar, V. & Rafiee, M. An efficient population-based simulated annealing algorithm for 0–1 knapsack problem. Engineering with Computers 38, 2771–2790 (2022). https://doi.org/10.1007/s00366-020-01240-3

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00366-020-01240-3

Keywords

Navigation