Quantum-Inspired Differential Evolution with Grey Wolf Optimizer for 0-1 Knapsack Problem

: The knapsack problem is one of the most widely researched NP-complete combinatorial optimization problems and has numerous practical applications. This paper proposes a quantum-inspired differential evolution algorithm with grey wolf optimizer (QDGWO) to enhance the diversity and convergence performance and improve the performance in high-dimensional cases for 0-1 knapsack problems. The proposed algorithm adopts quantum computing principles such as quantum superposition states and quantum gates. It also uses adaptive mutation operations of differential evolution, crossover operations of differential evolution, and quantum observation to generate new solutions as trial individuals. Selection operations are used to determine the better solutions between the stored individuals and the trial individuals created by mutation and crossover operations. In the event that the trial individuals are worse than the current individuals, the adaptive grey wolf optimizer and quantum rotation gate are used to preserve the diversity of the population as well as speed up the search for the global optimal solution. The experimental results for 0-1 knapsack problems conﬁrm the advantages of QDGWO with the effectiveness and global search capability for knapsack problems, especially for high-dimensional situations.


Introduction
The 0-1 knapsack problem (KP01) is a classical combinatorial optimization problem. It has many practical applications, such as project selection, investment decisions, and complexity theory [1,2]. Two classes of approaches were previously proposed to solve the KP01 [3]. The first class of approaches includes exact methods based on mathematical programming and operational research. It is possible to obtain the exact solutions of smallscale KP01 problems by exact methods such as branching and bound algorithm [4] and dynamic programming [5]. However, KP01 problems in various complex situations are NP-hard problems, and it is impractical to obtain optimal solutions using deterministic optimization methods for large-scale problems. The second class contains approximate methods based on metaheuristic algorithms [6]. Metaheuristic algorithms are shown to be effective approaches to solving complex engineering problems in a reasonable time when compared with exact methods [7]. Therefore, the application of metaheuristic algorithms has drawn a great deal of attention in the field of optimization.
In recent years, most of the metaheuristic algorithms, such as the genetic algorithm (GA) [8], ant colony optimization (ACO) [9], particle swarm algorithm (PSO) [10], artificial bee colony (ABC) [11], cuckoo search (CS) [12], firefly algorithm (FA) [13], and improved approaches based on these algorithms [14][15][16][17][18][19], were applied to KP01 problems and achieved outstanding results. However, these metaheuristic algorithms require not only a large amount of memory for storing the population of solutions, but also a long computational time for finding the optimal solutions. In the last few years, novel metaheuristic algorithms were proposed. Wang et al. [20,21] improved the swarm intelligence optimization approach Mathematics 2021, 9,1233 2 of 21 inspired by the herding behavior of krill and came up with the krill herd (KH) algorithm to solve combinatorial optimization problems. Faramarzi et al. [22] presented a metaheuristic called the Marine Predators Algorithm (MPA) with an application in engineering design problems. MPA follows the rules that naturally govern in optimal foraging strategy and encounters a rate policy between predator and prey in marine ecosystems. Inspired by the phototaxis and Lévy flights of moths, Wang et al. [23] developed a new metaheuristic algorithm called the moth search (MS) algorithm. MS was applied to solve discounted 0-1 knapsack problems [24] and set-union knapsack problems [25]. Gao et al. [26] presented a novel selection mechanism augmenting the generic DE algorithm (NSODE) to achieve better optimization results for solving fuzzy job-shop scheduling problems. Abualigah et al. [27] proposed the arithmetic optimization algorithm (AOA) based on the distribution behavior of the main arithmetic operators in mathematics: multiplication, division, subtraction, and addition. Wang et al. [28] proposed a new nature-inspired metaheuristic algorithm called monarch butterfly optimization (MBO) by simulating the migration of monarch butterflies. MBO was applied to solve classic KP01 [29], discounted KP01 [30], and large-scale KP01 [31,32] problems with superior searching accuracy, convergent capability, and stability. In most metaheuristic algorithms, it is difficult to use the information from individuals in previous iterations in the updating process. Wang et al. [33] presented a method for reusing the information available from previous individuals and feeding previous useful information back into the updating process in order to guide later searches.
The emergence of quantum computing [34,35] was derived from the principles of quantum theory such as quantum superposition, quantum entanglement, quantum interference, and quantum collapse. Quantum computing brings new ideas to optimization due to its underlying concepts, along with the ability to process huge numbers of quantum states simultaneously in parallel. The merging of metaheuristic optimization and quantum computing recently became a growing theoretical and practical interest aiming at deriving benefits from quantum computing capabilities to enhance the convergence and speed of metaheuristic algorithms. Several scholars investigated the effect of introducing quantum computing in metaheuristic algorithms to maintain a balance between exploration and exploitation. Han and Kim proposed a genetic quantum algorithm (GQA) [36] and a quantum inspired evolutionary algorithm (QEA) [37] by merging classical evolutionary algorithms with quantum computing concepts such as the quantum bit and the quantum rotation gate. Talbi et al. [38] proposed a new algorithm inspired by genetic algorithms and quantum computing for solving the traveling salesman problem (TSP). Chang et al. [39] proposed a quantum-inspired electromagnetism-like mechanism (QEM) to solve the KP01. Xiong et al. [40] presented an analysis of quantum rotation gates in quantum-inspired evolutionary algorithms. To avoid the problem of premature convergence, mutation operation [41], crossover operation [42], new termination criterion, and new rotation gate [43] were applied to the QEA and subsequently improved.
The differential evolution (DE) algorithm [44], proposed by Storn and Price, was derived from differential vectors of solutions for global optimization. Several simple operations including mutation, crossover, and selection were used in the DE algorithm to explore the search space. Subsequently, several algorithms combining the DE algorithm with quantum computing were designed to increase global search ability. Hota and Pat [45] extended the concept of differential operators with adaptive parameter control to the quantum paradigm and proposed the adaptive quantum-inspired differential evolution (AQDE) algorithm. In addition, quantum interference operation [46] and mutation operation [47] were brought into a quantum-inspired DE algorithm.
Several metaheuristic algorithms combining the QEA and DE were proven to be effective and efficient for solving the KP01. Wang et al. [48] proposed a quantum swarm evolutionary (QSE) algorithm that updated quantum angles automatically with improved PSO. Layeb [49] presented a quantum inspired harmony search algorithm (QIHSA) based on a harmony search algorithm (HSA) and quantum computing. Zouache et al. [50] proposed a merged algorithm called quantum-inspired differential evolution with particle swarm optimization (QDEPSO) to solve the KP01. Gao et al. [51] proposed a quantuminspired wolf pack algorithm (QWPA) with quantum rotation and quantum collapse to improve the performance of the wolf pack algorithm for the KP01.
The grey wolf optimizer (GWO) proposed by Mirjalili et al. [52] mimics the specific behavior of grey wolves based on leadership hierarchy in nature. Srikanth et al. [53] presented a quantum-inspired binary grey wolf optimizer (QIBGWO) to solve the problem of unit commitment scheduling.
Population diversity is crucial in evolutionary algorithms to enable global exploration and to avoid poor performance due to premature convergence [54]. However, it is hard for classical algorithms to enhance diversity and convergence performance because their population quickly converges to a specific region of the solution space. In addition, these algorithms require a large amount of memory as well as long computational time to find the optimal solution for high-dimensional situations. To avoid these difficulties, we propose a new algorithm, called quantum-inspired differential evolution algorithm with grey wolf optimizer (QDGWO). The proposed algorithm combines the features of the QEA, DE, and GWO to solve the 0-1 knapsack problem. To preserve diversity throughout the evolution, the new algorithm adopts the concepts of quantum representation and the integration of the quantum operators such as quantum measurement and quantum rotation. The adaptive operations of the DE (mutation, crossover, selection) and GWO can increase the adaptation and diversification in updating individuals. The experimental results demonstrate the competitive performance of the proposed algorithm.
The rest of the paper is organized as follows: Section 2 defines the 0-1 knapsack problem. The proposed QDGWO algorithm is presented in Section 3. The experimental results and discussion are summarized in Section 4. Conclusions and directions for future work are discussed in Section 5.

