An Effective Hybrid Cuckoo Search Algorithm with Improved Shuffled Frog Leaping Algorithm for 0-1 Knapsack Problems

An effective hybrid cuckoo search algorithm (CS) with improved shuffled frog-leaping algorithm (ISFLA) is put forward for solving 0-1 knapsack problem. First of all, with the framework of SFLA, an improved frog-leap operator is designed with the effect of the global optimal information on the frog leaping and information exchange between frog individuals combined with genetic mutation with a small probability. Subsequently, in order to improve the convergence speed and enhance the exploitation ability, a novel CS model is proposed with considering the specific advantages of Lévy flights and frog-leap operator. Furthermore, the greedy transform method is used to repair the infeasible solution and optimize the feasible solution. Finally, numerical simulations are carried out on six different types of 0-1 knapsack instances, and the comparative results have shown the effectiveness of the proposed algorithm and its ability to achieve good quality solutions, which outperforms the binary cuckoo search, the binary differential evolution, and the genetic algorithm.

In 2003, Eusuff and Lansey firstly proposed a novel metaheuristic optimization method: SFLA, which mimics a group of frogs to search for the location that has the maximum amount of available food. Due to the distinguished benefit of its fast convergence speed, SFLA has been successfully applied to handle many complicated optimization problems, such as water resource distribution [29], function optimization [30], and resource-constrained project scheduling problem [31].
CS, a nature-inspired metaheuristic algorithm, is originally proposed by Yang and Deb in 2009 [32], which showed some promising efficiency for global optimization. Owing to the outstanding characteristics such as fewer parameters, easy implementation, and rapid convergence, it is becoming a new research hotspot in swarm intelligence. Gandomi et al. [33] first verified structural engineering optimization problems with CS algorithm. Walton et al. [34] proposed an improved cuckoo search algorithm which involved the addition of information exchange between the best solutions and tested their performance with a set of benchmark functions. Recently, the hybrid algorithms that combined CS with other 2 Computational Intelligence and Neuroscience methods have been proposed and have become a hot topic studied by people, such as CS combined with a fuzzy system [35], a DE [36], wind driven optimization (WDO) [37], artificial neural network (ANN) [38], and genetic algorithm (GA) [39]. For details, see [40].
In 2011, Layeb [25] developed a variant of cuckoo search in combination with quantum-based approach to solve knapsack problems efficiently. Subsequently, Gherboudj et al. [24] utilized purely binary cuckoo search to tackle knapsack problems. A few scholars consider binary-coded CS and its performance need to further improve so as to further expand its fields of application. In addition, despite successful application to the solution of 0-1 knapsack problem by many methods, in fact, it is still a very active research area, because many existing algorithms do not cope well with some new and more intractable 0-1 knapsack problems hidden in the real world. Further, most of recently proposed algorithms focused on solving 0-1 knapsack problems with low dimension and medium dimension, but 0-1 knapsack problems with high dimension are involved little and the results are not highly satisfactory. What is more, the correlation between the weight and the value of the items may not be more concerned. This necessitates new techniques to be developed. Therefore, in this work, we propose a hybrid CS algorithm with improved SFLA (CSISFLA) for solving 0-1 knapsack problem. To verify effectiveness of our proposed method, a large number of experiments on 0-1 knapsack problem are conducted and the experimental results show that the proposed hybrid metaheuristic method can reach the required optima more effectively than CS, DE, and GA even in some cases when the problem to be solved is too complicated and complex.
The rest of the paper is organized as follows. Section 2 introduces the preliminary knowledge of CS, SFLA algorithm, and the mathematical model of 0-1 KP problem. Then, our proposed CSISFLA for 0-1 KP problems is presented in Section 3. A series of simulation experiments are conducted in Section 4. Some conclusions and comments are made for further research in Section 5.

