Applied Soft Computing 13 (2013) 1774–1780
Contents lists available at SciVerse ScienceDirect
Applied Soft Computing
j ourna l ho me p age: www.elsevier.com/l ocate/asoc
Chemical reaction optimization with greedy strategy for the 0–1
knapsack problem
Tung Khac Truong
a,b
, Kenli Li
a,∗
, Yuming Xu
a
a
College of Information Science and Engineering, Hunan University, National Supercomputing Center in Changsha, 410082, China
b
Faculty of Information Technology, Industrial university of Hochiminh city, Hochiminh, Vietnam
a r t i c l e i n f o
Article history:
Received 28 March 2012
Received in revised form
27 November 2012
Accepted 29 November 2012
Available online 11 January 2013
Keywords:
Chemical reaction optimization
Greedy
0–1 Knapsack problem
a b s t r a c t
The 0–1 knapsack problem (KP01) is a well-known combinatorial optimization problem. It is an NP-hard
problem which plays important roles in computing theory and in many real life applications. Chemi-
cal reaction optimization (CRO) is a new optimization framework, inspired by the nature of chemical
reactions. CRO has demonstrated excellent performance in solving many engineering problems such as
the quadratic assignment problem, neural network training, multimodal continuous problems, etc. This
paper proposes a new chemical reaction optimization with greedy strategy algorithm (CROG) to solve
KP01. The paper also explains the operator design and parameter turning methods for CROG. A new repair
function integrating a greedy strategy and random selection is used to repair the infeasible solutions. The
experimental results have proven the superior performance of CROG compared to genetic algorithm (GA),
ant colony optimization (ACO) and quantum-inspired evolutionary algorithm (QEA).
© 2013 Published by Elsevier B.V.
1. Introduction
The 0–1 knapsack problem (KP01) is known to be a combina-
torial optimization problem. The knapsack problem has a variety
of practical applications such as cutting stock problems, portfolio
optimization, scheduling problems [20] and cryptography [1,9,3].
The knapsack appears as a sub-problem in many complex mathe-
matical models of real world problems. In a given set of n items,
each of them has a weight q
i
and a profit p
i
. The problem is to select
a subset from the set of n items such that the overall profit is maxi-
mized without exceeding a given weight capacity C. It is an NP-Hard
problem and hence it does not have a polynomial time algorithm
unless P = NP [2]. The problem may be mathematically modelled as
follows:
Maximize
n
i=1
x
i
p
i
(1)
Subject to
n
i=1
x
i
q
i
≤ C, x
i
∈ {0, 1}, ∀i ∈ {1, 2, . . . , n}
where x
i
takes values either 1 or 0 which represents the selection
or rejection of the ith item.
∗
Corresponding author.
E-mail address: LKL510@263.net (K. Li).
Over the last four decades, researchers have proposed many
approaches to solve KP01. We can classify the methods for this
problem into two classes namely, exact algorithms and approxi-
mate algorithms.
Exact approaches include dynamic programming proposed by
Bellman [20] and Branch and Bound proposed by Kolesar [8].
Recently, researchers, such as Kellerer et al. [7] have worked on
ways to exactly solve ever larger instances of the knapsack prob-
lem. Many of these involve solving some “core” of the problem and
then building this partial solution to a full solution. A parallel algo-
rithm based on an EREW-SIMD machine with shared memory was
proposed by Li et al. [16].
Among the early heuristic approaches, a “polynomial approx-
imation schemes” was first developed for the knapsack problem
by Sahni [22]. Such schemes may be thought of as solution meth-
ods in which one may specify a desired guarantee for the quality
of solution in advance of solving. As to be expected, the work
to solve increases quickly with the quality required. Immediately
afterwards, this was improved by Ibarra and Kim [6] to a fully poly-
nomial approximation scheme which makes the trade-off between
quality of solution and effort slightly more favorable. Specialized
solution techniques to solve the knapsack problem and its variants
were provided by Martello and Toth [20].
In recent years, many heuristic algorithms have been employed
to solve KP01 problems: Chou-Yuan [15] proposed an ant colony
optimization (ACO) for KP01; Shi [24] modified the parameters of
the ant colony optimization model to adapt itself to KP01 prob-
lems; Li [17] proposed a binary particle swarm optimization based
1568-4946/$ – see front matter © 2013 Published by Elsevier B.V.
http://dx.doi.org/10.1016/j.asoc.2012.11.048