Knapsack Problem
The 0-1 knapsack problem is a well-known combinatorial optimal problem that has been studied in areas such as project selection, resource distribution, and the network interdiction problem. The KP01 was demonstrated to be NP-complete [55,56]. It can be described as follows: Given a set W of m items, W = (x 1 , x 2 , x 3 , . . . , x m ). w i is the weight item x i , and p i is the profit of x i . C is the weight capacity of the knapsack. The objective is to find the subset X optimal from set of m items that maximizes the total profit, while keeping the total weight of the selected items from exceeding C.
The 0-1 knapsack problem can be defined as: where x i can take either the value 1 (as selected) or the value 0 (as not selected, also called rejected).

Grey Wolf Optimizer (GWO)
The GWO algorithm [52] is inspired by the leadership hierarchy and hunting mechanism of grey wolves. To model the social order of grey wolves in the GWO, the best solution is considered the alpha (α) wolf, and the second and third best solutions are beta (β) and delta (δ) wolves, respectively. The rest of the feasible solutions are considered as omega (ω) wolves. In the GWO, α, β, and δ wolves lead the hunting, and the ω wolves go after these leading wolves when searching for the global optimal solution (target) as the prey, as shown in Figure 1. (β) and delta (δ) wolves, respectively. The rest of the feasible solutions are considered as omega (ω) wolves. In the GWO, α, β, and δ wolves lead the hunting, and the ω wolves go after these leading wolves when searching for the global optimal solution (target) as the prey, as shown in Figure 1. Grey wolves have the ability to recognize the location of prey and encircle them during the hunt. In order to simulate the hunting behavior of grey wolves mathematically, it is supposed that the α, β, and δ wolves have better knowledge about the potential location of prey. Therefore, the GWO saves the first three best solutions arrived at so far and forces the other ω wolves to update their positions according to the position of the best search agents.
During optimization, the GWO algorithm allows its search agents to update their position based on the location of the alpha, beta, and delta wolves with the distance vector between itself and the three best wolves when attacking the prey. Finally, the position and fitness of the alpha wolf are regarded as the global optimal solution in searching for the optimization when a termination criterion is satisfied.