Review of the Related Work
In this section, the model of 0-1 knapsack problem and the basic CS and SFLA are introduced briefly.
2.1. 0-1 Knapsack Problem. The 0-1 knapsack problem, denoted by KP, is a classical optimization problem and it has high theoretical and practical value. Many practical applications can be formulated as a KP, such as cutting stock problems, portfolio optimization, scheduling problems, and cryptography. This problem has been proven to be a NP-hard problem; hence, it cannot be solved in a polynomial time unless = [44]. The 0-1 knapsack problem can be stated as follows: where is the number of items; and represent the weight and profit of item j, respectively. The objective is to select some items so that the total weight does not exceed a given capacity c, while the total profit is maximized. The binary decision variable , with = 1 if item is selected, and = 0 otherwise is used.

Cuckoo
Search. CS is a relatively new metaheuristic algorithm for solving global optimization problems, which is based on the obligate brood parasitic behavior of some cuckoo species. In addition, this algorithm is enhanced by the so-called Lévy flights rather than by simple isotropic random walks.
For simplicity, Yang and Deb used the following three approximate rules [32,45]: (1) each cuckoo lays only one egg at a time and dumps its egg in a randomly chosen nest; (2) the best nests with high-quality eggs will be carried over to the next generations; (3) the number of available host nests is fixed, and the egg laid by the host bird with a probability ∈ [0, 1]. In this case, the host bird can either throw the egg away or simply abandon the nest and build a completely new nest.
The last assumption can be approximated by a fraction of the host nests which are replaced by new nests (with new random solutions).
New solution X ( +1) is generated as (2) by using a Lévy flight [32]. Lévy flights essentially provide a random walk while their random steps followed a Lévy distribution for large steps which has an infinite variance with an infinite mean. Here the steps essentially form a random walk process with a power-law step-length distribution with a heavy tail as (3): where > 0 is the step size scaling factor. Generally, we take = (1). The product ⊕ means entry-wise multiplications.

Shuffled Frog-Leaping Algorithm.
The SFLA is a metaheuristic optimization method that imitates the memetic evolution of a group of frogs while casting about for the location that has the maximum amount of available food [46]. SFLA, originally developed by Eusuff and Lansey in 2003, can be applied to handle many complicated optimization problems. In virtue of the beneficial combination of the genetic-based memetic algorithm (MA) and the social behavior-based PSO algorithm, the SFLA has the advantages of global information exchange and local fine search. In SFLA, all virtual frogs are assigned to disjoint subsets of the whole population called memeplex. The different memeplexes are regarded as different cultures of frogs and independently perform local search. The individual frogs in each memeplex have ideas that can be effected by the ideas of other frogs and evolve by means of memetic evolution. After a defined number of memetic evolution steps, ideas are transferred among memeplexes in a shuffling process. The local search and the shuffling processes continue until defined convergence criteria are satisfied [47].
In the SFLA, the initial population is partitioned into memeplexes, each containing frogs ( = × ). In this process, the th goes to the jth memeplex where = mod M (memeplex numbered from 0). The procedure of evolution of individual frogs contains three frog leapings. The position update is as follows.
Firstly, the new position of the frog individual is calculated by If the new position is better than the original position , replace with ; else, another new position of this frog will perform in which the global optimal individual replaces the best individual of kth memeplex with the following leaping step size: If nonimprovement becomes possible in this case, the new frog is replaced by a randomly generated frog; else replace with Y: Here, Y is an update of frog's position in one leap. 1 , 2 , and 3 are random numbers uniformly distributed in [0, 1]. and are the best and the worst individual of the kth memeplex, respectively. is the best individual in the whole population. U, L is the maximum and minimum allowed change of frog's position in one leap.

Hybrid CS with ISFLA for 0-1 Knapsack Problems
In this section, we will propose a hybrid metaheuristic algorithm integrating cuckoo search and improved shuffled frog-leaping algorithm (CSISFLA) for solving 0-1 knapsack problem. First, the hybrid encoding scheme and repair operator will be introduced. And then improved frog-leaping algorithm along with the framework of proposed CSISFLA will be presented.

