A Thermodynamical Selection-Based Discrete Differential Evolution for the 0-1 Knapsack Problem

Many problems in business and engineering can be modeled as 0-1 knapsack problems. However, the 0-1 knapsack problem is one of the classical NP-hard problems. Therefore, it is valuable to develop effective and efficient algorithms for solving 0-1 knapsack problems. Aiming at the drawbacks of the selection operator in the traditional differential evolution (DE), we present a novel discrete differential evolution (TDDE) for solving 0-1 knapsack problem. In TDDE, an enhanced selection operator inspired by the principle of the minimal free energy in thermodynamics is employed, trying to balance the conflict between the selective pressure and the diversity of population to some degree. An experimental study is conducted on twenty 0-1 knapsack test instances. The comparison results show that TDDE can gain competitive performance on the majority of the test instances.


Introduction
Many problems in business and engineering can be modeled as 0-1 knapsack problems [1,2], such as project selection, resource distribution and investment decision-making problems.In the 0-1 knapsack problem, given D items, each of them has a weight W j and a profit P j [3].The aim is to choose a subset from the D items to maximize the overall profit without exceeding the weight capacity C of the knapsack [4].Mathematically, the 0-1 knapsack problem can be formulated as follows: where X j is a binary decision variable, which indicates that item j is contained in the knapsack or not.W j and P j are the weight and profit of item j, respectively.C is the maximum weight capacity of the knapsack, and D is the number of items.However, the 0-1 knapsack problem is one of the classical NP-hard problems [4][5][6], which means that no exact algorithms are known to obtain the optimum solutions for this problem in polynomial computation time.Therefore, it is of significance both in theory and in engineering applications to develop effective and efficient algorithms for the 0-1 knapsack problems.
Evolutionary algorithms (EAs) are effective heuristic algorithms for solving global optimization problems [7][8][9][10][11].Moreover, many kinds of evolutionary algorithms have been successfully applied to solve the 0-1 knapsack problem in the past few decades.Shi [12] proposed an improved ant colony algorithm for solving 0-1 knapsack problems.In the improved ant colony algorithm, a novel pheromone updating strategy is designed according to the characteristics of the 0-1 knapsack problems.Neoh et al. [13] introduced a layered encoding cascade evolutionary approach (LGAPSO) to solve 0-1 knapsack problems.In LGAPSO, genetic algorithm (GA) and particle swarm optimization (PSO) are utilized for searching the global optimum.Shang et al. [14] proposed a quantum immune clonal selection algorithm (QICSA) for solving the multi-objective 0-1 knapsack problem.QICSA uses a string of qubits to represent the solutions and employs a chaotic search strategy to generate a new antibody.Layeb [15] introduced a novel quantum-inspired cuckoo search for 0-1 knapsack problems.A quantum-inspired tabu search algorithm (QTS) is proposed by Chiu et al. [16] for solving 0-1 knapsack problems.The experimental results indicate that QTS performs much better than the other heuristic algorithms on 0-1 knapsack problems.Zou et al. [4] presented a novel harmony search algorithm (NGHS) to solve 0-1 knapsack problems.In NGHS, a position updating scheme and a genetic mutation operator with a small probability are utilized to improve the performance of the traditional harmony search algorithm.A modified binary particle swarm optimization algorithm is proposed by Bansal and Deep [5] for 0-1 knapsack problems.Sabet et al. [17] presented a binary version of the artificial bee colony algorithm to solve the 0-1 knapsack problem.In the proposed binary artificial bee colony algorithm, a hybrid probabilistic mutation scheme is utilized for searching the neighborhood of food sources.Gherboudj et al. [18] introduced a discrete binary version of the cuckoo search algorithm for solving 0-1 knapsack problems.In the literature [19], a hybrid quantum inspired harmony search algorithm is proposed by Layeb for solving 0-1 knapsack problems.Lu and Yu [20] introduced a quantum multi-objective evolutionary algorithm with an adaptive population (APMQEA) to solve multi-objective 0-1 knapsack problems.In the search process, APMQEA fixes the number of Q-bit individuals assigned to each objective solution, while it adaptively updates its population size according to the number of found non-dominated solutions.Deng et al. [21] introduced a binary encoding differential evolution for solving 0-1 knapsack problems.Truong et al. [6] presented a chemical reaction optimization with a greedy strategy algorithm (CROG) for solving 0-1 knapsack problems.The experimental results reveal that CROG is a competitive algorithm for solving 0-1 knapsack problems.In the literature [22], an amoeboid organism algorithm is proposed by Zhang et al. to solve 0-1 knapsack problems.
Among the evolutionary algorithms, differential evolution, proposed by Storn and Price in 1997 [23], is a simple, yet effective, global optimization algorithm.According to frequently reported theoretical and experimental studies, differential evolution (DE) has demonstrated better performance than many other evolutionary algorithms in terms of both convergence speed and solution quality over several benchmark functions and real-life problems [24][25][26].Due to its effectiveness, as well as global search capability, DE has attracted many researchers' interests since its introduction.Thus, it has become a research focus of evolutionary computation in recent years [25,26].
However, DE adopts a one-to-one greedy selection operator between each pair of the target vector and its corresponding trial vector, which exhibits weak selective pressure due to unbiased selection of parents or target vectors [25,26].Furthermore, this weakness may lead to inefficient exploitation when relying on differential mutation, especially on the rotated optimization problems [26].A straightforward way to alleviate this shortcoming may be to enhance the selection operator to improve the selective pressure.In fact, such mechanism indeed can promote the exploitation capacity of DE.However, high selective pressure may often lead to rapid loss of population diversity and, thus, increase the probability of being trapped in local minima.Therefore, increasing the selective pressure in DE is often in conflict with promoting the population diversity, which indicates that a feasible solution to alleviate this weakness of DE cannot merely improve one of the selective pressures or the population diversity [25,26].
Nevertheless, to the best of our knowledge, it is one of the most challenging issues of DE to keep a balance between the selective pressure and the diversity of population.Thus, in this paper, we propose a promising discrete DE (TDDE) using an enhanced selection scheme (MFES) inspired by the principle of the minimal free energy in thermodynamics, trying to palliate the conflict between the selective pressure and the population diversity to some degree.Further, the proposed algorithm is applied to the 0-1 knapsack problems.
The rest of the paper is organized as follows.The conventional DE and discrete DE are introduced in Section 2. Section 3 presents the improved selection operator of DE inspired by the principle of the minimal free energy in thermodynamics, which is useful for elaborating the implementation of the proposed algorithm, TDDE, in Section 4. Numerical experiments are presented in Section 5 for the comparison and analysis.Finally, Section 6 concludes this paper.