Quantum-Inspired Differential Evolution with Adaptive Grey Wolf Optimizer
The proposed QDGWO algorithm is presented for the knapsack problems. First, the proposed algorithm adopts the quantum computing principles such as quantum representation and quantum measurement operation. Quantum representation allows the representation of the superposition of all potential states in one quantum individual. Second, adaptive mutation operations (used in the DE), crossover operations (used in the DE), and quantum observation are combined to generate new solutions as trial individuals in the solution space. Finally, the selection operator chooses the better solutions between the stored individuals and the trial individuals generated by the mutation and crossover operations of the DE. In the event that the trial individuals are worse than the current individuals, the QDGWO integrates the adaptive GWO and quantum rotation gate to preserve the diversity of the population of solutions as well as accelerate the search for the global optimum. The framework of the QDGWO algorithm is shown in Figure 2. Grey wolves have the ability to recognize the location of prey and encircle them during the hunt. In order to simulate the hunting behavior of grey wolves mathematically, it is supposed that the α, β, and δ wolves have better knowledge about the potential location of prey. Therefore, the GWO saves the first three best solutions arrived at so far and forces the other ω wolves to update their positions according to the position of the best search agents.
During optimization, the GWO algorithm allows its search agents to update their position based on the location of the alpha, beta, and delta wolves with the distance vector between itself and the three best wolves when attacking the prey. Finally, the position and fitness of the alpha wolf are regarded as the global optimal solution in searching for the optimization when a termination criterion is satisfied.

Quantum-Inspired Differential Evolution with Adaptive Grey Wolf Optimizer
The proposed QDGWO algorithm is presented for the knapsack problems. First, the proposed algorithm adopts the quantum computing principles such as quantum representation and quantum measurement operation. Quantum representation allows the representation of the superposition of all potential states in one quantum individual. Second, adaptive mutation operations (used in the DE), crossover operations (used in the DE), and quantum observation are combined to generate new solutions as trial individuals in the solution space. Finally, the selection operator chooses the better solutions between the stored individuals and the trial individuals generated by the mutation and crossover operations of the DE. In the event that the trial individuals are worse than the current individuals, the QDGWO integrates the adaptive GWO and quantum rotation gate to preserve the diversity of the population of solutions as well as accelerate the search for the global optimum. The framework of the QDGWO algorithm is shown in Figure 2.