Encoding Scheme.
As far as we know, the standard CS algorithm can solve the optimization problems in continuous space. Additionally, the operation of the original CS algorithm is closed to the set of real number, but it does not have the closure property in the binary set {0, 1}. Based on Table 1: Representation of population in CSISFLA.
above analysis, we utilize hybrid encoding scheme [26] and each cuckoo individual is represented by two tuples ⟨ , ⟩ ( = 1, 2, . . . , ), where works in the auxiliary search space and performs in the solution space accordingly and is the dimensionality of solution. Further, Sigmoid function is adopted to transform a real-coded vector X = ( 1 , 2 , . . . , ) T ∈ [−3.0, 3.0] to binary vector B = ( 1 , 2 , . . . , ) T ∈ {0, 1} . The procedure works as follows: where The encoding scheme of the population is depicted in Table 1.

Repair Operator.
After evolving a generation, the feasibility of all the generated solutions is taken into consideration. That is, to say, the individuals could be illegal because of violating the constraint conditions. Therefore, a repair procedure is essential to construct illegal individuals. In this paper, an effective greedy transform method (GTM) is introduced to solve this problem [26,48]. It cannot only effectively repair the infeasible solution but also can optimize the feasible solution.
This GTM consists of two phases. The first phase, called repairing phase (RP), checks each solution in order of decreasing / and confirms the variable value of one as long as feasibility is not violated. The second phase, called optimizing phase (OP), changes the remaining variable from zero to one until the feasibility is violated. The primary aim of the OP is to transform an abnormal chromosome coding into a normal chromosome, while the RP is to achieve the best chromosome coding.

Improved Shuffled Frog-Leaping Algorithm.
In the evolution of SFLA, new individual is only affected by local optimal individual and the global optimal during the first two frog leapings, respectively. That is to say, there is a lack of information exchange between individuals and memeplexes. In addition, the use of the worst individual is not conducive to quickly obtain the better individuals and quick convergence. When the quality of the solution has not been improved after the first two frog leapings, the SFLA randomly generates a new individual without restriction to replace original individual, which will result in the loss of some valuable information of the superior individual to some extent. Therefore, in order to make up for the defect of the SFLA, an improved shuffled frog-leaping algorithm (ISFLA) is carefully designed and then embedded in the CSISFLA. Compared with SFLA, there are three main improvements.

Computational Intelligence and Neuroscience
The first slight improvement is that we get rid of sorting of the items according to the fitness value which will decrease in time cost.
The second improvement is that we adopt a new frog individual position update formula instead of the first two frog leapings. The idea is inspired by the DE/Best/1/Bin in DE algorithm. Similarly, each frog individual is represented as a solution X and then the new solution is given by where is the current global best solution found so far. is the best solution of the kth memeplex. 1 is an individual of random selection with index of 1 ̸ = and 2 is random number uniformly distributed in [0, 1]. In particular the plus or minus signs are selected with certain probability. The main purpose of improvement in (8) is to quicken convergence rate.
The third improvement is to randomly generate new individuals with certain probability instead of unconditional generating new individuals, which takes into consideration the retention of the better individuals in the population.
The main step of ISFLA is given in Algorithm 1. In Algorithm 1, P is the size of the population. M is the number of memeplex. D is the dimension of decision variables. And 1 is a random real number uniformly distributed in (0, 1). And 2 , 3 , 4 , and are all D-dimensional random vectors and each dimension is uniformly distributed in (0, 1). In particular, is called probability of mutation which controls the probability of individual random initialization.

The Frame of CSISFLA.
In this section, we will demonstrate how we combine the well-designed ISFLA with Lévy flights to form an effective CSISFLA. The proposed algorithm does not change the main search mechanism of CS and SFLA. In the iterative process of the whole population, Lévy flights are firstly performed and then frog-leaping operator is adopted in each memeplex. Therefore, the strong exploration abilities in global area of the original CS and the exploitation abilities in local region of ISFLA can be fully developed. The CSISFLA architecture is explained in Figure 1.