Differential Evolution
Like other evolutionary algorithms (EAs), DE is a simple, yet efficient, stochastic optimization technique, which has a simple structure, only consisting of easy operators, namely, mutation, crossover and selection operators [23,27,28].Therefore, it is easy to understand and implement.However, it exhibits better search performance than many other evolutionary algorithms in terms of convergence speed and solution accuracy in many practical applications [26,29,30].
Because the 0-1 knapsack problem is a maximization optimization problem, we only consider maximization problems in this study.We assume that the objective function to be maximized by DE is Max f (X), X = [X 1 , X 2 , ..., X D ], and the search space is: where D is the dimensionality of the problem to be optimized and Lo j and U p j are the lower and upper boundaries of the search space.In the search process, DE starts with an initial population P (t) = {X t i } randomly sampled from the search space, where X t i = [X t i,1 , X t i,2 , ..., X t i,D ], i = 1, 2, ..., N P ; N P is the population size and t is the generation.After initialization, DE executes its mutation, crossover and selection operators repeatedly to move its population toward the global optimum until the termination condition is satisfied [31].Next, we will elaborate the evolutionary operators of DE as follows.

Mutation Operator
In the mutation operator, DE generates a mutant vector V t i by a preset mutation strategy for each individual X t i , called a target vector, in the current population [26,30].There are many mutation strategies used in the DE implementations [26,32], such as DE/rand/1, DE/best/1, DE/rand-to-best/1, DE/best/2/ and DE/rand/2.The most frequently used one is DE/rand/1, which is described as follows [23,26].
where the indices r1, r2, r3 are mutually exclusive integers randomly selected from the set {1, 2, ..., N P } \ {i}.F is a scaling factor, which scales the difference vector X t r2 − X t r3 .

