Abstract

Differential evolution (DE) is one of the most popular and powerful evolutionary algorithms for the real-parameter global continuous optimization problems. However, how to adapt into combinatorial optimization problems without sacrificing the original evolution mechanism of DE is harder work to the researchers to design an efficient binary differential evolution (BDE). To tackle this problem, this paper presents a novel BDE based on dichotomous mechanism for knapsack problems, called DBDE, in which two new proposed methods (i.e., dichotomous mutation and dichotomous crossover) are employed. DBDE almost has any difference with original DE and no additional module or computation has been introduced. The experimental studies have been conducted on a suite of 0-1 knapsack problems and multidimensional knapsack problems. Experimental results have verified the quality and effectiveness of DBDE. Comparison with three state-of-the-art BDE variants and other two state-of-the-art binary particle swarm optimization (PSO) algorithms has proved that DBDE is a new competitive algorithm.

1. Introduction

The knapsack problems, as one of the classical NP-hard combinational optimization problem, have a lot of immediate applications in project selection, resource distribution, investment decision-making, financial management, and so on. The 0-1 knapsack problem and multidimensional knapsack problem are the most common and important in the family of knapsack problems and have been extensively studied [1]. In recent decades, evolutionary algorithms, such as genetic algorithms (GA) [24], particle swarm optimization (PSO) [5, 6], and differential evolution (DE) [7, 8], have been well-adopted for solving the knapsack problems. Although many knapsack problems have been tackled by these approaches, some new and more difficult knapsack problems (such as high dimension knapsack problems) hidden in the real world have not been properly solved [9, 10]. So the research on them is still important and necessary.

DE, proposed by Storn and Price [11], has drawn the attention of many researchers all over the world. As one of the most popular and powerful optimization techniques, DE has many advantages, for example, fast, simple, easy to use, and efficient for the real-parameter global continuous optimization problems. Initially, DE was designed as an optimization technique for used in real-number spaces. As the emergence of DE, many researchers around the world study from different aspects and proposed a lot of improved DE variants [1217]. However, many combinational optimization problems are set in a space featuring binary and the classical DE is not suitable for it. Therefore, a number of binary versions of DE (BDE) have been proposed. Some work is mainly dedicated to design a mapping from continuous-space to binary space. For example, in the early days of BDE research, Pampara et al. [18] proposed an angle modulated DE (AMDE), in which a trigonometric function was employed as a bit string generator. Thus AMDE can operate in binary spaces without deviating from the basic search mechanism of the classical DE. Hota and Pat [7] proposed an adaptive quantum-inspired DE (AQDE), in which mutation operator is similar to that of classical DE and operates directly on the Q-bit () where is defined in . Besides the abovementioned methods, many attempts as well focused on operating on binary space directly. For example, He and Han [19] first use logical operators to replace the original operations of the mutation mechanism in DE, and thus the individual can be evolved directly using binary string. Gong and Tuson [20] proposed binary-adapted DE operators based on forma analysis to directly manipulate bit strings. Additionally, some BDE variants with new binary mutation operators, such as MBDE [21], NMBDE [8], and BLDE [22], are proposed one after another. However, we have noted that it is a challenging task to design an efficient BDE. If the BDE still evolves in the real-number spaces, the expensive computational cost of transforming the real-coded individuals into binary strings is a hard problem. Moreover, if the BDE evolves in the binary spaces directly, the weak exploration ability of directly operating bit-stings has definitely hindered the BDE to solve the difficult and high-dimensional knapsack problems.

In psychology, dichotomous thinking, also known as “black or white thinking,” is a tendency to only see extremes. Based on dichotomous thinking, the result of executing XOR operation on any two binary strings can be divided into two types, that is, common and difference, and the mutation and crossover operations of BDE can also be divided into two types. If the result is common then we can perform one operation, else if it is difference then we can perform another heterogeneous operation. Motivated by these observations, we proposed a novel dichotomous binary differential evolution (DBDE), in which dichotomous mechanism is fused into the mutation and crossover operations. As the main contribution in DBDE, dichotomous mechanism is learning from the dichotomous thinking of psychology. The primary idea of dichotomous mechanism is that each of the two features (i.e., 0 and 1) after the XOR operation corresponds to two different strategies, the result increases the diversity of population and enhances the exploration ability in the binary search space. Comprehensive experiments have been conducted on a suite of 0-1 knapsack problems and multidimensional knapsack problems to verify the effectiveness and efficiency of the proposed approach.