CSISFLA Algorithm for 0-1 Knapsack Problems.
Through the design above carefully, the pseudocode of CSISFLA for 0-1 knapsack problems is described as follows (see Algorithm 2). It can be analyzed that there are essentially three main processes besides the initialization process. Firstly, Lévy flights are executed to get a cuckoo randomly or generate a solution. The random walk via Lévy flights is much more efficient in exploring the search space owing to its longer step length. In addition, some of the new solutions are generated by Lévy flights around the best solution, which can speed up the local search. Then ISFLA is performed in order to exploit the local area efficiently. Here, we regard the frog-leaping process as the process of cuckoo laying egg in a nest. The new nest generated with a probability is far enough from the current best solution, which enables CSISFLA to avoid being trapped into local optimum. Finally, when an infeasible solution is generated, a repair procedure is adopted to keep feasibility and, moreover, optimize the feasible solution. Since the algorithm can well balance the exploitation and exploration, it expects to obtain solutions with satisfactory quality.
3.6. Algorithm Complexity. CSISFLA is composed of three stages: the sorting by value-to-weight ratio, the initialization, and the iterative search. The quick sorting has time complexity ( log ( )). The generation of the initial cuckoo nests has time complexity ( × ). The iterative search consists of four steps (comment statements in Algorithm 2), and so forth, the Lévy flight, the first frog leaping, generate new individual and random selection which costs the same time ( ). In summary, the overall complexity of the proposed CSISFLA is ( log ( )) + ( × ) + ( ) = ( log ( )) + ( × ). It does not change compared with the original CS algorithm.

Experimental Data Set.
In existent researching files, cases studies and research of knapsack problems are about small-scale to moderate-scale problems. However, in realworld applications, problems are typically large-scale with thousands or even millions of design variables. In addition, the complexity of KP problem is greatly affected by the correlation between profits and weights [49][50][51]. However, few scholars pay close attention to the correlation between the weight and the value of the items. To test the validity of the algorithm for different types of instances, we adopt uncorrelated, weakly correlated, strongly correlated, multiple strongly correlated, profit ceiling, and circle data sets with different dimension. The problems are described as follows: (i) uncorrelated instances: the weights and the profits are random integers uniformly distributed in [10, 100]; (ii) weakly correlated instances: the weights are random integers uniformly distributed in [10,100], and the profits are random integer uniformly distributed in [ − 10, + 10]; (iii) strongly correlated instances: the weights are random integers uniformly distributed in [10,100] and the profits are set to + 10; (iv) multiple strongly correlated instances: the weights are randomly distributed in [10,100]. If the weight is divisible by 6, then we set the = +30 otherwise set it to = + 20; (v) profit ceiling instances: the weights are randomly distributed in [10,100]  For = 1 to do = mod select uniform randomly 1

End if End if End for End
Algorithm 1: Improved shuffled frog-leaping algorithm.

Repair the illegal individuals and optimize the legal individuals by performing GTM method
End for Keep best solutions. Rank the solutions in descending order and find the current best (Y best , (Y best )).

Step 4. Shuffle all the memeplexes
Step 5. End while End.

The Selection on the Value of and N.
The CSISFLA has some control parameters that affect its performance. In our experiments, we investigate thoroughly the number of subgroups and the number of individuals in each subgroup . The below three test instances are used to study the effect of and on the performance of the proposed algorithm. Firstly, M is set to 2, and then three levels of 10, 15, and 20 are considered for N (accordingly, the size of population is 2 × 10, 2 × 15, and 2 × 20). Secondly, a fixed individual number of each subgroup is 10, and the value of is 2, 3, and 4, respectively. Results are summarized in Table 3.
As expected, with the increase of the individual number in the population, it is an inevitable consequence that there are more opportunities to obtain the optimal solution. This issue can be indicated by bold data in Table 3. In order to get a reasonable quality under the condition of inexpensive computational costs, we use = 10 and = 4 in the rest experiments.