Crossover Operator
After mutation, a crossover operator is utilized for each pair of target vector X t i and its corresponding mutant vector V t i to create a trial vector U t i [26,29,33].Binomial and exponential crossovers are two commonly used crossover schemes in the current popular DE.The binomial crossover is expressed in the following form [23,26].
where rand(0,1) is a uniformly distributed random number within the range [0, 1], which is produced for each j, and CR ∈ [0, 1] is called a crossover probability, controlling the number of components duplicated from the mutant vector V t i .jrand is a random integer selected from the range [1, D], which ensures that the trial vector U t i differs from its corresponding target vector X t i by at least one dimension.

Selection Operator
Generally, if the values of some parameters of the trial vector U t i violate the predefined corresponding upper and lower boundary constraints, we randomly and uniformly reset the violating components within the preset range [27].Then, the objective function values of all of the trial vectors are evaluated.Next, DE executes the selection process in order to select the better individuals to enter the next generation.For maximization problems, the selection operator can be formulated as follows [23,26].
where f (X t i ) and f (U t i ) are the objective function values of the target vector X t i and its corresponding trial vector U t i , respectively.

Discrete Mutation Operator
As is known, the individuals of the traditional DE are represented as real-value vectors.Therefore, the traditional DE cannot directly handle the combinatorial optimization problems.To this end, many researchers have improved the mutation operators of the traditional DE for solving combinatorial optimization problems, presenting discreet DE, among which novel hybrid discrete differential evolution (W_DDE) is proposed by Wang [34].The enhanced mutation operator of W_DDE is represented as follows [34].
where the indices r1, r2, r3 are the same as those in Formula (3).The above formula includes two parts.The first part is, and the second part is, where mod is the modulus function.

Algorithmic Description of DE
Based on the above detailed descriptions of the mutation, crossover and selection operators of DE, the algorithmic description of DE with the DE/rand/1/bin strategy is summarized in Algorithm 1, where F Es is the number of fitness evaluations and M ax_F Es is the maximum number of evaluations.for j=1 to D do 5: X t i,j =Lo j + rand(0,1)×(Lo j − U p j ); end for Evaluate the fitness value of individual X t i ; 8: F Es = F Es + 1; 9: end for 10: while F Es < M AX_F Es do 11: for i= 1 to N P do 12: Randomly select three mutually exclusive integers r1, r2, r3  if rand(0,1)< CR or j==jrand then 17: end if

Motivations
As is known, both selective pressure and population diversity are significant for EAs [35][36][37][38].However, in the traditional DE, a one-to-one competition mechanism is utilized as the selection operation between each pair of the target vector and its corresponding trial vector, which may induce weak selective pressure owing to its unbiased selection of parents or target vectors [26].In addition, the traditional DE selects individuals for the next generation merely based on the fitness values [26].As a result, the selection operator may cause deficient exploitation when depending on differential mutation, especially on the rotated optimization problems [25,26].In order to enhance the selection operator of the traditional DE, in this section, we propose an improved selection operator, MFES, which is inspired by the principle of the minimal free energy in thermodynamics, trying to palliate the conflict between the selective pressure and the population diversity to some degree.The principle of the minimal free energy refers to [39][40][41][42], in the annealing process, a metal, beginning with high temperature and chaotic state, is gradually cooled, so that the system at any temperature approximately reaches thermodynamic equilibrium.This cooling process can be regarded as an adaptation procedure to reach the stability of the final crystalline solid.In addition, any change from non-equilibrium to equilibrium of the system at each temperature abides by the principle of the minimal free energy.This means the system will change spontaneously to reach a lower total free energy and the system achieves equilibrium when its free energy seeks a minimum [40][41][42].The free energy F is defined by: where E is the mean energy of the system, H is the entropy and T is the temperature.According to the principle of the minimal free energy, we can realize that any change from non-equilibrium to equilibrium of the system can be regarded as a consequence of the competition between the mean energy and the entropy, and the temperature T determines their relative weights in the competition [39,41,42].Accordingly, the competition between the mean energy and the entropy in the annealing process is the same as the competition between the selective pressure and the population diversity of DE during the evolution process.Therefore, we can alleviate the conflict between the selective pressure and the diversity of population according to the principle of the minimal free energy.
Inspired by [41][42][43], in the improved selection scheme, we firstly map the selective pressure and the population diversity of DE into the mean energy E and the entropy H in the principle of the minimal free energy, respectively.Then, the criterion of the proposed selection scheme is converted to the minimal free energy, which means that we select individuals for the next generation from the parent, and the offspring population should satisfy the principle of the minimal free energy.More specifically, in the selection process, we start with computing the free energy of each individual in the parent and offspring population; then, the top N P individuals with minimal free energy are selected for the next generation.Therefore, the selected individuals for the next generation satisfying the principle of the minimal free energy indicate that the improved selection scheme maintains the fitness value of the next generation population as well as possible, while preserving the most possible diversity.Thus, the proposed selection scheme simultaneously considers the factors of solution quality and the diversity of the population.

