Elsevier

Applied Soft Computing

Volume 11, Issue 2, March 2011, Pages 1556-1564
Applied Soft Computing

Review Article
Solving 0–1 knapsack problem by a novel global harmony search algorithm

https://doi.org/10.1016/j.asoc.2010.07.019Get rights and content

Abstract

This paper proposes a novel global harmony search algorithm (NGHS) to solve 0–1 knapsack problems. The proposed algorithm includes two important operations: position updating and genetic mutation with a small probability. The former enables the worst harmony of harmony memory to move to the global best harmony rapidly in each iteration, and the latter can effectively prevent the NGHS from trapping into the local optimum. Computational experiments with a set of large-scale instances show that the NGHS can be an efficient alternative for solving 0–1 knapsack problems.

Introduction

The knapsack problem is one of the classical NP-hard problems and it has been thoroughly studied in the last few decades. It offers many practical applications in many areas, such as project selection [1], resource distribution, investment decision-making and so on. Given N objects, where the j th object owns its weight wj and profit pj, and a knapsack that can hold a limited weight capability C, the goal of this problem is to pack the knapsack so that the objects in it have the maximal value among all possible ways the knapsack can be packed. Mathematically, the 0–1 knapsack problem can be described as follows:Maximizef(x)=j=1Npjxjs.t.j=1NwjxjCxj=0 or 1,j=1,2,,N

The binary decision variables xj are used to indicate whether item j 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 C.

In recent decades, many heuristic algorithms have been employed to solve 0–1 knapsack problems: Shi modified the parameters of the ant colony optimization (ACO) model to adapt itself to 0–1 knapsack problems [2]. The improved ACO has strong capability of escaping from the local optimum through artificial interference of tabuk; Liu and Liu proposed a schema-guiding evolutionary algorithm (SGEA) to solve 0–1 knapsack problems [3]. For the SGEA, there are mainly two improvements: first, it proposes a schema-modified operator to adjust the distribution of the population; second, it constructs an elite-schema space and utilizes the cluster-center schema to guide the direction of individual’s evolution. The two improvements not only can improve the diversity of the population, but also enhance the capability of the local search and the global search for the SGEA. Lin used genetic algorithm to solve knapsack problem with imprecise weight [4], and he investigated the possibility of using genetic algorithms in solving the fuzzy knapsack problem without defining membership functions for each imprecise weight coefficient. The approach proposed by Lin simulates a fuzzy number by distributing it into some partition points. Lin used genetic algorithms to evolve the values in each partition point so that the final values represent the membership grade of a fuzzy number. Li proposed a binary particle swarm optimization based on multi-mutation strategy (MMBPSO) to solve knapsack problem [5]. The MMBPSO can effectively escape from the local optima to avoid premature convergence due to the utilization of Multi-Mutation strategy. Moreover, this algorithm uses two methods called greedy transform algorithm and penalty function method to produce the best outcomes for constraint handling, respectively. Although many 0–1 knapsack problems have been solved successfully by these methods, the research on them is still important, because some new and more difficult 0–1 knapsack problems hidden in the real world have not been solved. Many algorithms provide possible solutions for some 0–1 knapsack problems, but they may lose their efficiency on solving these problems due to their own disadvantages and limitations. For example, some methods proposed recently only solve 0–1 knapsack problems with very low dimension, but they may be unavailable to solve 0–1 knapsack problems with high dimension sizes. Harmony search algorithm [6] is a recently developed heuristic algorithm which is inspired by the phenomenon of musician attuning. The HS and its improved algorithms have been applied to many engineering optimization problems, but they have never been used to solve 0–1 knapsack problems. Further more, the HS cannot be directly applied to some difficult engineering optimization problems due to its poor convergence, thus it should be improved significantly.

Given the above consideration, a novel global harmony search algorithm (NGHS) is proposed to solve the 0–1 knapsack problems. The NGHS is inspired by the swarm intelligence of particle swarm optimization (PSO) [7]. Two important factors including adaptive step and trust region are defined in the NGHS. Based on the two factors, a novel position updating equation is designed to make the worst solution of the harmony memory move to the global best solution in each iteration. Genetic mutation operation with a low probability is carried out for the worst solution after updating position, for it can prevent the NGHS from being trapped into the local optimum. Based on a large number of experiments, the proposed algorithm has demonstrated promising performance on solving 0–1 knapsack problems, and it can find the required optima in some cases when the problem to be solved is too complicated and complex.

The remainder of the paper is organized as follows. In Section 2, three harmony search algorithms are introduced, and the procedures are also given. Especially, a novel global harmony search algorithm (NGHS) is mainly introduced, and the procedure of the NGHS is described adequately in this section. In Section 3, some preparation work is considered for using the NGHS to solve 0–1 knapsack problems. In Section 4, a series of experiments are carried out to test the optimization performance of the NGHS for knapsack problems. Some conclusions and comments are made for further research in Section 5.

Section snippets

Three harmony search algorithms

This section mainly describes the application of the NGHS to knapsack problems. Before describing the NGHS, two other harmony search algorithms are introduced adequately to further understand the NGHS. First, a brief overview of the HS is provided. Second, the proposed improved harmony search (IHS) algorithm is summarized. Finally, the modification procedures of the proposed NGHS algorithm are introduced to solve 0–1 knapsack problems.

Constrained optimization

There is a big difference between unconstrained optimization problems and constrained ones. For a unconstrained optimization problem, its global best solution is the one who has the minimum objective function value. In the mean time, the global best solution vector of constrained optimization problem is hard to determine and measure, for it is difficult to find a balance between the constraints and the objective function value. A penalty function method has been used for handling constrained

Experimental results and analysis

In this section, the performance of the NGHS algorithm is extensively investigated by a large number of experimental studies. Eighteen 0–1 knapsack programming problems are considered to testify the validity of the NGHS. All computational experiments are conducted with Matlab7.0.

Conclusions

In this paper, the performance of the NGHS has been extensively investigated by using a large number of experimental studies. The experimental results show that the NGHS has demonstrated strong convergence and stability for 0–1 knapsack problems due to the utilization of the position updating equation. The results also reveal that the NGHS has strong capacity of preventing premature convergence of the NGHS throughout the whole iteration due to the utilization of the genetic mutation. The

Acknowledgments

This work was supported by National Science Foundation of P.R. China under Grants 60674021.

References (15)

There are more references available in the full text version of this article.

Cited by (0)

View full text