The Selection on the Value of .
In this subsection, the effect of on the performance of the CSISFLA is carefully investigated. We select two uncorrelated instances (KP 1 , KP 2 ) and two weakly correlated instances (KP 8 , KP 9 ) as the test instances for parameter setting experiment of . For each instance, every test is run 30 times. We use = 10, = 4, and the maximum time of iterations is set to 5 seconds. Table 4 gives the optimization results of the CSISFLA using different values for .
From the results of Table 4, it is not difficult to observe that the probability of mutation with 0.05 ≤ ≤ 0.4 is more suitable for all test instances which can be seen from data in bold in Table 3. In addition, the optimal solution dwindles steadily with the change of from 0.5 to 1.0 and the worst results of four evaluation criteria are obtained when = 1. Similarly, the performance of the CSISFLA is also poor when is 0. As we have expected, 0 means that the position update in memeplex is completed entirely by the first Leapfrog, which cannot effectively ensure the diversity of the entire population, leading to the CSISFLA more easily fall into the local optimum, and 1 means that new individuals randomly generated without any restrictions which results in 8 Computational Intelligence and Neuroscience slow convergence. Generally speaking, using a small value of is beneficial to strengthen the convergence ability and stability of the CSISFLA. The performance of the algorithm is the best when = 0.15, so we will set = 0.15 for the following experiments.

Experimental Setup and Parameters Setting.
In this paper, in order to test the optimization ability of CSISFLA and further investigate effectiveness of the algorithms for different types of instance, we adopt a set of 34 knapsack problems (KP 1 -KP 34 ). We compared the performance of CSISFLA with (a) GA, (b) DE, and (c) classical CS. In the experiments, the parameters setting are shown in Table 5.
In order to make a fair comparison, all computational experiments are conducted with Visual C++ 6.0. The test environment is set up on a PC with AMD Athlon(tm) II X2 250 Processor 3.01 GHz, 1.75 G RAM, running on Windows XP. The experiment on each instance was repeated 30 times independently. Further, best solution, worst solution, mean, median, and standard deviation (STD) for all the solutions are given in related tables. In addition, the maximum runtime was set to 5 seconds for the instances with dimension less than 500, and it was set to 8 seconds for other instances.

The Experimental Results and Analysis.
We do experiment on 7 uncorrelated instances, 7 weakly correlated instances, and 5 other types of instances, respectively. The numerical results are given in Tables 6-11. The best values are emphasized in boldface. In addition, comparisons of the best profits obtained from the CSISFLA with those obtained from GA, DE, and CS for six KP instances with 1200 items are shown in Figures 8,9,10,11,12,and 13. Specifically, the convergence curves of four algorithms on six KP instances with 1200 items are also drawn in Figures 14,15,16,17,18,and 19. Through our careful observation, it can be analyzed as follows.
(a) Table 6 shows that CSISFLA outperforms GA, DE, and CS on almost all the uncorrelated knapsack instances in terms of computation accuracy and robustness. In particular, the best solution found by CSISFLA is slightly inferior to that obtained by DE on KP 3 . On closer inspection, "STD" is much smaller than that of the other algorithms except for KP 7 , which indicates the good stability of the CSISFLA and superior approximation ability. Based on previous analyses, we can draw a conclusion that the superiority of CSISFLA over GA, DE, and CS in solving six types of KP instances is quite indubitable. In general, CS is slightly inferior to CSISFLA, so the next best is CS. DE and GA perform the third-best and the fourth-best, respectively.

Conclusions
In this paper, we proposed a novel hybrid cuckoo search algorithm with improved shuffled frog-leaping algorithm, called CSISFLA, for solving 0-1 knapsack problems. Compared with the basic CS algorithm, the improvement of CSISFLA has several advantages. First, we specially designed an improved frog-leap operator, which not only retains the effect of the global optimal information on the frog leaping but also strengthens information exchange between frog individuals. Additionally, new individuals randomly generated with mutation rate. Second, we presented a novel                      compared with ICS [26], the CSISFLA can be regarded as a combination of several algorithms and secondly the KP instances are more complex. The future work is to design more effective CS method for solving complex 0-1 KP and to apply the hybrid CS for solving other kinds of combinatorial optimization problems, multidimensional knapsack problem (MKP), and traveling salesman problem (TSP).