The rest of the paper is organized as follows. In Section 2, the 0-1 knapsack problems and multidimensional knapsack problems are introduced. Section 3 gives a brief review of the DE algorithm. Our proposed DE variant, called DBDE, is described in Section 4. The analysis of solution quality of DBDE is presented in Section 5. Experimental results and discussions are presented in Section 6. Finally, the work is concluded in Section 7.

2. Knapsack Problems

The knapsack problem is one of typical NP-hard combinatorial optimization problems in operation research, which includes a variety of knapsack problems such as the 0-1 knapsack problems and multidimensional knapsack problems.

2.1. The 0-1 Knapsack Problems

Generally, in an instance of the 0-1 knapsack problem, given a set of items, each item having an integer profit and an integer weight , the task is to maximise the sum of profits of items packed in the knapsack without exceeding a given capacity . Mathematically, the 0-1 knapsack problem can be formulated as follows:where or 0 is used to indicate whether item is included in the knapsack or not. It may be assumed that all profits and weights are positive, and that all weights are smaller than the capacity but the total weight of all items exceeds .

2.2. The 0-1 Multidimensional Knapsack Problems

The 0-1 multidimensional knapsack problem is similar to 0-1 knapsack problem, but where a set of knapsack constraints are satisfied rather than one. Therefore, it is more complex and more difficult to be solved. A comprehensive overview of practical and theoretical results for the 0-1 multidimensional knapsack problem can be found in [10]. The 0-1 multidimensional knapsack problem can be formulated as follows:where is the number of knapsack constraints with maximum capacities.

3. DE Algorithm

Since the emergence of DE algorithm, much effort has been made to improve the performance and these works can be classified into three categories. The first is hybridization with other techniques [2325], the second is modification of the mutation strategy [2628], and the third is adaptation of mutation strategy and parameter settings (i.e., NP, , and CR) [2931]. Additionally, some comparative study has shown that the performance of DE and its variants is better than the PSO variants over a wide variety of problems [16, 32]. As a very competitive form of evolutionary algorithm, DE has been successfully applied to diverse fields such as electrical power systems [33, 34], bioinformatics [35, 36], pattern and recognition, and image processing [37, 38]. Recently, Das et al. [16, 17] presented a comprehensive survey on the state-of-the-art of DE variants, so more information can be referred to it.

DE is a population-based heuristic search algorithm which maintains a population with NP floating-point encoded individuals , where NP is the population size, is the generation number, and each member represents a candidate solution, randomly sampled from the search space. It starts with an initial population and then conducts mutation, crossover, and selection operators to improve its population generation by generation until the preset stopping criterion, that is, target error accuracy level () or maximum number of function evaluates (MaxFEs), is satisfied.

At each generation , DE executes mutation operation firstly. The mutant vector for each individual (or, namely, target vector) will be created by the mutation strategy. The well-known and widely used DE mutation strategies “DE/rand/1” are shown as follows:where , , , and are different indices randomly chosen from the set and all are different from . The control parameter is a scale factor that amplifies the vector difference.

Then, DE commonly conducts binomial crossover operator to recombine the target vector and mutant vector . The trial vector is generated as follows:where , is a randomly selected integer, is a uniformly distributed random number for the th dimension, and the control parameter is the crossover probability.

Finally, the selection operator is used to choose the better one among the target vector and the trial vector in terms of their fitness value to enter the next generation:

To alleviate the classical DE cannot be directly applied to binary-valued optimization problem, many versions of BDE were put forward around the world; especially logical operations were first introduced by He and Han [19] to replace the original operations of the mutation mechanism in DE and the binary mutation equation as follows:where denotes the AND operator, denotes the OR operator, and denotes the XOR operator.

4. Dichotomous Binary Differential Evolution

Dichotomous binary differential evolution (DBDE) as proposed in this paper is based on both binary string representation and the dichotomous mechanism. The details are as follows.

4.1. Dichotomous Mutation