Energy
As discussed above, we should map the selective pressure of DE into the mean energy E in the principle of the minimal free energy.In general, the higher selective pressure may directly lead to the better individuals selected for the next generation.Therefore, we can measure the selective pressure by the fitness values of the selected individuals [41].The energy E of each individual is mapped into the normalized fitness value of the corresponding individual.Mathematically, the energy E(X t r ) of any individual X t r is defined by: Because the 0-1 knapsack problem is a maximization optimization problem, whereas the criterion of the proposed selection scheme is the minimal free energy, the energy E(X t r ) of any individual X t r is defined by the normalized −f (X t r ), where f (X t r ) is the objective function value of individual X t r , the characteristic of whose fitness value is that the larger fitness value reflects the individual better.bl t , bu t are the lower and upper boundaries of the fitness values of the parent population P t and offspring population O t at generation t, respectively.bl t , bu t are defined by: bl

Entropy
As pointed out in Section 3.1, we should also map the population diversity of DE into the entropy H in the principle of the minimal free energy.Generally, the distribution of the individuals can directly reflect the population diversity [41].Thus, we divide the fitness values of the individuals into K ranks.Then, we count the number of individuals in each rank to measure the population diversity.The i-th rank β t i is defined by: where i = 0, 1, ..., K − 1; a is a factor related to the width of each rank, set to two in the proposed approach, and K ≥ 2 is the number of ranks.For any individual X t r , if E(X t r ) ∈ β t i , this means that X t r is located in the rank β t i .For any individual X t r located in the rank β t i , assuming the number of individuals within the rank β t i is n i , the entropy H of individual X t r is defined as follows: where N P is the number of individuals in the parent population P t and M is the size of the offspring population O t at generation t.It is known that the population diversity is better while the value of log K ( n i N P +M ) is larger [41].However, the criterion of the proposed selection scheme is the minimal free energy.Thus, the entropy H of individual X t r is defined as −log K ( n i N P +M ).Based on the definitions of the energy E and the entropy H above, for any individual X t r , its free energy is calculated as: where T is the temperature, which is gradually cooled as the evolutionary process proceeds.

Description of Thermodynamical Selection Operator for DE
Based on the notations and terminologies of the MFES selection scheme in DE, the procedure of MFES in DE is described as follows.Firstly, a temporary population P t+1 is created by combining the parent population P t with the offspring population O t at generation t.Then, the free energy of each individual in the temporary population P t+1 is calculated according to Equation (15).After that, the top M individuals with maximal free energy are chosen to delete from the temporary population P t+1 .Subsequently, all of the remaining individuals in the temporary population P t+1 are selected for the next generation population P t+1 .The detailed procedure of the MFES selection scheme in DE is shown in Algorithm 2.
Algorithm 2 MFES selection scheme for differential evolution.
Input: Temperature T , the parent population P t and the offspring population O t ; Output: The next generation population P t+1 ; 1: Combine the parent population P t with the offspring population O t to constitute a temporary population P t+1 ; 2: Calculate the free energy of each individual in the temporary population P t+1 according to Equation (15); 3: Choose the top M individuals with maximal free energy; 4: Remove the chosen M individuals from P t+1 ; 5: Create the next generation population P t+1 by the remaining individuals in P t+1 .

Proposed TDDE
Based on the description of the thermodynamical selection operator for DE, in this section, we propose an enhanced discrete DE for the 0-1 Knapsack problem, which selects the individuals for the next generation using the proposed thermodynamical selection operator.

Population Initialization
In the population initialization process, N P 0-1 vectors with D dimensions are randomly generated.For the i-th individual X t i , it is initialized by: where rand(0,1) is a uniformly distributed random number within the range [0, 1], which is produced for each j; j = 1, 2, .., D; i = 1, 2, ..., N P ; N P is the population size, and D is the number of items.