Binary Representation
The choice of the representation for individuals, also known as individual coding, is a crucial issue in evolutionary algorithms. The proposed QDGWO algorithm adopts the binary coding, which is the most appropriate way to indicate the selection or rejection of items. Each individual X is represented as a binary vector with length m (m is the item size): The following example shows the binary representation for item selection: x1 and x3 from the item set W are selected: W = {x1, x2, x3, x4} → X = (1 0 1 0).
The binary population is made up of the binary individuals at the tth generation, where n is the size of population.

Binary Representation
The choice of the representation for individuals, also known as individual coding, is a crucial issue in evolutionary algorithms. The proposed QDGWO algorithm adopts the binary coding, which is the most appropriate way to indicate the selection or rejection of items. Each individual X is represented as a binary vector with length m (m is the item size): X = (x 1 , x 2 , . . . , x m ), where m is the number of items.
The following example shows the binary representation for item selection: x 1 and x 3 from the item set W are selected: The binary population P(t) = X t 1 , X t 2 , . . . , X t n is made up of the binary individuals at the tth generation, where n is the size of population.

Quantum Representation
The representation of the AQDE [45] is used in the proposed algorithm, where each quantum individual q corresponds to a phase vector q θ , which is a string of phase angles θ i (1 ≤ i ≤ m), which can be given by where m is the length of the quantum bit (qubit) individual. Each quantum individual q is a string of qubits: The probability amplitudes of a quantum bit are expressed as a pair of numbers (cos(θ i ), sin(θ i )). |sin(θ i )| 2 represents the probability of selecting item x i , and |cos(θ i )| 2 represents the probability of rejecting item x i .
The quantum population Q(t) = q t 1 , q t 2 , . . . , q t n is made up of the quantum individuals at the tth generation, where n is the size of the population.

Initialization
The general principle of superposition of quantum mechanics assumes that the original state must be considered as the result of a superposition of two or more other states in an infinite number of ways [57]. Therefore, the initial quantum individual is regarded as a superposition of all possible states. For 0-1 knapsack problems, each state represents a combination of selecting or rejecting items, and the initial quantum individual is required to generate every possible combination. For this, each vector q θi is initialized by: where r ij = random{1,3,5,7}, which means r ij is an odd integer generated randomly in the set r ij ∈ {1, 3, 5, 7} while θ ij ∈ π 4 , 3π 4 , 5π 4 , 7π 4 . This means that for initial individuals, |cos(θ ij )| 2 = |sin(θ ij )| 2 = 1/2, so that the probabilities of selecting item x i and rejecting item x i are equal.
The initial quantum individual q t=0 i which corresponds to q t=0 θi can be given by: where m is the length of the qubit quantum individual. Q(0) = q 0 1 , q 0 2 , . . . , q 0 n is the initial quantum population, where n is the size of the population.

Quantum Observation and Fitness Evaluation
Based on the quantum superposition principle, a quantum state is a superposition of all possibly stationary states. The quantum superposition state will collapse to a stationary state by quantum observation. In the proposed QDGWO algorithm, the quantum superposition states are represented by quantum individuals, and the stationary states are represented through binary individuals. Before evaluating the fitness of individuals, quantum observation and reparation for quantum individuals q are required to receive binary individuals X, as shown in Algorithm 1.
After quantum observation, the fitness of binary individual X is evaluated as: Mathematics 2021, 9, 1233 7 of 21

Algorithm 1 Quantum Observation and Reparation
Input: quantum individuals q Output: binary individuals X x i ← 0 //Initialize the bits of individual X to 0. w total ← 0 // Initialize the total weights of the individuals to 0.
The total weight w total has exceeded the capacity C when the loop is ended, so item x i needs to be extracted from the selected items for reparation.