The idea of using logical operations to replace the original operations of the mutation, such as subtraction, multiplication, and addition, was first introduced by He and Han [19]. This approach can evolve the bit string individual directly. However, by using the binary strings, there are only two different codes “0" and “1" in the population; the differential of two individuals on the same location is too negligible to operate the complicated mutation like the real coding individuals. The novel binary mutation mechanism developed in this paper is based on XOR logical operation mainly. As we all know, the bit coded as “0" after the XOR operation represents the common between the two selected bits; otherwise the “1" represents difference. According to the common and difference feature patterns of two randomly selected individuals, dichotomous mutation executes difference operations and the new mutation equation is as follows:where ! denotes the NOT operator. In dichotomous mutation, the scale factor disappeared and we no longer have to worry about its value. If the bits between and are difference, then the mutation value is randomly chosen from “0" or “1"; otherwise, if the bits between and are common, then the mutation value is determined by the value of .

As a simple example, as depicted in Figure 1, two individuals and are randomly selected at generation for th individual to execute the dichotomous mutation. Then a binary string () is produced after the XOR operation of and . On this basis, the mutation binary string is obtained by the dichotomous mutation mechanism. In Figure 1, composes rand, , rand, and on the 1st, 2nd, 3rd, and th location, respectively, in which “rand” represents that the value is randomly chosen from “0" or “1" with equal probability.

4.2. Dichotomous Crossover

The new binary crossover operator, that is, dichotomous crossover, is used to produce the trial individual by mixing the target individual and mutant individual . The trial individual can be obtained according to the following equation:where . The mechanism of dichotomous crossover is similar to the crossover of the original DE, but there exists a main difference between them. That is, dichotomous crossover uses two crossover probabilities, that is, CR1 and CR2, rather than only one CR in classical DE. For th bit of the trial individual, if the bits between and are common, then is equal to CR1; otherwise, if the bits between and are difference, then is equal to CR2.

As demonstrated in Figure 2, the elements of trial individual come from mutate individual and target individual with difference crossover probabilities. From Figure 2, we can find that the decisions of the crossover operation for the 1st, 2nd, 3rd, and th bit of are based on CR1, CR2, CR1, and CR2, respectively.

4.3. DBDE for Knapsack Problems

Handling the constraint in the knapsack problems and considering some empirical results indicate that repair method is the most efficient for the knapsack problems [3, 4]. Thus, only repair method with ratio-greedy manner is used in this paper to tackle the knapsack problem. The steps of the ratio-greedy repair are described in Algorithm 1, in which if the solution is infeasible, we sort the items according to the descending order of the corresponding profit-to-weight ratios firstly and then choose an item with the smallest ratio and remove it from the knapsack, and the program will loop continuously until a feasible one is generated.

Input: Infeasible individual ; Weights of each item ; Capacity of a knapsack
  () while   is infeasible  do
  ()   = ratio-greedily select an item from the knapsack;
  ()  ;
  ()  if    then
  ()   Return ;
  ()  end if
  () end while
Output: Feasible individual

The framework of DBDE for knapsack problem is described in Algorithm 2. Compared to the original DE, there is merely two major differences in the DBDE. One is the using of ratio-greedy repair for the infeasible solution after the new individual generated. Another is that the new dichotomous mutation and dichotomous crossover replace the old one.

Input: Population size, NP; Crossover probability, CR1 and CR2; Maximum number of objective function evaluations, MaxFEs
  ()    Randomly initialize population with NP individuals
  ()    for    do
  ()     if   is an infeasible individual  then
  ()      Execute Algorithm 1 for ratio-greedy repair
  ()     end if
  ()     Evaluate the objective function value
  ()    end for
  ()    FEs = NP
  ()    while  FEs < MaxFEs  do
  ()  for    do
  ()   Randomly select two individuals and from population
  ()   Execute the dichotomous mutation to generate a mutate individual
  ()   Execute the dichotomous crossover to generate a trial individual
  ()   if   is an infeasible individual  then
  ()    Execute Algorithm 1 for ratio-greedy repair
  ()   end if
  ()   Evaluate the objective function value
  ()   if    then
  ()    
  ()   end if
  ()  end for
  ()  FEs = FEs + NP
  () end while