Discrete Mutation Operator
Inspired by [34], we design a 0-1 discreet mutation operator in TDDE as follows: where the indices r1, r2, r3 are distinct integers uniformly chosen from the set {1, 2, ..., N P } \ {i}, and F is the scaling factor.The above formula contains two parts.The first part is, The second part is, where mod is the modulus function.

Crossover Operator
In the traditional DE for continuous optimization problems, the crossover operator is not related to the continuous or discrete characteristics of the problems.Thus, the crossover operator in the traditional DE can be directly used in the proposed TDDE, which is the same as Formula (4).

Repair Operator
Since the individuals generated in the initialization phase or trial individuals created by the evolutionary operators may violate the knapsack capacity constraint, we should repair each newly created individual, so that it can satisfy the knapsack capacity constraint.Assume individual X t i violates the knapsack capacity constraint.In the repair operator, we examine each parameter of individual X t i by descendant order according to the P j W j value of the items (note that we have sorted the items by descendant order according to the P j W j value of the items before initialization population).In the examination process, If X t i,j is equal to one and individual X t i violates the knapsack capacity constraint, item j will be removed from the knapsack, namely we change X t i,j from one to zero.Then, we judge whether individual X t i satisfies the knapsack capacity constraint or not.If individual X t i still violates the knapsack capacity constraint, we will examine the next item; otherwise, individual X t i is already well repaired.The detailed process of the repair operator is described in Algorithm 3, where T W is is the total weight of individual X t i .After repairing the individual X t i , its fitness value is calculated by: Algorithm 3 Repair Operator in TDDE X t i,j = 0; end if 8: j = j + 1; 9: end while

Procedure of TDDE
Based on the above designed operators, the procedure of the proposed TDDE algorithm for solving the 0-1 knapsack problem is summarized as follows.At each temperature T , TDDE evolves LK generations.At each generation, TDDE creates M offspring individuals by the discrete mutation, crossover and repair operators, then selects N P individuals from the N P + M individuals for the next generation using the proposed thermodynamical selection operator.The aforementioned steps are repeated until the termination criterion is met.The framework of TDDE algorithm is summarized in Algorithm 4.

Runtime Complexity of TDDE
As pointed out in [44], the runtime complexity of the traditional DE is O(M AX_F ES • D).We use the same method as in [44] to analyze the runtime complexity of TDDE.In the initial process of TDDE, sorting the items requires O(D • log(D)) runtime and generating, repairing and evaluating the initial population cost O(D • N P ), O(D • N P ), O(N P ) runtime, respectively.In the evolutionary loop, the number of generations is and thus, TDDE does not add serious cost to the runtime complexity of the traditional DE. for i= 1 to LK do Select N P individuals from P t ∪ O t for the next generation population P t+1 using the proposed MFES selection scheme;

Experimental Setup
In order to evaluate the performance of the proposed TDDE algorithm for solving 0-1 knapsack problems, twenty 0-1 knapsack test instances are produced by using the method as recommended by [4], which is widely used in the field of 0-1 knapsack problem research [15,16,19].To generate each 0-1 knapsack test instance, we randomly generate the weight W j and profit P j for item j, where j = 1, • • • , D; W j is a uniformly distributed random number in the range [5,20], P j is randomly generated from a uniform distribution in the range [50,100] and the maximum weight capacity of a knapsack C is set to: The dimensions of the twenty 0-1 knapsack test instances are set to 500, 1000, 1500 and 2000, respectively, and the number of the 0-1 knapsack test instances for each dimension is set to five.The twenty 0-1 knapsack test instances are summarized in Table 1.

