Skip to main content

Solving 0–1 knapsack problem by a novel binary monarch butterfly optimization


This paper presents a novel binary monarch butterfly optimization (BMBO) method, intended for addressing the 0–1 knapsack problem (0–1 KP). Two tuples, consisting of real-valued vectors and binary vectors, are used to represent the monarch butterfly individuals in BMBO. Real-valued vectors constitute the search space, whereas binary vectors form the solution space. In other words, monarch butterfly optimization works directly on real-valued vectors, while solutions are represented by binary vectors. Three kinds of individual allocation schemes are tested in order to achieve better performance. Toward revising the infeasible solutions and optimizing the feasible ones, a novel repair operator, based on greedy strategy, is employed. Comprehensive numerical experimentations on three types of 0–1 KP instances are carried out. The comparative study of the BMBO with four state-of-the-art classical algorithms clearly points toward the superiority of the former in terms of search accuracy, convergent capability and stability in solving the 0–1 KP, especially for the high-dimensional instances.

This is a preview of subscription content, access via your institution.

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
Fig. 16
Fig. 17


  1. 1.

    Du DZ, Ko KI, Hu X (2011) Design and analysis of approximation algorithms. Springer, Berlin

    Google Scholar 

  2. 2.

    Mavrotas G, Diakoulaki D, Kourentzis A (2008) Selection among ranked projects under segmentation, policy and logical constraints. Eur J Oper Res 187(1):177–192. doi:10.1016/j.ejor.2007.03.010

    Article  MATH  Google Scholar 

  3. 3.

    Vanderster DC, Dimopoulos NJ, Parra-Hernandez R et al (2009) Resource allocation on computational grids using a utility model and the knapsack problem. Future Gener Comput Syst 25(1):35–50. doi:10.1016/j.future.2008.07.006

    Article  Google Scholar 

  4. 4.

    PeetaS Salman FS, Gunnec D et al (2010) Pre-disaster investment decisions for strengthening a highway network. Comput Oper Res 37(10):1708–1719. doi:10.1016/j.cor.2009.12.006

    Article  MATH  Google Scholar 

  5. 5.

    Yates J, Lakshmanan K (2011) A constrained binary knapsack approximation for shortest path network interdiction. Comput Ind Eng 61(4):981–992. doi:10.1016/j.cie.2011.06.011

    Article  Google Scholar 

  6. 6.

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

    MathSciNet  Article  Google Scholar 

  7. 7.

    Shih W (1979) A branch and bound method for the multi-constraint zero-one knapsack problem. J Oper Res Soc. doi:10.2307/3009639

    MATH  Google Scholar 

  8. 8.

    Toth P (1980) Dynamic programing algorithms for the zero-one knapsack problem. Computing 25(1):29–45. doi:10.1007/BF02243880

    MathSciNet  Article  MATH  Google Scholar 

  9. 9.

    Plateau G, Elkihel M (1985) A hybrid method for the 0–1 knapsack problem. Methods Oper Res 49:277–293

    MathSciNet  MATH  Google Scholar 

  10. 10.

    Thiel J, Voss S (1994) Some experiences on solving multi constraint zero-one knapsack problems with genetic algorithms. INFOR 32(4):226–242

    MATH  Google Scholar 

  11. 11.

    Chen P, Li J, Liu ZM (2008) Solving 0–1 knapsack problems by a discrete binary version of differential evolution. In: Second international symposium on intelligent information technology application, vol 2, pp 513–516. doi:10.1109/IITA.2008.538

  12. 12.

    Bhattacharjee KK, Sarmah SP (2014) Shuffled frog leaping algorithm and its application to 0/1 knapsack problem. Appl Soft Comput 19:252–263. doi:10.1016/j.asoc.2014.02.010

    Article  Google Scholar 

  13. 13.

    Feng YH, Jia K, and He YC (2014) An improved hybrid encoding cuckoo search algorithm for 0–1 knapsack problems. Comput Intell Neurosci 2014:970456. doi:10.1155/2014/970456

  14. 14.

    Feng YH, Wang GG, Feng QJ, Zhao XJ (2014) An effective hybrid cuckoo search algorithm with improved shuffled frog leaping algorithm for 0–1 knapsack problems. Comput Intell Neurosci. doi:10.1155/2014/857254

    Google Scholar 

  15. 15.

    Kashan MH, Nahavandi N, Kashan AH (2012) DisABC: a new artificial bee colony algorithm for binary optimization. Appl Soft Comput 12(1):342–352. doi:10.1016/j.asoc.2011.08.038

    Article  Google Scholar 

  16. 16.

    Zou D, Gao L, Li S, Wu J (2011) Solving 0–1 knapsack problem by a novel global harmony search algorithm. Appl Soft Comput 11(2):1556–1564. doi:10.1016/j.asoc.2010.07.019

    Article  Google Scholar 

  17. 17.

    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(12):5337–5355. doi:10.1016/j.eswa.2015.02.015

    Article  Google Scholar 

  18. 18.

    Zhou Y, Li L, Ma M (2015) A complex-valued encoding bat algorithm for solving 0–1 knapsack problem. Neural Process Lett. doi:10.1007/s11063-015-9465-y

    Google Scholar 

  19. 19.

    Mirjalili S (2015) The ant lion optimizer. Adv Eng Softw 83:80–98

    Article  Google Scholar 

  20. 20.

    Yang XS, Deb S, Fong S (2014) Bat algorithm is better than intermittent search strategy. J Multi-Valued Log Soft Comput 22(3):223–237

    Google Scholar 

  21. 21.

    Simon D (2008) Biogeography-based optimization. IEEE Trans Evol Comput 12(6):702–713. doi:10.1109/TEVC.2008.919004

    Article  Google Scholar 

  22. 22.

    Li X, Wang J, Zhou J, Yin M (2011) A perturb biogeography based optimization with mutation for global numerical optimization. Appl Math Comput 218(2):598–609. doi:10.1016/j.amc.2011.05.110

    MathSciNet  MATH  Google Scholar 

  23. 23.

    Kaveh A, Talatahari S (2010) A novel heuristic optimization method: charged system search. Acta Mech 213(3–4):267–289. doi:10.1007/s00707-009-0270-4

    Article  MATH  Google Scholar 

  24. 24.

    Srivastava PR, Chis M, Deb S et al (2012) An efficient optimization algorithm for structural software testing. Int J Artif Intell™ 8(S12):68–77

    Google Scholar 

  25. 25.

    Wang G-G, Guo LH, Duan H et al (2012) A hybrid meta-heuristic DE/CS algorithm for UCAV path planning. J Inform Comput Sci 9(16):4811–4818

    Google Scholar 

  26. 26.

    Wang G-G, Gandomi AH, Zhao XJ et al (2014) Hybridizing harmony search algorithm with cuckoo search for global numerical optimization. Soft Comput. doi:10.1007/s00500-014-1502-7

    Google Scholar 

  27. 27.

    Li X, Zhang J, Yin M (2014) Animal migration optimization: an optimization algorithm inspired by animal migration behavior. Neural Comput Appl 24(7–8):1867–1877. doi:10.1007/s00521-013-1433-8

    Article  Google Scholar 

  28. 28.

    Wang G-G, Guo LH, Wang HQ et al (2014) Incorporating mutation scheme into krill herd algorithm for global numerical optimization. Neural Comput Appl 24(3–4):853–871. doi:10.1007/s00521-012-1304-8

    Article  Google Scholar 

  29. 29.

    Wang GG, Gandomi AH, Yang XS, et al (2012) A new hybrid method based on krill herd and cuckoo search for global optimization tasks. Int J Bio-Inspired Comput

  30. 30.

    Wang G-G, Gandomi AH, Alavi AH et al (2015) A hybrid method based on krill herd and quantum-behaved particle swarm optimization. Neural Comput Appl. doi:10.1007/s00521-015-1914-z

    Google Scholar 

  31. 31.

    Wang G-G, Guo LH, Gandomi AH et al (2014) Chaotic krill herd algorithm. Inf Sci 274:17–34

    MathSciNet  Article  Google Scholar 

  32. 32.

    Wang G-G, Gandomi AH, Alavi AH (2014) Stud krill herd algorithm. Neurocomputing 128:363–370

    Article  Google Scholar 

  33. 33.

    Fong S, Deb S, Yang XS (2015) A heuristic optimization method inspired by wolf preying behavior. Neural Comput Appl. doi:10.1007/s00521-015-1836-9

    Google Scholar 

  34. 34.

    Cui Z, Fan S, Zeng J et al (2013) Artificial plant optimization algorithm with three-period photosynthesis. Int J Bio-Inspired Comput 5(2):133–139. doi:10.1504/IJBIC.2013.053507

    Article  Google Scholar 

  35. 35.

    Wang L, Yang R, Ni H et al (2015) A human learning optimization algorithm and its application to multi-dimensional knapsack problems. Appl Soft Comput 34:736–743. doi:10.1016/j.asoc.2015.06.004

    Article  Google Scholar 

  36. 36.

    Fong S, Yang XS, Deb S (2013) Swarm search for feature selection in classification. In: Computational science and engineering (CSE), 2013 IEEE 16th international conference on. IEEE, pp 902–909

  37. 37.

    Wang G-G, Deb S, Coelho LDS (2015) Earthworm optimization algorithm: a bio-inspired metaheuristic algorithm for global optimization problems. Int J Bio-Inspired Comput in press

  38. 38.

    Mirjalili SA, Hashim SZM (2011). BMOA: binary magnetic optimization algorithm. In: 2011 3rd international conference on machine learning and computing (ICMLC 2011), Singapore, pp 201–206

  39. 39.

    Wang G-G, Deb S, Cui Z (2015) Monarch butterfly optimization. Neural Comput Appl. doi:10.1007/s00521-015-1923-y

    Google Scholar 

  40. 40.

    Wang G-G, Zhao XC, Deb S (2015). A novel monarch butterfly optimization with greedy strategy and self-adaptive crossover operator. In: the 2015 2nd international conference on soft computing & machine intelligence (ISCMI 2015), Hong Kong. IEEE

  41. 41.

    He Y, Zhang X, Li W et al (2014) Algorithms for randomized time-varying knapsack problems. J Comb Optim. doi:10.1007/s10878-014-9717-1

    MATH  Google Scholar 

  42. 42.

    Yang XS (2010) Nature-inspired metaheuristic algorithms. Luniver Press, Frome

  43. 43.

    Joines JA, Houck CR (1994) On the use of non-stationary penalty functions to solve nonlinear constrained optimization problems with GA’s. In: Evolutionary computation, 1994. IEEE World Congress on computational intelligence. Proceedings of the first IEEE conference on. IEEE, pp 579–584. doi:10.1109/ICEC.1994.349995

  44. 44.

    Olsen AL (1994) Penalty functions and the knapsack problem. In: Evolutionary computation, 1994. IEEE World congress on computational intelligence. Proceedings of the first IEEE conference on. IEEE, pp 554–558. doi:10.1109/ICEC.1994.350000

  45. 45.

    Goldberg DE (1989) Genetic algorithms in search, optimization, and machine learning. Addison-Wesley, Boston

    MATH  Google Scholar 

  46. 46.

    Simon D (2013) Evolutionary optimization algorithms. Wiley, New York

    Google Scholar 

  47. 47.

    Karaboga D, Basturk B (2007) A powerful and efficient algorithm for numerical function optimization: artificial bee colony (ABC) algorithm. J Glob Optim 39(3):459–471. doi:10.1007/s10898-007-9149-x

    MathSciNet  Article  MATH  Google Scholar 

  48. 48.

    Yang XS, Deb S (2009) Cuckoo search via Levy flights. In: Nature & biologically inspired computing, 2009. NaBIC 2009. World Congress on. IEEE, pp 210–214. doi:10.1109/NABIC.2009.5393690

  49. 49.

    Storn R, Price K (1997) Differential evolution—a simple and efficient heuristic for global optimization over continuous spaces. J Glob Optim 11(4):341–359. doi:10.1023/A:1008202821328

    MathSciNet  Article  MATH  Google Scholar 

  50. 50.

    Michalewicz Z (1996) Genetic algorithms + data structures = evolution programs. Springer, Berlin

    Book  MATH  Google Scholar 

  51. 51.

    Yang XS, Deb S, Hanne T, He XS (2015) Attraction and diffusion in nature-inspired optimization algorithms. Neural Comput Appl. doi:10.1007/s00521-015-1925-9

    Google Scholar 

  52. 52.

    Montgomery DC (2005) Design and analysis of experiments. Wiley, Arizona

    MATH  Google Scholar 

  53. 53.

    Feng YH, Wang G-G (2015) An Improved hybrid encoding firefly algorithm for randomized time-varying knapsack problems. In: The 2015 2nd international conference on soft computing & machine intelligence (ISCMI 2015), Hong Kong. IEEE

  54. 54.

    Wang G-G, Hossein Gandomi A, Yang XS et al (2014) A novel improved accelerated particle swarm optimization algorithm for global numerical optimization. Eng Comput 31(7):1198–1220

    Article  Google Scholar 

Download references


This work was supported by National Natural Science Foundation of China (Nos. 61272297, 61402207, 61503165), Jiangsu Province Science Foundation for Youths (No. BK20150239) and R&D Program for Science and Technology of Shijiazhuang (No. 155790215).

Author information



Corresponding author

Correspondence to Gai-Ge Wang.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Feng, Y., Wang, GG., Deb, S. et al. Solving 0–1 knapsack problem by a novel binary monarch butterfly optimization. Neural Comput & Applic 28, 1619–1634 (2017).

Download citation


  • Evolutionary computation
  • Monarch butterfly optimization
  • Knapsack problems
  • Greedy optimization algorithm