Output: Optimal individual with the maximum profit value

5. Analysis of Solution Quality of DBDE

In this section, we analyze the solution quality of DBDE on the 0-1 knapsack problem in terms of the approximation ratio [39, 41]. In DBDE, the dichotomous mutation, dichotomous crossover, and selection are performed one by one at each generation to guide the population to the global optimum. From the demonstration of truth table in Table 1, we can observe that the probabilities of bit “1" and bit “0" generated by dichotomous mutation are equal to 0.5. Meanwhile, based on dichotomous crossover probabilities CR1 and CR2 the mutant bit will be accepted as a trial bit in the trial vector and the probabilities of using CR1 and CR2 are equal to 0.5. Thus, dichotomous mutation and crossover flip bit from “0" to “1" with a probability and the same as from “1" to “0". For the purposes of simplification, let .

Theorem 1. For any constant , the DBDE needs running time to find -approximation solution in the worst case.

Proof. According to the definition of an evolutionary approximation algorithm (see [41] for a detailed exposition), it suffices to consider the instance of the 0-1 knapsack problem, which is described in Table 2. In Table 2, is a large positive integer for a sufficiently large . As seen, the global optimum for the instance is , and the global optimum is unique. A local optimum isNotice that the local optimum is the second largest objective function value among feasible solution. The ratio of fitness between the local optimum and the global optimum isSuppose that the DBDE starts at the local optimum . For the individual , the dichotomous mutation and crossover operators are conducted and a trial vector is generated. At the same time, the greedy selection operator with the ratio-greedy repair will prevent from entering into the next generation unless the trial vector is the global optimum itself. Thus, the event happens only if the first bit of is flipped from to and one-valued bits are flipped into zero-valued ones while other zero-valued bits remain unchanged. The probability of this event isFrom the above analysis, we now deduce that the expected runtime to reach the global optimum is . The required conclusion is proven.

6. Experimental Study

6.1. Experimental Setting

Two types of knapsack problems, that is, 0-1 knapsack and multidimensional knapsack problems, are used in the following experimental studies to extensively investigate the performance of the proposed DBDE algorithm. Meanwhile, DBDE compares with five other state-of-the-art binary evolutionary algorithms, including three binary DE variants, that is, BLDE [22], BinDE [20], and AQDE [7], and two binary PSO variants, that is, BPSO [40] and MBPSO [6]. For all the contestant algorithms, the control parameter settings are the same as their original literature, but the MaxFEs is set to and for fairness consideration. The parameters are used in DBDE, that is, and . The details of the control parameters of these contestant algorithms are summarized in Table 3.

All the experiments are done on a computer with 2.8 GHz Dual-core Processor and 4 GB RAM under Windows 7 platform and all algorithms are implemented in Matlab 2010b. Thirty independent runs are carried out for each algorithm on each instance. The best results are shown in boldface. In order to have statistically sound conclusions, Wilcoxon’s rank sum test at a 0.05 significance level is conducted on the experimental results.

6.2. 0-1 Knapsack Problem

A suite of twenty randomly generated 0-1 knapsack problems is used to verify the efficacy of DBDE. An algorithm for generating the instances is available from http://www.diku.dk/~pisinger/generator.c. The detailed descriptions of these instances are summarized in Table 4. The optimum solutions of these instances are not known. These instances can be divided into four groups, including uncorrelated, weakly correlated, strongly correlated, and subset-sum data instances. In all instances, the weights are randomly distributed in . The profits are expressed as a function of the weights , yielding the specific properties of each group and as follows: () uncorrelated data instances—the profits are randomly chosen in , there is no correlation between the profit and the weight of an item; () weakly correlated data instances— randomly distributed in [, ] such that . Despite their name, weakly correlated instances have a very high correlation between the profit and weight of an item. Typically, the profit differs from the weight by only a few percent; () strongly correlated data instances—profits are set to ; and () subset-sum data instances—the profit of each item is equal to the weight, that is, . The number of items is set to 100, 200, 300, 500, and 1000, respectively, to test the algorithms with different problem scales. Moreover, the used 0-1 knapsack instances in this paper are available at https://github.com/whuph/KP_data, so that readers are able to test these instances in their algorithms.