Adjusting Parameter Settings
There are two important parameters in TDDE, namely the number of ranks K and the size of offspring population M .In this section, we carry out experiments to investigate the impacts of these two parameters.In the experimental studies, TDDE conducts 30 independent runs with D × 1000 function evaluations (FEs) as the termination criterion; the population size N P of TDDE in all experiments is set to 100.As recommended in [4], the average and standard deviation of the maximal total profit is recorded for measuring the performance of TDDE.
As discussed in Section 3.3, the number of ranks K is related to the measurement of the population diversity.In order to investigate the impacts of various numbers of ranks K, the parameters of TDDE, M, LK, T 0, F and CR are set to 20, 100, 10, 0.5 and 0.9, respectively, while K is set to range from N P × 0.1 to N P × 0.5 with a step of 10.The experimental results are shown in Table 2.The best results among different values of K are highlighted in bold."Mean Error" and "SD" stand for the mean and standard deviation of the maximal total profit obtained in 30 independent runs, respectively.From the results in Table 2, we can conclude that TDDE can achieve the best performance when the number of ranks K is set in the range [N P × 0.1, N P × 0.2].In order to find the most suitable parameter value of K at a statistical level, we carry out the average ranking of the Friedman test, as recommended by [45][46][47].
Table 3 shows the average ranking of TDDE with various values of K. From the results shown in Table 3, we can know that K = N P × 0.2 obtains the best ranking, which indicates that K = N P × 0.2 is the relatively most suitable parameter value of K for these twenty 0-1 knapsack test instances.Table 3.Average rankings of various numbers of ranks K for the twenty test instances achieved by the Friedman test.

Values of K
Ranking As pointed out in Section 3.2, the size of offspring population M is associated with the measurement of the selective pressure.In order to study the effects of different sizes of offspring population M , the parameters of TDDE, K, LK, T 0, F and CR are set to 20, 100, 10, 0.5 and 0.9, respectively, while M varies from N P × 0.1 to N P × 0.5 with a step of 10.The best results among different values of M are shown in bold.The results are shown in Table 4. From the results, we can see that TDDE performs best when the size of offspring population M is chosen in the range [N P × 0.1, N P × 0.3].In order to choose the best parameter value of M at a statistical level, we also conduct the average ranking of the Friedman test as recommended by [45][46][47].Table 5 shows the average ranking of TDDE with different sizes of offspring population M .From the results shown in Table 5, we can see that M = N P × 0.2 achieves the highest ranking, which reveals that M = N P × 0.2 is the relatively best parameter value of M for these twenty 0-1 knapsack test instances.

Comparison with Existing Algorithms
In order to verify the effectiveness of the proposed TDDE algorithm, we compare the TDDE algorithm with W_DDE [34], NGHS [4] and TDGA [41] algorithms on the twenty 0-1 knapsack test instances.In addition, W_DDE was originally applied to the blocking flow shop scheduling with the makespan criterion.In order to solve the 0-1 knapsack problems, we use the discrete mutation of W_DDE to improve the traditional DE and also utilize the repair operator presented in Section 4.4 to repair the unfeasible individuals.
In the comparative study, for each algorithm and each test instance, 30 independent runs are conducted with D×1000 function evaluations (FEs) as the termination criterion.The average and standard deviation of the maximal total profit is recorded for measuring the performance of each algorithm.In order to have a fair comparison, the population size of all of the algorithms is set to 100.Additionally, the other parameters value of NGHS and TDGA remain the same as in their original papers.For W_DDE and TDDE, F and CR are set to 0.5 and 0.9, respectively.K, M, LK, T 0 of TDDE are set to 20, 20, 100 and 10, respectively.The mean and standard deviation of the maximal total profit obtained by each algorithm for the twenty 0-1 knapsack test instances are shown in Table 6.For clarity, the best results among the algorithms are marked in boldface.In order to obtain statistically significant conclusions, we perform a two-tailed t-test at a 0.05 level of significance [48][49][50] on the experimental results.The summary comparison results are presented in the last three rows of Table 6."+", "-" and "≈" imply that TDDE performs better than, worse than and similarly to the corresponding algorithm according to the two-tailed t-test, respectively.
From the results in Table 6, we can see that TDDE achieves better results than all of the other algorithms on the majority of the twenty 0-1 knapsack test instances.Specifically, TDDE significantly surpasses all of the other algorithms on test instances B3, B6, B7, B8, B11, B12, B15, B16, B18 and B20 according to the two-tailed t-test.In addition, TDDE yields significantly better performance than TDGA on all twenty test instances.Comparing TDDE with TDGA, we can conclude that the designed 0-1 discreet mutation operator has efficient search ability.NGHS obtains better performance than TDDE on test instances B17 and B19 and performs similarly to TDDE on test instances B13 and B14.However, TDDE outperforms NGHS on the remaining test instances.Further, W_DDE is better than TDDE on test instances B2, B5, B10, B13 and B19 and is similar to TDDE on test instances B1, B4 and B9, whereas TDDE surpasses W_DDE on the rest of the test instances.The potential reason for the better results achieved by TDDE is that TDDE can keep a balance between the selective pressure and the population diversity during the evolutionary process.
In summary, TDDE is significantly better than TDGA, NGHS and W_DDE on twenty, sixteen and twelve test instances according to the two-tailed t-test, respectively.In addition, TDDE achieves similar performance to NGHS and W_DDE on two and three test instances, respectively.Moreover, TDGA cannot be significantly better than TDDE on any test instance, while NGHS and W_DDE only outperform TDDE on two and five test instances, respectively.These results are understandable according to the no free lunch theorems [51], because there is no single algorithm that always performs better than other algorithms when considering all of the possible cases.In order to compare the total performance of the four algorithms on all twenty test instances, we carry out the average ranking of the Friedman test on the experimental results following the suggestions in [45][46][47].Table 7 presents the average ranking of the four algorithms on all twenty test instances.We can sort these four algorithms by the average ranking into the following order: TDDE, W_DDE, NGHS and TDGA.Therefore, TDDE obtains the best average ranking, and its total performance is better than the other three algorithms on all twenty test instances.To compare the performance differences between TDDE and the other three algorithms, we perform the Wilcoxon signed-ranks test [52][53][54] with a significance level of 0.05 on the experimental results.Table 8 shows the resultant p-values when comparing between TDDE and the other three algorithms.p-values less than 0.05 are shown in bold.From the p-values in Table 8, we can know that TDDE is significantly better than TDGA, NGHS and W_DDE according to the Wilcoxon signed-ranks test.The efficient performance of TDDE can be because the proposed MFES selection scheme used in TDDE can alleviate the conflict between the selective pressure and the population diversity in the search process to some degree.