Adaptive Mutation Operation with Dynamic Iteration Factor
The mutation operation is one of the main operations in differential evolution. In the QDGWO, DE/best/2, proposed by Price and Storn [44], is used to select parent vectors. In this strategy, the mutation vector q Mt θi is generated by the vector q θα corresponding to the current best binary individual X α and the difference between two different target vectors q θr1 and q θr2 which are randomly selected. This difference is weighted by the differentiation control factor F.
To improve the performance of differential operations in different phases, we propose an adaptive strategy to determine the differentiation control factor F with the iteration of evolution: where F 0 is the initial differentiation control factor, and F 1 is the adaptive f differentiation control factor. t max is the maximum iteration number of the algorithm. With this adaptive strategy, in the early stage of the iteration, the smaller t will be proposed with a larger F t , which is beneficial for attaining good diversity of individuals for global searching. F t will be smaller and smaller during the iteration. In the late stages, F t is close to F 0 , which aids in local searching for the global optimal solution.
The quantum mutation individual q Mt i corresponding to the quantum mutant vector q Mt θi can be obtained by: where m is the length of the qubit quantum individual.
The quantum mutation population Q M (t) = (q Mt 1 , q Mt 2 , . . . , q Mt n ) is made up of the quantum mutation individuals at the tth generation, where n is the size of the population.

Crossover Operation
The crossover operation is another main operation in differential evolution. The trial vector q Ct θi is generated by crossover between the mutant vector q Mt θi and the target vector q t θi with a binomial crossover strategy [44]. The quantum trial vector q Ct θi at the tth generation can be generated by: where CR ∈ [0, 1] is the probability of the crossover operation which is randomly generated at tth iteration. In addition, rnbr_i ∈ {1, m} is an integer to ensure that q Ct θi obtains at least one vector from q Mt θi . The quantum trial individual q Ct i corresponding to the quantum trial vector q Ct θi can be obtained by: where m is the length of the qubit quantum individual. The quantum trial population Q C (t) = q Ct 1 , q Ct 2 , . . . , q Ct n is made up of the quantum trial individuals at the tth generation, where n is the size of the population.

Selection Operation
After the crossover operation, the trial quantum individuals will be transformed into binary individuals by observation and reparation, as discussed in Section 3.4. The population of trial quantum individuals Q C (t) is transformed into a population of trial binary individuals P C (t) = X Ct 1 , X Ct 2 , . . . , X Ct n . The selection operation generates the individuals of next iteration X t+1 i between the current individuals X t i and the trial binary individuals X Ct i , as follows: The quantum individuals of the next iteration are generated by: where R GWO is a quantum rotation gate (QRG) with an adaptive GWO. R GWO is presented in Section 3.8.