Table 5 presents the mean maximum profit achieved by DBDE and other five competitive algorithms over 30 runs on each 0-1 knapsack instance. At the bottom of the table, Wilcoxon’s rank sum test results between DBDE and others are summarized as “”, which means that DBDE wins in functions, ties in functions, and loses in functions. Based on the results, our algorithm achieves better results than others on the majority of test instances. However, on the subset-sum data instances all of the competitors get the same results. Because subset-sum instances are generally easy to solve, the maximum sum of weight indicates the optimal solution. A statistical view in terms of Wilcoxon’s rank sum test in the last line of Table 5 is more appropriate to see the superiority of DBDE over other five competitors. We observe from that DBDE is significantly better than BPSO, MBPSO, BLDE, BinDE, and AQDE on 7, 13, 15, 15, and 12 test instances, respectively, but only worse than BPSO and AQDE on 2 and 1 test instances, respectively. Figure 3 shows the convergence curves of the six contestant algorithms on nine representative 0-1 knapsack instances.

Apart from the above analysis, one may come up with a question: what are the differences of computational cost between DBDE and other competitive algorithms on 0-1 knapsack problems? In order to respond to this, beside the maximum profit results, the runtime was also recorded to compare the computational cost of six algorithms on the test suite. Each algorithm is run 30 times per test instance and the mean runtime is recorded. Table 6 presents the statistical results of runtime. At the bottom of the table, the total runtime on all test instances is summarized.

From Table 6, we can see that the runtime of DBDE is higher than BinDE, but this difference is slight. In addition to this, DBDE is significant faster than BPSO, MBPSO, BLDE, and AQDE. The possible reasons are as follows. First, as pointed out in Algorithm 2, the DBDE almost have any difference with classical DE and no additional module or computation has been introduced. Second, to benefit from dichotomous mutation and crossover, the rate of producing feasible individuals is much higher than other competitors. So the computation cost of repairing infeasible individual is less than others. Taking into account these experiments and analyses, we can conclude that DBDE is effective and efficient for 0-1 knapsack problems.

6.3. Multidimensional Knapsack Problem

Three groups of well-known multidimensional knapsack instances selected from OR-library [42] are used in the experimental studies to verify the performance of DBDE. The detailed descriptions of these multidimensional knapsack instances are summarized in Table 7. The optimum solutions of these instances are known. The first group with 2 multidimensional knapsack instances corresponds to “sento” [43], which is characterized by large constraints and the number of constraints is 30. In contrast to the first group, the second group with 8 multidimensional knapsack instances corresponds to “weing” [44], which is characterized by small constraints. The last group with 30 multidimensional knapsack instances corresponds to “weish” [45], which is a moderate test suit. Among the “weish” multidimensional knapsack instances, the number of constraints is 5 and the number of items ranges between 20 and 90. The used parameters are the same as in Section 6.1. The results of the mean maximum profit achieved by the DBDE and other competitors are presented in Table 8, where “” summarizes the competition results between DBDE and others algorithms.

From Table 9, it can be seen from the boldface that DBDE achieves best results among the six contestants on 34 out of 40 test instances. Meanwhile, based on Wilcoxon’s rank sum test results, DBDE is significantly better than BPSO, MBPSO, BLDE, BinDE, and AQDE on 22, 32, 23, 38, and 38 test instances, respectively, but BPSO, MBPSO, BLDE, BinDE, and AQDE beat DBDE on 4, 2, 2, 0, and 0 test instances, respectively. Overall, the performance of DBDE on the multidimensional knapsack instances is better than that of the five competitors.

In order to compare the convergence rate of different algorithms, the mean number of FEs required to converge to the optimum solution (MFEs) and the successful rate (SR) are recorded in Table 9. The stopping criterion is that each algorithm is terminated when the optimum solution is found or the number of FEs reaches to its maximum value (). As seen, it is clear that DBDE is more reliable than other competitors as successful rate (SR) for DBDE reaches 100 on 22 multidimensional knapsack instances out of 40. Figure 4 shows the average successful rates of the six contestant algorithms on the multidimensional knapsack problems.