Conclusions
The 0-1 knapsack problem is widely used to model problems in the fields of business and engineering.However, the 0-1 knapsack problem is one of the classical NP-hard problems.Therefore, it has important and useful applications to develop effective and efficient algorithms for solving 0-1 knapsack problems.DE is a promising algorithm for solving 0-1 knapsack problems.However, the traditional DE utilizes a one-to-one competition mechanism in the selection operation, which may easily lead to weak selective pressure.Aiming at this weakness of the traditional DE, in this study, we propose an improved discrete differential evolution (TDDE) for 0-1 knapsack problems, which employs a novel selection operator inspired by the principle of the minimal free energy in thermodynamics.Experiments are conducted on twenty 0-1 knapsack test instances.In the experiments, we have investigated the important parameters of TDDE.Moreover, we compare TDDE with TDGA, NGHS and W_DDE algorithms.The comparison results indicate that the performance of TDDE is competitive on the majority of the test instances.The experimental results also validate that the proposed selection operator can alleviate the conflict between the selective pressure and the population diversity to some degree.
In the future, we will apply TDDE to large-scale hard combinatorial problems.Furthermore, it is also interesting to investigate how to automatically and adaptively adjust the control parameters of TDDE.

Algorithm 4
Algorithmic description of TDDE.1: t = 0, k = 0, T = T 0; 2: Sort the D items by descendant order according to P j W j value; 3: Generate an initial population P t with N P individuals; 4: Repair each individual in the initial population; 5: Evaluate the fitness value of each individual in the initial population; 6: F Es = N P ; 7: while F Es < M AX_F Es do 8:

9 :
Create M offspring individuals by the discrete mutation, crossover operators; 10: Constitute the offspring population O t by the newly created M offspring individuals; 11: Repair each individual in the offspring population O t ; 12: Evaluate the fitness value of each individual in population O t ; 13:

Table 4 .
Experimental results of different sizes of offspring population M over 30 independent runs for the twenty test instances.Instance M = 0.1 × N P M = 0.2 × N P M = 0.3 × N P M = 0.4 × N P M = 0.5 × N P Mean ± SD Mean ± SD Mean ± SD Mean ± SD Mean ± SD

Table 2 .
Experimental results of various numbers of ranks K over 30 independent runs for the twenty test instances.

Table 5 .
Average rankings of different sizes of offspring population M for the twenty test instances achieved by the Friedman test.

Table 7 .
Average rankings of the four algorithms for the twenty test instances achieved by the Friedman test.

Table 8 .
Wilcoxon test between TDDE and the other three algorithms for the twenty test instances.p-values below 0.05 are typed in bold.