Quantum Rotation Gate with Adaptive GWO
The quantum rotation gate U(θ i ) is used to update the values of the qubits in a quantum individual as follows [36]: The quantum individuals of the next iteration after quantum rotation are presented as: where θ i = s(α i β i )∆θ i is the rotation angle of the QRG, and s(α i β i ) is the direction signal of the rotation angle. The polar plot of the QRG for qubits is illustrated in Figure 3, and the quantum rotation angle parameters used in [36] are shown in Table 1.
where ( ) i i i i s θ αβ θ = Δ is the rotation angle of the QRG, and s(αi βi) is the direction signal of the rotation angle. The polar plot of the QRG for qubits is illustrated in Figure 3, and the quantum rotation angle parameters used in [36] are shown in Table 1.   Generally speaking, the core concept of the quantum rotation gate is to motivate the probability amplitudes of each qubit in quantum individuals to converge to the corresponding bits of the current best solution in the population. Realistically, the lookup table is a convergence strategy. In this strategy, the fitness f(x) of the binary solution x after quantum observation is compared with the fitness f(b) of the current best solution b. The quantum rotation gate will update the probability amplitude (αi, βi) toward the direction that favors the emergence of the better solution between x and b. For example, if xi = 0 and bi = 1, and f(xi) > f(bi), then xi is the current best solution. This means that the state 0 is the optimal state for the i th qubit of a quantum individual, and that the QRG will update (αi, βi) to increase the probability of the state 0 to make the probability amplitude evolve toward the direction benefiting the appearance of xi = 0. If (αi, βi) is located in the   Generally speaking, the core concept of the quantum rotation gate is to motivate the probability amplitudes of each qubit in quantum individuals to converge to the corresponding bits of the current best solution in the population. Realistically, the lookup table is a convergence strategy. In this strategy, the fitness f(x) of the binary solution x after quantum observation is compared with the fitness f(b) of the current best solution b. The quantum rotation gate will update the probability amplitude (α i , β i ) toward the direction that favors the emergence of the better solution between x and b. For example, if x i = 0 and b i = 1, and f (x i ) > f (b i ), then x i is the current best solution. This means that the state |0 is the optimal state for the ith qubit of a quantum individual, and that the QRG will update (α i , β i ) to increase the probability of the state |0 to make the probability amplitude evolve toward the direction benefiting the appearance of x i = 0. If (α i , β i ) is located in the first quadrant as shown in Figure 2, the quantum rotation is in a clockwise direction, which favors x i = 0.
Normally, quantum rotation can bring the quantum chromosomes closer to the current optimal chromosomes and generate the exploitation near the current optimal solution to find better solutions. As with other metaheuristic algorithms, individuals of the population converge more closely to the best solution after quantum rotation. The QRG makes the population evolve continuously and speeds up the convergence of the algorithm.
The magnitude of ∆θ i determines the granularity of the search and should be chosen appropriately. A too-small value of the rotation angle will affect the convergence speed and may even lead to a stagnant state. However, if the value is too large, the solutions may diverge or converge prematurely to a local optimal solution [37].
The traditional QRG requires predefined rotation angles, and the value and direction of θ i should be designed for specific application problems. Because the values of quantum rotation angles are dependent on the problems, the verification of angle selection becomes important, although tedious, work when traditional QRGs are used for optimization problems. If the quantum rotation angles can be obtained adaptively without relying on predefined data, the efficiency of the QRG will be greatly improved, while the types of applications with the QRG can be easily increased. This is exactly what metaheuristic algorithms are good at. Of the large number of metaheuristics, the GWO is a novel swarm optimization algorithm motivated by the social behavior of grey wolves. Because the GWO has the advantages of simple principles, fast searching speed, high seeking accuracy, and easy implementation, it can be easily combined with practical engineering problems [58]. Therefore, the GWO has high theoretical research value and application value, and becomes suitable for generating quantum rotation angles.
In addition, the traditional QRG motivates the probability amplitudes of each qubit in quantum individuals to converge to the corresponding bits of the current best solution in the population. If the current best solution is not the global optimal solution, the direction of quantum rotation may be far from the global optimal solution, and the algorithm may be trapped in local optimal stagnation. Since the GWO records multiple best individuals, it is useful for the QRG to jump out of local optimum with the GWO.
In the proposed QDGWO algorithm, the rotation angle of the QRG is determined with an adaptive GWO. This is described as follows: In the original GWO algorithm, the positions of other ω wolves are updated by the distance vector between themselves and the three best wolves, while for the α, β, and δ wolves, they can hunt the prey more freely. The hunting zone for α, β, and δ wolves will become smaller during the iteration. In the adaptive GWO, these features of the GWO will be inherited and developed.
For a quantum rotation gate with an adaptive GWO (R GWO ),∆θ t ij is calculated using the position of α, β, and δ wolves as follows: where i ∈ {1, 2, 3, . . . , n}; j ∈ {1, 2, 3, . . . , m}; n is the size of the population; m is the number of items; θ is the rotation angle magnitude; X t ij is the jth component in the binary individual of the ith wolf during tth iteration; and γ α i , γ β i and γ δ i are determined by comparing the fitness of the current binary individual with α, β, and δ wolves as follows: (21) where N(0,1) is the Gaussian distribution, µ = 0, σ = 1.
For the ω wolves, they hunt the prey based on their own positions vs. the positions of the three best wolves. It is obvious that for the ith wolf in the ω wolves group, Therefore, the rotation angle of the ith wolf can be calculated with the binary individuals of α, β, δ, and the ith wolf.
For α, β, and δ wolves, they have the duty of searching for the optimal solution from their old positions. With increasing t, γ α i , γ β i and γ δ i will be much smaller in the late stages of the iteration than what they are in the early stages of the iteration, which helps the ω wolves converge toward an estimated position of prey calculated by α, β, and δ wolves. This strategy is helpful for jumping out of local optimal stagnation, especially in the final stage of iterations. The speed of convergence and quality of the solution are greatly affected by the magnitude of the rotation angle θ, which is given by: (22) where θ is linearly decreasing from θ max to θ min during the iteration.
In the end, q t+1 θi can be generated by: where s t ij is the direction signal of the rotation angle as follows: With the adaptive strategy of γ and θ, the searching granularity of the QDGWO changes from coarse to fine. A different searching granularity in the iteration will facilitate the process for search agents to reach the global optimal solution.