Moreover, DBDE shows faster convergence speed on the majority of multidimensional knapsack instances. Although, from Table 9, the MFEs of Weing1, Weing4, Weish1, Weish3, Weish4, Weish5, Weish6, Weish8, Weish9, Weish17, Weish18, Weish23, Weish24, Weish26, Weish27, and Weish29 achieved by DBDE are not the best, but DBDE exhibits the best SR on this test multidimensional knapsack instances among the six algorithms. From the last row of Table 9, DBDE costs the lowest average MFEs to reach the threshold and gets the highest average SR. Therefore, the above experimental results and analysis verify the superior performance of DBDE on multidimensional knapsack problem.

6.4. Validity of Population Size and Crossover Probability Settings

In order to investigate the validity of population size (NP) and crossover probability (CR1 and CR2) settings on the performance of DBDE, three scalable tests of DBDE have been carried out on the multidimensional knapsack problems with different NP, CR1, and CR2 values. The test suit of multidimensional knapsack problem is the same as Section 6.3 used. The experimental results of DBDE with different NP, CR1, and CR2 values are summarized in Tables 10, 11, and 12, respectively.

In the case of different NP values, experiments have been done on , 100, 150, and . It is clear from Table 10 that the performance of is significantly better than that of others. When , DBDE achieved best SR results (boldface). These observations demonstrate that is efficient and suitable.

As shown in Table 11, for the CR1 test, CR1 is set to 0.1, 0.2, 0.3, 0.4, and 0.5. By carefully examining the results, we find that value 0.2 gets best results. Therefore, on the whole, CR1 = 0.2 is the best choice for DBDE. In similar circumstances, observed from Table 12, CR2 = 0.5 also is the best option for DBDE.

7. Conclusion

DE is a powerful population-based random optimization algorithm. However, its operators are based on floating-point representation only and are not suitable for the combinational optimization problems. In order to solve these problems, a novel binary DE with dichotomous mechanism (DBDE) is proposed, in which dichotomous mutation and dichotomous crossover are employed to enhance the exploration ability of DE in the binary search space. Dichotomous mechanism is learned from the dichotomous thinking of psychology. The primary idea of dichotomous mechanism is that each of the two features (i.e., 0 and 1) after the XOR operation corresponds to two different strategies. Compared with the classical DE, DBDE almost has any difference and no additional computation. Moreover, we analyze the solution quality of DBDE on the 0-1 knapsack problem in terms of the approximation ratio and conclude that the expected runtime of DBDE to reach the global optimum is .

The experimental studies in this paper are performed on a suite of 0-1 knapsack problems and multidimensional knapsack problems. The quality of DBDE is verified by comparing with three start-of-the-art binary DE variants (i.e., BLDE, BinDE, and AQDE) and two binary PSO variants (i.e., BPSO and MBPSO) and the results show that DHDE is the best among the six algorithms. On the 0-1 knapsack problems, DBDE is significantly better than BPSO, MBPSO, BLDE, BinDE, and AQDE on 7, 13, 15, 15, and 12 test instances, respectively, but only worse than BPSO and AQDE on 2 and 1 test instances, respectively. On the 0-1 multidimensional knapsack problems, DBDE achieves best results among the six contestants on 34 out of 40 test instances. Furthermore, DBDE costs the lowest average MFEs to reach the threshold and gets the highest average SR. For the computational cost, DBDE is significant faster than BPSO, MBPSO, BLDE, and AQDE but slightly higher than BinDE. In addition, the effect of the population size (NP) and crossover probability settings (CR1 and CR2) are experimentally studied.

The DBDE can effectively improve the performance of DE on knapsack problems, so it may also work well on other combinatorial optimization problems, such as traveling salesman problem and inventory routing problem. In the future, how to generalize our work to solve other combinational optimization problems remains an attractive topic. Additionally, Local Search (LS) is a technique that guides the search to the most promising solution area, and the hybridization of DBDE with other LS methods can be attempted to further enhancing performance.

Competing Interests

The authors declare that they have no competing interests.

Acknowledgments

This work is supported by the National Natural Science Foundation of China (no. 61364025, no. 61662029), the Foundation of State Key Laboratory of Software Engineering (no. SKLSE2012-09-39), and the Science and Technology Foundation of Jiangxi Province, China (no. GJJ13729) as well.