Quantum-Inspired Differential Evolution with Grey Wolf Optimizer for 0-1 Knapsack Problem
Abstract
:1. Introduction
2. Related Work
2.1. Knapsack Problem
2.2. Grey Wolf Optimizer (GWO)
3. Quantum-Inspired Differential Evolution with Adaptive Grey Wolf Optimizer
3.1. Binary Representation
3.2. Quantum Representation
3.3. Initialization
3.4. Quantum Observation and Fitness Evaluation
Algorithm 1 Quantum Observation and Reparation |
Input: quantum individuals q |
Output: binary individuals X |
//Initialize the bits of individual X to 0. |
// Initialize the total weights of the individuals to 0. |
while () do |
//Generate the random integer . |
if (xi = 0) then |
if(r > |cos(θi)|2) then |
//Select item xi and include the weight wi of item xi in the total weight wtotal. |
end if |
end if |
end while |
//The total weight wtotal has exceeded the capacity C when the loop is ended, so item xi needs to be extracted from the selected items for reparation. |
3.5. Adaptive Mutation Operation with Dynamic Iteration Factor
3.6. Crossover Operation
3.7. Selection Operation
3.8. Quantum Rotation Gate with Adaptive GWO
3.9. Procedure of QDGWO Algorithm
Algorithm 2 QDGWO |
// Initializes the iteration |
Initialize Q(0) by Equations (5) and (6) |
while (t < MaxIter) do |
Observe to get X(t) from q(t)//Quantum observation |
Evaluate fitness of X(t) by Equation (7) |
Apply mutation on qM(t) by Equations (8) and (11)//Adaptive mutation |
Obtain qC(t) by crossover by Equations (12) and (13)//Crossover |
Observe to get XC(t) from qC(t)//Quantum observation |
Evaluate fitness of XC(t) |
if the trial binary individuals XC(t) is better than X(t) then |
Update X(t+1) and q(t+1) by Equations (14) and (15)//Selection |
else |
Update q(t + 1) using QRG with adaptive GWO by Equations (16)–(24) |
end if |
end while |
3.10. Example of QDGWO Algorithm to Solve KP01
4. Experimental Results
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Kellerer, H.; Pferschy, U.; Pisinger, D. Knapsack Problems; Springer: Berlin/Heidelburg, Germany, 2004. [Google Scholar]
- Wang, X.; He, Y. Evolutionary algorithms for knapsack problems. J. Softw. 2017, 28, 1–16. [Google Scholar]
- Jourdan, L.; Basseur, M.; Talbi, E.G. Hybridizing exact methods and metaheuristics: A taxonomy. Eur. J. Oper. Res. 2009, 199, 620–629. [Google Scholar] [CrossRef]
- Shih, W. A branch and bound method for the multiconstraint zero-one knapsack problem. J. Oper. Res. Soc. 1979, 30, 369–378. [Google Scholar] [CrossRef]
- Toth, P. Dynamic programming algorithms for the zero-one knapsack problem. Computing 1980, 25, 29–45. [Google Scholar] [CrossRef]
- Zou, D.; Gao, L.; Li, S.; Wu, J. Solving 0-1 knapsack problem by a novel global harmony search algorithm. Appl. Soft Comput. 2011, 11, 1556–1564. [Google Scholar] [CrossRef]
- Fogel, D.B. Introduction to evolutionary computation. In Evolutionary Computation 1; Taylor & Francis Group: New York, NY, USA, 2000. [Google Scholar]
- Chen, G.-L.; Wang, X.-F.; Zhuang, Z.-Q.; Wang, D.-S. Genetic Algorithm and Its Applications; The People’s Posts and Telecommunications Press: Beijing, China, 2003. [Google Scholar]
- Dorigo, M.; Birattari, M.; Stutzle, T. Ant colony optimization. IEEE Comput. Intell. Mag. 2006, 1, 28–39. [Google Scholar] [CrossRef] [Green Version]
- Poli, R.; Kennedy, J.; Blackwell, T. Particle swarm optimization. Swarm Intell. 2007, 1, 33–57. [Google Scholar] [CrossRef]
- Karaboga, D.; Basturk, B. A powerful and efficient algorithm for numerical function optimization: Artificial bee colony (ABC) algorithm. J. Glob. Optim. 2007, 39, 459–471. [Google Scholar] [CrossRef]
- Yang, X.-S.; Deb, S. Cuckoo search via Lévy flights. In Proceedings of the 2009 World Congress on Nature & Biologically Inspired Computing (NaBIC), Coimbatore, India, 9–11 December 2009; pp. 210–214. [Google Scholar]
- Yang, X.-S.; Xin, S. Firefly algorithm, stochastic test functions and design optimisation. Int. J. Bio-Inspired Comput. 2010, 2, 78–84. [Google Scholar] [CrossRef]
- Feng, Y.-H.; Wang, G.-G.; Wang, L. Solving randomized time-varying knapsack problems by a novel global firefly algorithm. Eng. Comput. 2018, 34, 621–635. [Google Scholar] [CrossRef]
- Cao, J.; Yin, B.; Lu, X.; Kang, Y.; Chen, X. A modified artificial bee colony approach for the 0-1 knapsack problem. Appl. Intell. 2017, 48, 1582–1595. [Google Scholar] [CrossRef]
- Wu, H.; Zhou, Y.; Luo, Q. Hybrid symbiotic organisms search algorithm for solving 0-1 knapsack problem. Int. J. Bio-Inspired Comput. 2018, 12, 23–53. [Google Scholar] [CrossRef]
- Feng, Y.-H.; Jia, K.; He, Y.-C. An improved hybrid encoding cuckoo search algorithm for 0-1 knapsack problems. Comput. Intell. Neurosci. 2014, 2014, 970456. [Google Scholar] [CrossRef]
- Zhou, Y.-Q.; Chen, X.; Zhou, G. An improved monkey algorithm for a 0-1 knapsack problem. Appl. Soft Comput. 2016, 38, 817–830. [Google Scholar] [CrossRef] [Green Version]
- Sun, J.; Miao, Z.; Gong, D.-W.; Zeng, X.-J.; Li, J.-Q.; Wang, G.-G. Interval multi-objective optimization with memetic algorithms. IEEE Trans. Cybern. 2020, 50, 3444–3457. [Google Scholar] [CrossRef]
- Wang, G.-G.; Guo, L.-H.; Gandomi, A.H.; Hao, G.-S.; Wang, H.-Q. Chaotic krill herd algorithm. Inf. Sci. 2014, 274, 17–34. [Google Scholar] [CrossRef]
- Wang, G.-G.; Bai, D.; Gong, W.; Ren, T.; Liu, X.; Yan, X. Particle-swarm krill herd algorithm. In Proceedings of the 2018 IEEE International Conference on Industrial Engineering and Engineering Management (IEEM), Bangkok, Thailand, 16–19 December 2018; pp. 1073–1080. [Google Scholar]
- Faramarzi, A.; Heidarinejad, M.; Mirjalili, S.; Gandomi, A.H. Marine predators algorithm: A nature-inspired metaheuristic. Expert Syst. Appl. 2020, 152, 113377. [Google Scholar] [CrossRef]
- Wang, G.-G. Moth search algorithm: A bio-inspired metaheuristic algorithm for global optimization problems. Memetic Comput. 2016, 10, 151–164. [Google Scholar] [CrossRef]
- Feng, Y.-H.; Wang, G.-G. Binary moth search algorithm for discounted {0-1} knapsack problem. IEEE Access 2018, 6, 10708–10719. [Google Scholar] [CrossRef]
- Feng, Y.-H.; Yi, J.-H.; Wang, G.-G. Enhanced moth search algorithm for the set-union knapsack problems. IEEE Access 2019, 7, 173774–173785. [Google Scholar] [CrossRef]
- Gao, D.; Wang, G.-G.; Pedrycz, W. Solving fuzzy job-shop scheduling problem using DE algorithm improved by a selection mechanism. IEEE Trans. Fuzzy Syst. 2020, 28, 3265–3275. [Google Scholar] [CrossRef]
- Abualigah, L.; Diabat, A.; Mirjalili, S.; Abd Elaziz, M.; Gandomi, A.H. The arithmetic optimization algorithm. Comput. Methods Appl. Mech. Eng. 2021, 376, 113609. [Google Scholar] [CrossRef]
- Wang, G.-G.; Deb, S.; Cui, Z. Monarch butterfly optimization. Neural Comput. Appl. 2019, 31, 1995–2014. [Google Scholar] [CrossRef] [Green Version]
- Feng, Y.-H.; Wang, G.-G.; Deb, S.; Lu, M.; Zhao, X.-J. Solving 0-1 knapsack problem by a novel binary monarch butterfly optimization. Neural Comput. Appl. 2017, 28, 1619–1634. [Google Scholar] [CrossRef]
- Feng, Y.-H.; Wang, G.-G.; Li, W.-B.; Li, N. Multi-strategy monarch butterfly optimization algorithm for discounted {0-1} knapsack problem. Neural Comput. Appl. 2018, 30, 3019–3036. [Google Scholar] [CrossRef]
- Feng, Y.-H.; Wang, G.-G.; Dong, J.-Y.; Wang, L. Opposition-based learning monarch butterfly optimization with Gaussian perturbation for large-scale 0-1 knapsack problem. Comput. Electr. Eng. 2018, 67, 454–468. [Google Scholar] [CrossRef]
- Feng, Y.-H.; Yu, X.; Wang, G.-G. A novel monarch butterfly optimization with global position updating operator for large-scale 0-1 knapsack problems. Mathematics 2019, 7, 1056. [Google Scholar] [CrossRef] [Green Version]
- Wang, G.-G.; Tan, Y. Improving metaheuristic algorithms with information feedback models. IEEE Trans. Cybern. 2019, 49, 542–555. [Google Scholar] [CrossRef]
- Benioff, P. The computer as a physical system: A microscopic quantum mechanical Hamiltonian model of computers as represented by Turing machines. J. Stat. Phys. 1980, 22, 563–591. [Google Scholar] [CrossRef]
- Feynman, R.P. Simulating physics with computers. Int. J. Theor. Phys. 1999, 21, 467–488. [Google Scholar] [CrossRef]
- Han, K.-H.; Kim, J.-H. Genetic quantum algorithm and its application to combinatorial optimization problems. In Proceedings of the International Congress on Evolutionary Computation (CEC2000), San Diego, CA, USA, 16–19 July 2000; Volume 2, pp. 1354–1360. [Google Scholar]
- Han, K.-H.; Kim, J.-H. Quantum-inspired evolutionary algorithm for a class of combinatorial optimization. IEEE Trans. Evol. Comput. 2002, 6, 580–593. [Google Scholar] [CrossRef] [Green Version]
- Talbi, H.; Draa, A.; Batouche, M. A new quantum-inspired genetic algorithm for solving the travelling salesman problem. In Proceedings of the 2004 IEEE International Conference on Industrial Technology, 2004, IEEE ICIT’04, Hammamet, Tunisia, 8–10 December 2004; Volume 3, pp. 1192–1197. [Google Scholar]
- Chang, C.-C.; Chen, C.-Y.; Fan, C.-W.; Chao, H.-C.; Chou, Y.-H. Quantum-inspired electromagnetism-like mechanism for solving 0/1 knapsack problem. In Proceedings of the 2010 2nd International Conference on Information Technology Convergence and Services, Cebu, Philippines, 11–13 August 2010; pp. 1–6. [Google Scholar]
- Xiong, H.; Wu, Z.; Fan, H.; Li, G.; Jiang, G. Quantum rotation gate in quantum-inspired evolutionary algorithm: A review, analysis and comparison study. Swarm Evol. Comput. 2018, 42, 43–57. [Google Scholar] [CrossRef]
- Zhou, W.; Zhou, C.; Liu, G.; Lv, H.; Liang, Y. An improved quantum-inspired evolutionary algorithm for clustering gene expression data. In Computational Methods; Springer: Dordrecht, The Netherlands, 2006; pp. 1351–1356. [Google Scholar]
- Xiao, J.; Yan, Y.; Lin, Y.; Yuan, L.; Zhang, J. A quantum-inspired genetic algorithm for data clustering. In Proceedings of the 2008 IEEE Congress on Evolutionary Computation (IEEE World Congress on Computational Intelligence), Hong Kong, China, 1–6 June 2008; pp. 1513–1519. [Google Scholar]
- Han, K.-H.; Kim, J.-H. Quantum-inspired evolutionary algorithms with a new termination criterion, HεGate, and two-phase scheme. IEEE Trans. Evol. Comput. 2004, 8, 156–169. [Google Scholar] [CrossRef]
- Storn, R.; Price, K. Differential evolution-a simple and efficient heuristic for global optimization over continuous spaces. J. Glob. Optim. 1997, 11, 341–359. [Google Scholar] [CrossRef]
- Hota, A.R.; Pat, A. An adaptive quantum-inspired differential evolution algorithm for 0-1 knapsack problem. In Proceedings of the 2010 Second World Congress on Nature and Biologically Inspired Computing (NaBIC), Kitakyushu, Japan, 15–17 December 2010; pp. 703–708. [Google Scholar]
- Draa, A.; Meshoul, S.; Talbi, H.; Batouche, M. A quantum-inspired differential evolution algorithm for solving the N-queens problem. Neural Netw. 2011, 1, 21–27. [Google Scholar]
- Su, H.; Yang, Y. Quantum-inspired differential evolution for binary optimization. In Proceedings of the 2008 Fourth International Conference on Natural Computation, Jinan, China, 18–20 October 2008; Volume 1, pp. 341–346. [Google Scholar]
- Wang, Y.; Feng, X.-Y.; Huang, Y.-X.; Pu, D.-B.; Zhou, W.-G.; Liang, Y.-C.; Zhou, C.-G. A novel quantum swarm evolutionary algorithm and its applications. Neurocomputing 2007, 70, 633–640. [Google Scholar] [CrossRef]
- Layeb, A. A hybrid quantum inspired harmony search algorithm for 0-1 optimization problems. J. Comput. Appl. Math. 2013, 253, 14–25. [Google Scholar] [CrossRef]
- Zouache, D.; Moussaoui, A. Quantum-inspired differential evolution with particle swarm optimization for knapsack problem. J. Inf. Sci. Eng. 2015, 31, 1757–1773. [Google Scholar]
- Gao, Y.; Zhang, F.; Zhao, Y.; Li, C. Quantum-inspired wolf pack algorithm to solve the 0-1 knapsack problem. Math. Probl. Eng. 2018, 2018, 5327056. [Google Scholar] [CrossRef]
- Mirjalili, S.; Mirjalili, S.M.; Lewis, A. Grey wolf optimizer. Adv. Eng. Softw. 2014, 69, 46–61. [Google Scholar] [CrossRef] [Green Version]
- Srikanth, K.; Panwar, L.K.; Panigrahi, B.K.; Herrera-Viedma, E.; Sangaiah, A.K.; Wang, G.-G. Meta-heuristic framework: Quantum inspired binary grey wolf optimizer for unit commitment problem. Comput. Electr. Eng. 2018, 70, 243–260. [Google Scholar] [CrossRef]
- Sudholt, D. The benefits of population diversity in evolutionary algorithms: A survey of rigorous runtime analyses. In Theory of Evolutionary Computation; Springer: Cham, Switzerland, 2020; pp. 359–404. [Google Scholar]
- Pisinger, D. Where are the hard knapsack problems? Comput. Oper. Res. 2005, 32, 2271–2284. [Google Scholar] [CrossRef]
- Vasquez, M.; Yannick, V. Improved results on the 0-1 multidimensional knapsack problem. Eur. J. Oper. Res. 2005, 165, 70–81. [Google Scholar] [CrossRef]
- Dirac, P.A.M. The Principles of Quantum Mechanics, 4th ed.; Oxford University Press: New York, NY, USA, 1981; p. 12. [Google Scholar]
- Wang, J.S.; Li, S.X. An improved grey wolf optimizer based on differential evolution and elimination mechanism. Sci. Rep. 2019, 9, 1–21. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Woolson, R.F. Wilcoxon signed-rank test. In Wiley Encyclopedia of Clinical Trials, 1–3; John Wiley & Sons, Inc.: Hoboken, NJ, USA, 2007. [Google Scholar]
xi | bi | s(αiβi) | |||||
---|---|---|---|---|---|---|---|
αiβi > 0 | αiβi < 0 | αi = 0 | βi = 0 | ||||
0 | 0 | false | 0 | 0 | 0 | 0 | 0 |
0 | 0 | true | 0 | 0 | 0 | 0 | 0 |
0 | 1 | false | 0 | 0 | 0 | 0 | 0 |
0 | 1 | true | 0.05π | −1 | +1 | ±1 | 0 |
1 | 0 | false | 0.01π | −1 | +1 | ±1 | 0 |
1 | 0 | true | 0.025π | +1 | −1 | 0 | ±1 |
1 | 1 | false | 0.005π | +1 | −1 | 0 | ±1 |
1 | 1 | true | 0.025π | +1 | −1 | 0 | ±1 |
QEA | AQDE | QSE | QDGWO | |
---|---|---|---|---|
Differential control parameter (F) | / | rand(0,1) × rand(0,1) × 0.1 | / | F0= 0.02 F1 = 0.03 |
Crossover control parameter (CR) | / | Gaussian distribution N(0.5, 0.0375) | / | Gaussian distribution N(0.5, 0.0375) |
Parameters of PSO | / | / | W = 0.7298 c1 = 1.42 c2 = 1.57 | / |
Quantum rotation angle () | 0.01π | / | / | θmin = 0.01π θmax = 0.03π k = 10 |
Number of Items | QEA | AQDE | QSE | QDGWO | |
---|---|---|---|---|---|
50 | Best | 302(=) | 292(−) | 297(=) | 302 |
Average | 300.63(=) | 287.2(−) | 294.26(−) | 302 | |
Worst | 297(=) | 282(−) | 290(−) | 302 | |
Std | 2.23(−) | 2.97(−) | 2.41(−) | 0 | |
250 | Best | 1517(=) | 1417(−) | 1446(−) | 1554 |
Average | 1502.9(=) | 1397.6(−) | 1,427.7(−) | 1549.3 | |
Worst | 1496(=) | 1382(−) | 1412(−) | 1542 | |
Std | 4.4562(−) | 7.3178(−) | 8.2040(−) | 2.3419 | |
500 | Best | 2946(=) | 2772(−) | 2799(−) | 3091 |
Average | 2917.3(−) | 2732(−) | 2783(−) | 3072.1 | |
Worst | 2907(−) | 2717(−) | 2763(−) | 3058 | |
Std | 8.8198(=) | 11.3304(=) | 9.2364(=) | 8.9624 | |
1000 | Best | 5695(−) | 5382(−) | 5460(−) | 6121 |
Average | 5662.5(−) | 5,364.4(−) | 5442.2(−) | 6085.3 | |
Worst | 5633(−) | 5342(−) | 5422(−) | 6048 | |
Std | 12.7028(=) | 11.2975(=) | 10.1018(+) | 13.4812 | |
1500 | Best | 8464(−) | 8198(−) | 8128(−) | 9126 |
Average | 8,439.4(−) | 8,178.7(−) | 8,082.8(−) | 9077.1 | |
Worst | 8414(−) | 8149(−) | 8039(−) | 9027 | |
Std | 15.1535(+) | 13.6188(+) | 20.6722(=) | 21.5347 | |
2000 | Best | 11,217(−) | 10,951(−) | 10,813(−) | 12,027 |
Average | 11,191.2(−) | 10,900.4(−) | 10,781.1(−) | 11,971.4 | |
Worst | 11,164(=) | 10,865(−) | 10,747(−) | 11,913 | |
Std | 14.7202(+) | 24.6167(=) | 16.2827(+) | 24.3967 | |
2500 | Best | 13,907(−) | 13,569(−) | 13,466(−) | 14,886 |
Average | 13,865.8(−) | 13,523.3(−) | 13,394.2(−) | 14,831.4 | |
Worst | 13,839(−) | 13,482(−) | 13,342(−) | 14,751 | |
Std | 19.0504(+) | 24.5971(+) | 23.5438(+) | 28.4894 | |
3000 | Best | 16,604(−) | 16,221(−) | 16,071(−) | 17,769 |
Average | 16,549.9(−) | 16,175.8(−) | 16,033.2(−) | 17,670.1 | |
Worst | 16,506(−) | 16,128(−) | 15,995(−) | 17,588 | |
Std | 20.2286(+) | 22.0621(+) | 20.5269(+) | 29.5280 |
Number of Items | Without Crossover of DE | With Binomial Crossover of DE (CR = 0.5) | With Exponential Crossover of DE (CR = 0.5) | |
---|---|---|---|---|
500 | Best | 3001(−) | 3046 | 3046(=) |
Average | 2990.3(−) | 3038.6 | 3040.1(=) | |
Worst | 2981(−) | 3031 | 3031(=) | |
Std | 6.1752(−) | 3.6191 | 3.4287(=) | |
1000 | Best | 5926(−) | 6126 | 6126(=) |
Average | 5893.8(−) | 6109.4 | 6107.7(=) | |
Worst | 5851(−) | 6096 | 6081(=) | |
Std | 18.0843(−) | 7.2612 | 9.5447(=) | |
1500 | Best | 8752(−) | 9126 | 9126(=) |
Average | 8707.7(−) | 9094.9 | 9090.9(=) | |
Worst | 8647(−) | 9066 | 9042(=) | |
Std | 23.2206(−) | 16.8516 | 21.4710(−) |
Test | Item Size | Optimal Solution | QIHSA | QDGWO | |
---|---|---|---|---|---|
Knapinst50 | 50 | 1177 | SR% | 99.83(=) | 100 |
best | 1175(=) | 1177 | |||
Knapinst200 | 200 | 4860 | SR% | 97.83(−) | 100 |
best | 4755(−) | 4860 | |||
Knapinst500 | 500 | 11,922 | SR% | 93.74(−) | 98.56 |
best | 11,174(−) | 11,748 | |||
Knapinst1000 | 1000 | 24,356 | SR% | 87.97(−) | 98.14 |
best | 21,427(−) | 23,903 | |||
Knapinst1500 | 1500 | 35,891 | SR% | 86.31(−) | 97.25 |
best | 30,978(−) | 34,904 | |||
Knapinst2000 | 2000 | 49,007 | SR% | 85.8(−) | 96.36 |
best | 42,052(−) | 47,223 |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Wang, Y.; Wang, W. Quantum-Inspired Differential Evolution with Grey Wolf Optimizer for 0-1 Knapsack Problem. Mathematics 2021, 9, 1233. https://doi.org/10.3390/math9111233
Wang Y, Wang W. Quantum-Inspired Differential Evolution with Grey Wolf Optimizer for 0-1 Knapsack Problem. Mathematics. 2021; 9(11):1233. https://doi.org/10.3390/math9111233
Chicago/Turabian StyleWang, Yule, and Wanliang Wang. 2021. "Quantum-Inspired Differential Evolution with Grey Wolf Optimizer for 0-1 Knapsack Problem" Mathematics 9, no. 11: 1233. https://doi.org/10.3390/math9111233