Procedure of QDGWO Algorithm
Based on the description above, the procedure of the QDGWO and its main steps can be summarized as shown in Algorithm 2.

Algorithm 2 QDGWO
t ← 0 // 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 q M (t) by Equations (8) and (11)//Adaptive mutation Obtain q C (t) by crossover by Equations (12) and (13)//Crossover Observe to get X C (t) from q C (t)//Quantum observation Evaluate fitness of X C (t) if the trial binary individuals X C (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 t ← t + 1 end while

Example of QDGWO Algorithm to Solve KP01
In the following, a KP01 problem is described as an example to be solved by the QDGWO algorithm.
Given a set of ten items, W = (x 1 , x 2 , x 3 , . . . , x 10 ), and w i is the weight of the ith item x i ; p i is the value of x i ; and C is the weight capacity of the knapsack. Suppose that w i = i, and p i = w i +5, and C = 1 Then, this 0-1 knapsack problem can be defined as: where w i = i, and p i = w i + 5 = i + 5.
The vector q θα corresponding to the current best binary individual X α and two different random target vectors q θr1 and q θr2 are shown as: The quantum mutation vector q M0 θ1 was generated by: The quantum trial vector q C0 θ1 at the tth generation was generated by Equations (12) and (13): θ1 = (0.75π, 0.75π, 0.3108π, 1.75π, 1.25π, 1.75π, 0.3108π, 0.25π, 0.6892π, 0.25π) where CR was randomly generated as 0.35, and rnbr_i = 3. After quantum observation, the trial binary individual X C0 1 was generated as (1, 0, 1, 1, 0, 0, 1, 0, 1, 0), and the fitness was evaluated as f X C0 1 , q t+1 should be updated by the QRG with an adaptive GWO. The positions and profits of the current three best wolves were shown as: 1, 1, 0, 1, 1, 0, 1, 0 Then, the quantum individual of the next iteration q t+1 θi was generated by Equations (16)-(24) as:  The individuals of the next iteration continued to evolve until the maximum number of iterations was reached. After the iterations, the best profit of this KP01 problem was 57, and one of the best solutions was (0,1,1,1,1,1,1,0,0,0).

Experimental Results
To assess the performance of the proposed QDGWO algorithm, two groups of datasets are used for solving the KP01.
All experiments were conducted with Matlab 2016b, running on an Intel Core i7-4790 CPU @ 3.60 GHz, and Windows 7 Ultimate Edition.
In the first experiment described in [37], there were 50, 250, 500, 1000, 1500, 2000, 2500, and 3000 dimension sets of data by Equation (26) to test the performance of the QDGWO in high-dimension situations.
where w i is the weight of the ith item x i ; p i is the value of x i ; C is the weight capacity of the knapsack; and m is the number of items.
In the first experiment, m ranged from 50 to 3000, and the maximum number of iterations in all cases was set to 1000.
To verify the effectiveness and efficiency of the QDGWO, the results of the proposed algorithm were compared with three algorithms: QEA [37], AQDE [45], and QSE [48]. The parameters of algorithms used in the experiments are presented in Table 2, where the population size is 20. The best profits, the average profits, the worst profits, and the standard deviations of 30 independent runs are shown in Table 3 and Figures 4-7. The Wilcoxon signed-rank test [59] is performed for the results of the competing algorithms in Table 3 with a significance level α = 0.05, where +, −, and = indicate that this algorithm is superior, inferior, or equal to the QDGWO, respectively.         To illustrate the importance of the role of the crossover operation of the DE in exploring the global optimum, comparative tests between the QDGWO with and without the crossover operation were performed. Moreover, we compared the binomial crossover operator of the DE with the exponential crossover operator of the DE. The best profits, the average profits, the worst profits, and the standard deviations of 30 independent runs are presented in Table 4. The Wilcoxon signed-rank test [59] is performed for the results in Table 4 with a significance level α = 0.05, where +, -, and = indicate that this strategy is superior, inferior, or equal to the QDGWO with a binomial crossover of the DE, respectively.

