Abstract
Due to its NPhard nature, it is still difficult to find an optimal solution for instances of the binary knapsack problem as small as 100 variables. In this paper, we developed a threelevel hyperheuristic framework to generate algorithms for the problem. From elementary components and multiple sets of problem instances, algorithms are generated. The best algorithms are selected to go through a second step process, where they are evaluated with problem instances that differ in size and difficulty. The problem instances are generated according to methods that are found in the literature. In all of the larger problem instances, the generated algorithms have less than 1 % error with respect to the optimal solution. Additionally, generated algorithms are efficient, taking on average fractions of a second to find a solution for any instance, with a standard deviation of 1 s. In terms of structure, hyperheuristic algorithms are compact in size compared with those in the literature, allowing an indepth analysis of their structure and their presentation to the scientific world.
This is a preview of subscription content, access via your institution.
Abbreviations
 BKP:

Binary knapsack problem
 GP:

Genetic programming
 GPC++:

Genetic programming platform for evolving tree structures of code
 IKL:

In the knapsack list; data structure used by the evolved algorithms
 OKL:

Out of knapsack list; data structure used by the evolved algorithms
 UC:

Uncorrelated instance of the binary knapsack problem
 WC:

Weakly correlated instance of the binary knapsack problem
 SC:

Strongly correlated instance of the binary knapsack problem
 SS:

Subset sum instance of the binary knapsack problem
 FC:

Fitness cases i.e. problem instances of the binary knapsack problem used to evolve algorithms
References
Affenzeller M, Winkler S, Wagner S, Beham A (2009) Genetic algorithms and genetic programming: modern concepts and practical applications, 1st edn. CRC, Chapman and Hall
Ahmed A, Shaikh AW, Ali M et al (2011) Hyperheuristic approach for solving scheduling problem: a case study. Aust J Basic Appl Sci 5(9):190–199
Alinia A, Vakil B, Badamchi Z et al (2012) Hybrid particle swarm optimization transplanted into a hyperheuristic structure for solving examination timetabling problem. Swarm Evol Comput 7:21–34. doi:10.1016/j.swevo.2012.06.004
Angelelli E, Mansini R, Grazia S (2010) Kernel search: a general heuristic for the multidimensional knapsack problem. Comput Oper Res 37(11):2017–2026
Balas E, Zemel E (1980) An algorithm for large zeroone knapsack problems. Oper Res 28(5):1130–1154
Bienstock D (2008) Approximate formulations for 01 knapsack sets. Oper Res Lett 36(3):317–320
Bilgin B, Demeester P, Misir M et al (2012) One hyperheuristic approach to two timetabling problems in health care. J Heuristics 18(3):401–434. doi:10.1007/s1073201191920
Burke E, Kendall G, Newall J et al (2003) Hyperheuristics: an emerging direction in modern search technology. Handbook of metaheuristics, pp 457–474
Burke E, Hyde M, Kendall G et al (2010) A classification of hyperheuristic approaches. In: Handbook of metaheuristics (international series in operations research & management science, vol 146). Nottingham, UK, pp 449–468
Burke E, Hyde M, Kendall G et al (2012) Automating the packing heuristic design process with genetic programming. Evol Comput 20(1):63–89. doi:10.1162/EVCO_a_00044
Darehmiraki M, Mishmast N (2007) Molecular solution to the 0–1 knapsack problem based on DNA computing. Appl Math Comput 187(2):1033–1037
Demeester P, Bilgin B, De Causmaecker P et al (2012) A hyperheuristic approach to examination timetabling problems: benchmarks and a new problem from practice. J Sched 15(1):83–103. doi:10.1007/s1095101102585
Fortnow L (2009) The status of the P versus NP problem. Commun ACM 52(9):78–86
Fraser A, Weinbrenner T (1993) GPC++genetic programming C++ class library. [Online]. ftp://cs.bham.ac.uk/pub/authors/W.B.Langdon/weinbenner/gp.html. Accessed 17 Dec 2013
Garey M, Johnson D (1979) Computers and intractability. A guide to the theory of NPcompleteness. A series of books in the mathematical sciences. WH Freeman and Company, San Francisco, Calif
Garrido P, Castro C (2012) A flexible and adaptive hyperheuristic approach for (dynamic) capacitated vehicle routing problems. Fundam Inform 119(1):29–60. doi:10.3233/FI2012726
Gómez JC, TerashimaMarín H (2012) Building general hyperheuristics for multiobjective cutting stock problems. Computacion y Sistemas 16(3):321–334
Koza J (1992) Genetic programming: on the programming of computers by means of natural selection. The MIT press, Massachusetts
Koza J, Bennett F, Andre D et al (1997) Automated synthesis of analog electrical circuits by means of genetic programming. IEEE Trans Evol Comput 1(2):109–128. doi:10.1109/4235.687879
Koza J, Keane M, Streeter M, Mydlowec W, Yu J, Lanza G (2005) Genetic programming IV: routine humancompetitive machine intelligence. Kluwer Academic Publishers, Norwell
Kumar R, Singh P (2010) Assessing solution quality of biobjective 0–1 knapsack problem using evolutionary and heuristic algorithms. Appl Soft Comput 10(3):711–718
Martello S, Toth P (1990). Knapsack problems: algorithms and computer implementations (revised). University of Bologna, Bologna, Italy
Pisinger D (2005) Where are the hard knapsack problems? Comput Oper Res 32(9):2271–2284
Poli R, Langdon W, McPhee N (2008) A field guide to genetic programming. Published via http://lulu.com and freely available at http://www.gpfieldguide.org.uk
Rajni A, Chana I (2013) Bacterial foraging based hyperheuristic for resource scheduling in grid computing. Future Gener Comput Syst 29(3):751–762. doi:10.1016/j.future.2012.09.005
Sabar N, Ayob M, Qu R et al (2012) A graph coloring constructive hyperheuristic for examination timetabling problems. Appl Intell 37(1):1–11. doi:10.1007/s1048901103099
Taghipour H, Rezaei M, Esmaili H (2013) Solving the 0/1 knapsack problem by a biomolecular DNA computer. Advances in bioinformatics
Ye L, Zhang M (2013) Solutions to the 01 knapsack problem based on DNA encoding and computing method. J Comput 8(3):669–675
Acknowledgments
The authors would like to thank the Complex Engineering Systems Institute ICM: P05004F, CONICYT: FBO16, DICYT: 61219USACH, ECOS/CONICYT: C13E04, STICAMSUD: 13STIC05.
Author information
Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Parada, L., Herrera, C., Sepúlveda, M. et al. Evolution of new algorithms for the binary knapsack problem. Nat Comput 15, 181–193 (2016). https://doi.org/10.1007/s1104701594838
Published:
Issue Date:
Keywords
 Automatic generation of algorithms
 Combinatorial optimization
 Evolutionary computation
 Genetic programming
 Hyperheuristic
 Knapsack problem