Without
With Binomial With Exponen- To illustrate the importance of the role of the crossover operation of the DE in exploring the global optimum, comparative tests between the QDGWO with and without the crossover operation were performed. Moreover, we compared the binomial crossover operator of the DE with the exponential crossover operator of the DE. The best profits, the average profits, the worst profits, and the standard deviations of 30 independent runs are presented in Table 4. The Wilcoxon signed-rank test [59] is performed for the results in Table 4 with a significance level α = 0.05, where +, −, and = indicate that this strategy is superior, inferior, or equal to the QDGWO with a binomial crossover of the DE, respectively. In the second experiment described in [49], there were 50, 200, 500, 1000, 1500, and 2000 dimension sets of data by Equation (27) to test the performance of the QDGWO in high-dimension situations.
where w i is the weight of the ith item x i ; p i is the value of x i ; C is the weight capacity of the knapsack; and m is the number of items.
In the second experiment, m ranged from 50 to 2000, and the maximum number of iterations in all cases was set to 1000.
To present the performance of the proposed algorithm in the global optimization, we compared the QDGWO algorithm with the QIHSA [49] for knapsack problems. The optimization results of the success rate (SR%) and the best profit are shown in Table 5. The Wilcoxon signed-rank test [59] is performed for the results of the QIHSA in Table 5 with a significance level α = 0.05, where +, −, and = indicate that this algorithm is superior, inferior, or equal to the QDGWO, respectively.
The obtained results demonstrate the competitive performance of the proposed QDGWO algorithm. According to the results, the proposed algorithm is more efficient for the high-dimensional 0-1 knapsack problems, as shown in Table 4 and Figures 3-5. Compared with the QEA [25], AQDE [33], QSE [36], and QIHSA [37], the QDGWO was the most effective and efficient algorithm in the experiments. The advantages of the QDGWO became more obvious when the number of items was large, especially in high dimensional cases of the knapsack problems. The proposed algorithm obtains both rapid exploration and high exploitation in searching solutions. The QDGWO converges quickly to the global optimal solution. For example, the algorithm approaches the global optimum at about the 500th iteration in the case of 500 items (see Figure 4). However, the algorithm continues searching near the global optimal solution, i.e., the exploitation. To illustrate this, in the case of 500 items (see Figure 4), the QDGWO continues seeking further optimization after approaching the optimal solution and obtains better solutions in the exploitation until the end of the iterations.
Based on the results shown in Table 3, it can be concluded that the crossover operation plays a significant role in searching the solution space efficiently. However, the performance of the QDGWO is not very sensitive to which kind of crossover operator is used in the algorithm. From the experiment results, the binomial crossover operator of the DE yields slightly better optimal solutions than the exponential crossover operator of the DE in all cases. The results can be interpreted to show that quantum updating with the quantum rotation gate remains the most decisive and crucial operation in exploring the search space even if the crossover operation is required to improve the solutions.
Finally, compared with the other four methods, the experimental results show the advantages of the collaborative optimization with operations of adaptive mutation, crossover, and quantum rotation gate with the adaptive GWO in investigating the search space.

Conclusions
A quantum-inspired differential evolution algorithm with grey wolf optimizer (QDGWO) was proposed to solve the 0-1 knapsack problems. The proposed algorithm combined the superposition principles of quantum computing, differential evolution operations, and the hunting behaviors of grey wolves. The QDGWO used the principles of quantum computing such as quantum superposition states and quantum gates. Furthermore, it contained mutation, crossover, and selection operations of the DE. To maintain a better balance between the exploration and exploitation of searching for the global optimal solution, the proposed algorithm adapted a quantum rotation gate with the adaptive GWO to update the population of solutions. The results of tests performed for resolving the knapsack problems demonstrate that the QDGWO was able to enhance diversity and convergence performance for solving 0-1 knapsack problems. In addition, the QDGWO was effective and efficient in finding the optimal solutions for high-dimensional situations.
Although the QDGWO displays excellent performance in solving 0-1 knapsack problems, there are several directions of improvement for the proposed algorithm. First, to improve the effectiveness of the QDGWO, initial solutions of the quantum population can be generated with metaheuristic methods. In addition, the proposed approaches can be applied to solve other combinatorial optimization problems. Moreover, it is worth studying how to use the concepts of quantum computing in other novel metaheuristic approaches such as the MPA [22] and AOA [27], as well as multi-objective optimization algorithms.