Heuristics for the container loading problem

European Journal of Operational Research 141 (2002) 382–392
www.elsevier.com/locate/dsw
Heuristics for the container loading problem
David Pisinger
*
Department of Computer Science, University of Copenhagen, Universitetsparken 1, DK-2100 Copenhagen, Denmark
Abstract
The knapsack container loading problem is the problem of loading a subset of rectangular boxes into a rectangular
container of fixed dimensions such that the volume of the packed boxes is maximized. A new heuristic based on the
wall-building approach is proposed, which decomposes the problem into a number of layers which again are split into a
number of strips. The packing of a strip may be formulated and solved optimally as a Knapsack Problem with capacity
equal to the width or height of the container. The depth of a layer as well as the thickness of each strip is decided
through a branch-and-bound approach where at each node only a subset of branches is explored.
Several ranking rules for the selection of the most promising layer depths and strip widths are presented and the
performance of the corresponding algorithms is experimentally compared for homogeneous and heterogeneous instances. The best ranking rule is then used in a comprehensive computational study involving large-sized instances.
These computational results show that instances with a total box volume up to 90% easily may be solved to optimality,
and that average fillings of the container volume exceeding 95% may be obtained for large-sized instances. 2002
Elsevier Science B.V. All rights reserved.
Keywords: Cutting/packing; Container loading; Knapsack packing; Heuristics
1. Introduction
The problem addressed in this paper is that of
orthogonally packing a subset of some given
rectangular-shaped boxes into a rectangular container of fixed dimensions. The problem has numerous applications in the cutting and packing
industry, e.g., when cutting wood or foam rubber
into smaller pieces, loading pallets with goods, or
filling containers with cargo. An optimal filling of
a container reduces the shipping costs as well as
increasing the stability and support of the load.
*
Tel.: +45-35-32-14-00; fax: +45-35-32-14-01.
E-mail address: [email protected] (D. Pisinger).
The problem has been studied since the seminal
work of Gilmore and Gomory [13] in the early
sixties, and numerous papers and algorithms have
been presented for its solution. There are, however, several variants of the container loading
problem depending on the objective function and
side constraints present.
Strip packing. In this variant of the problem,
the container has fixed width and height but infinite depth. The problem is to pack all boxes such
that the depth of the container is minimized. The
strip packing problem has applications in multidrop situations, where the load should be divided
into distinct sections corresponding to the different destinations. Several algorithms for this problem are compared in Bischoff and Marriott [2].
0377-2217/02/$ - see front matter 2002 Elsevier Science B.V. All rights reserved.
PII: S 0 3 7 7 - 2 2 1 7 ( 0 2 ) 0 0 1 3 2 - 7
D. Pisinger / European Journal of Operational Research 141 (2002) 382–392
The multi-drop problem in general is considered in
Bischoff and Ratcliff [3].
Knapsack loading. In the knapsack loading of a
container each box has an associated profit, and
the problem is to choose a subset of the boxes that
fits into a single container so that maximum profit
is loaded. If the profit of a box is set to its volume,
this problem corresponds to the minimization of
wasted space. Heuristics for the knapsack loading
problem have been presented in Gehring et al. [11]
and Scheithauer [21].
Bin-packing. In this problem, all containers have
fixed dimensions, and all the boxes are to be packed
into a minimum number of containers. This problem has been considered in Scheithauer [20], Faroe
et al. [9], and Martello et al. [16]. The latter paper
considers exact methods for the solution.
Multi-container loading. This problem is similar
to the Bin-packing problem except that the containers may have varying dimensions and the objective is to choose a subset of the containers which
results in the minimum shipping costs. Formulations and solution methods are discussed in Chen
et al. [5].
For a general classification of packing and
loading problems, we refer to Dyckhoff [7] and
Dyckhoff et al. [8]. Several other constraints may
be imposed to the above problems: Only specific
rotations (if any) may be allowed, feasible solutions might be restricted to those which are guillotine cuttable, it may be demanded that the
weight of the container is balanced, there may be
restrictions on which or how many boxes may be
put on top of each other, or it may be necessary to
place boxes from one lot next to each other. Also
the support of the boxes must be taken into consideration, as a box cannot be placed at a corner of
another box only. Bischoff and Ratcliff [3] give an
excellent overview of practical requirements which
may be imposed to the problem.
A related problem is the pallet loading problem.
As pallets unlike containers provide no lateral
support for the boxes, the stability of the loading
arrangement is an important constraint. A heuristic
algorithm for the pallet loading problem with nonidentical items was presented by Bischoff et al. [1].
One should also distinguish between homogeneous and heterogeneous types of cargo. If the
383
cargo consists of identical boxes it is denoted homogeneous, while it is strongly heterogeneous if
many different types of boxes are present. In the
case of a small set of box types in the cargo, the
problem is denoted weakly heterogeneous. As
noted by Gehring and Bortfeldt [10] algorithms for
the container loading problem frequently assume a
specific distribution of the box types which makes
them perform badly when given an instance with a
different distribution of the boxes.
The problem considered in this paper is the
Knapsack Container Loading Problem (KCLP)
where we assume that the profit of a box equals its
volume. The boxes may be rotated in any orthogonal directions, although it is easy to modify
the algorithm such that it respects constraints on
the orientation. The objective is to fill the container most possible, without taking the support
of the items into consideration. In principle, the
empty spaces could be filled out with foam rubber
to ensure a proper support of the boxes. As will be
clear from the computational experiments, very
little empty space is left open thus limiting the need
for extra support.
We will use the following terminology: the
container has width W, height H and depth D. A
set N ¼ f1; . . . ; ng of boxes is given, each box j
having width wj , height hj and depth dj . The volume of each box is vj ¼ wj hj dj .
The organization of this paper is the following:
Section 2 presents several heuristics for the KCLP
with special focus on the wall-building approach
presented by George and Robinson [12]. In Section
3, we present an improved algorithm based on
the wall-building approach which incorporates a
backtracking step to improve the solution quality.
The layer itself is packed by considering a number
of strips of alternating directions, where each strip
is solved optimally as a Knapsack Problem. Although both approaches include a backtracking
facility the depths of the considered layers and
strips should be chosen with care. Thus Section 3.1
proposes 27 ranking functions to select an appropriate subset of promising layer depths and strip
widths. Computational experiments with homogeneous and heterogeneous instances are reported in
Section 4 where all the different ranking functions are considered for the tree-search algorithm.
384
D. Pisinger / European Journal of Operational Research 141 (2002) 382–392
The paper is concluded by some final remarks in
Section 5. A first version of this paper appeared in
[19].
2. Heuristic algorithms
The KCLP is NP-hard in the strong sense and
also in practice very difficult to solve. Only smallsized instances can be solved to optimality thus
when dealing with real-life instances of large size
heuristic approaches are applied. The most common heuristic approaches can be classified as wall
building algorithms, stack building algorithms,
guillotine cutting algorithms, and cuboid arrangement algorithms. The wall-building approach, introduced by George and Robinson [12], fills the
container in a number of layers across the depth of
the container as illustrated in Fig. 1. The wall
building approach has been used by e.g., Bischoff
and Marriott [2], Hemminki [14], and Gehring
et al. [11]. The stack building approach, proposed
by Gilmore and Gomory [13], packs the boxes into
suitable stacks which then are arranged at the floor
of the container by solving a two-dimensional
packing problem. Using a genetic algorithm for
solving the two-dimensional packing problem,
Gehring and Bortfeldt [10] presented a heuristic
based on this idea. Morabito and Arenales [17]
proposed the guillotine cutting approach which is
based on a slicing tree representation of the pack-
ing. Each slicing tree corresponds to a guillotine
partitioning of the container into smaller parts,
where the leaf nodes correspond to the boxes. The
cuboid arrangement approach, presented by Bortfeldt and Gehring [4], recursively fills the container
with cuboid arrangements (arrangement of similar
boxes). Cuboid arrangements will always provide
a sufficient support of the boxes. Tabu search can
be applied to iteratively improve the local arrangements.
The heuristic algorithm presented in this paper
is based on the wall building approach, thus in
the following we will go into details with previous
algorithms based on this approach. George and
Robinson [12] presented the first wall building
heuristic for KCLP. Only layer depths d which
equal some box dimensions were considered (these
are called normalized layer depths), but still the
depth of a layer must be carefully selected to obtain a good performance. Hence, when opening a
new layer, George and Robinson apply a ranking
rule for selecting d: among the remaining boxes
they choose the box ‘ which has largest size of the
smallest dimension, the rationale being that such a
box may be difficult to accommodate later in the
packing procedure. The box is rotated such that its
depth d‘ is maximized, and the layer depth d is
then chosen as d ¼ d‘ .
Having determined the depth of a layer, the
wall is packed in a greedy way as a number of
horizontal strips (see Fig. 2). Every strip is packed
Fig. 1. The wall-building algorithm by George and Robinson.
D. Pisinger / European Journal of Operational Research 141 (2002) 382–392
Fig. 2. Each layer is filled by a number of horizontal strips.
by consecutively inserting boxes with the largest
ranking, where the ranking is based on the smallest
dimension of a box (the larger it is, the larger
ranking). In case of ties, the ranking rule depends
on the number of remaining boxes of a given type
and on the length of the largest dimension.
Bischoff and Marriott [2] compare 14 heuristics
based on the wall-building approach, where different ranking functions are applied. Their results
indicate that there is no clear winning strategy thus
they propose a ‘‘hybrid’’ version where all 14
heuristics are run and the best solution is selected.
A major disadvantage about the proposed wallbuilding heuristics is that they are greedy, i.e., they
make locally optimal choices which however may
lead to bad final solutions. To obtain a better
performance it is necessary to have a kind of
backtracking possibility. Hemminki [14] presented
a genetic algorithm for choosing the depths of the
layers. Each chromosome consists of a string of
layer depths, and as the generations evolve, proper
combinations of layers will appear.
3. A tree-search heuristic
Our algorithm is an extension of the wallbuilding approach where a tree-search algorithm is
used to find the set of layer depths and strip widths
which results in the best overall filling. Ideally we
would like to consider all normalized layer depths
and strip widths, but this would be computationally too expensive. To decrease the complexity an
m-cut approach [15] is used for the enumeration
where only a fixed number of sub-nodes are considered for every branching node.
Hence, at each branching node we consider M1
different layer depths selected according to a specific ranking rule. Each layer is then filled as a
number of strips, where the strips may be oriented
horizontally or vertically. Again, only a limited
385
number M2 of different strip widths are considered.
Once the layer depth and strip width has been
settled, a single strip may filled optimally by
solving a Knapsack Problem (KP). For every layer
depth d10 ; . . . ; dM0 1 , we choose the layer filling which
has the overall best use of the volume before
proceeding to the next layer. This leads to the
following algorithm:
For a given subset of boxes N 0 , residual container depth d and previous packing of volume
V, the recursive procedure choose_depth selects
M1 different layer depths according to the ranking
rule to be described in Section 3.1. For each depth
d 0 , it is attempted to pair boxes two by two in
order to obtain uniform dimensions. This approach will be described in Section 3.3. The layer
of dimensions W H d 0 is then filled by calling a
procedure fill_layer. The chosen boxes L for
the current layer are removed from the problem,
and choose_depth is called recursively. The algorithm backtracks when there is no more space
for a layer. The procedure makes use of two global
variables: X is the currently best solution (i.e., a
set of chosen boxes and their positions), and V is
the corresponding volume. Initially, one should set
V ¼ 0 before calling choose_depth ðD; 0; N Þ.
Upon completion, X is the heuristic solution and
V its volume.
algorithm choose_depthðd; V ; N 0 Þ
if V > V then Save solution in X ,
set V V.
if d < minj2N 0 minfwj ; hj ; dj g then return;
Select M1 best ranked layer
depths fd10 ; d20 ; . . . ; dM0 1 g.
for each depth d 0 2 fd10 ; d20 ; . . . ; dM0 1 g
begin
Pair boxes to obtain a depth
close to d 0 , and set U 0;
Call fill_layerðW ; H ; d 0 ; 0; N 0 Þ;
Let L be the chosen boxes, and
U their volume.
Call choose_depthðd d 0 ; V þ U ;
N 0 n LÞ;
end;
386
D. Pisinger / European Journal of Operational Research 141 (2002) 382–392
The recursive procedure fill_layer packs a
layer of dimensions w h d 0 with a subset of the
items N 00 . The volume of already placed boxes in
this layer is given by the parameter U. The layer is
filled by a number of strips which may be either vertical or horizontal. Before filling a strip,
some preprocessing of the items in N 00 is made,
such that they are rotated to occupy least possible height (or width). This is further described
in Section 3.2. The procedure makes use of the
global variables L and U , holding the current best
filling of the layer and the corresponding objective
value.
algorithm fill_layer ðw; h; d 0 ; U ; N 00 Þ
if U > U then Save solution in L,
set U U;
‘
minj2N 00 minfwj ; hj ; dj g;
if ðw < ‘Þ or ðh < ‘Þ then return;
comment: pack vertical strip:
Select M2 best ranked widths
fw01 ; w02 ; . . . ; w0M2 g.
for each width w0 2 fw01 ; w02 ; . . . ; w0M2 g
begin
Rotate the boxes and solve a KP
with capacity h. Let K be the
set of chosen boxes.
Call fill_layerðw w0 ; h; U þ
P
00
j2K vj ; N n KÞ;
end;
comment: pack horizontal strip:
select M2 best ranked heights
fh01 ; h02 ; . . . ; h0M2 g.
for each height h0 2 fh01 ; h02 ; . . . ; h0M2 g
begin
Rotate the boxes and solve a KP
with capacity w. Let K be the
set of chosen boxes.
Call
fill_layerðw; h h0 ; U þ
P
00
j2K vj ; N n KÞ;
end;
ub ¼ U þ w h d 0 :
If the bound shows that it will not be possible to
reach a better solution than the current incumbent
solution U , a backtracking step is performed. A
similar approach is used for the choose_depth
algorithm.
The fill_layer algorithm may have excessive computational times if all the boxes are very
small and thus the search tree gets very deep. To
get around this problem an upper limit R1 is imposed on the depth of the search tree. For nodes
with a larger depth in the tree than R1 the number
of considered widths or heights is set to M2 ¼ 1.
An additional bound R2 is assigned to the number
of branching nodes considered in fill_layer.
Having reached this number the algorithm immediately terminates, returning the incumbent solution.
3.1. Ranking of depths and widths
At each branching node we consider the M1 best
ranked depths of a layer, or the M2 best ranked
widths/heights of a strip. Computational experiments showed that the performance of the algorithm strictly depends on the ranking of these
dimensions, thus several ranking functions were
investigated.
All the ranking functions are based on some
statistics on the dimensions of the remaining
boxes. Thus let a and b be the smallest, respectively, largest dimension of the boxes, taking into
account that the resulting layer or strip should fit
within the container at the present stage of the algorithm. We consider three different frequency
functions.
• For a given value of k the frequency function f 1 returns the number of occurrences of
this dimension among the remaining boxes,
considering all dimensions wi ; hi ; di of the boxes:
fk1 ¼
In order to speed up the fill_layer algorithm
an upper bound is derived at each recursive call as
follows:
n
X
1ðwi ¼k_hi ¼k_di ¼kÞ
for k ¼ a; . . . ; b:
i¼1
• The second frequency function f 2 returns the
number of occurrences of dimension k among
D. Pisinger / European Journal of Operational Research 141 (2002) 382–392
the remaining boxes, considering only the largest dimension of each box:
n
X
1ðmaxfwi ;hi ;di g¼kÞ for k ¼ a; . . . ; b:
fk2 ¼
(e)
i¼1
• Finally, the frequency function f 3 returns the
number of occurrences of dimension k among
the remaining boxes, considering only the
smallest dimension of each box:
fk3 ¼
n
X
1ðminfwi ;hi ;di g¼kÞ
for k ¼ a; . . . ; b:
i¼1
All the above frequency functions only consider wi
and hi of a box i for the case when M2 best ranked
widths/heights of a strip are selected. This is due to
the fact, that the depth of the layer already has
been fixed and the boxes have been rotated such
that di fits the layer depth.
Based on the three frequency functions, we may
define a number of priority rules. The motivation
of all the rules is either to choose the largest dimensions first (in order to get rid of the difficult
boxes) or to choose the most frequent dimensions
(to obtain a homogeneous layer or strip with a
good filling). Several of the priority rules express a
tradeoff between these two goals.
(a) Choose the largest dimensions, i.e., choose the
M largest dimensions k with fk > 0.
(b) Choose the largest dimensions with increasing
frequency, i.e., first choose the largest dimension k with fk P 1. Then choose the largest dimension k 0 with fk0 > fk . Repeat this process
until up to M dimensions have been selected.
(c) Choose the largest dimensions with pseudoincreasing frequency (first version), i.e., first
choose the largest dimension k with fk P 1.
Then choose the largest dimension k 0 with
fk0 P 2. The ith chosen value should have frequency fk P i.
(d) Choose the largest dimensions with pseudo increasing frequency (second version), i.e., first
choose the largest dimension k with fk P 1.
The ith chosen value should have frequency
fk P 4i=M, where M is the number of dimensions to be selected. The motivation for priority rule (d) in comparison to (c) is to have a
slower increase in the frequency demands for
(f)
(g)
(h)
(i)
387
situations where M is large. This should make
it easier to select the proper number of dimensions.
Choose the most frequent dimensions, i.e., the
M dimensions k with largest values of fk .
This priority rule is equivalent to rule (b) but if
less than M dimensions are selected, priority
rule (a) is applied for the remaining dimensions
to be chosen.
This priority rule is equivalent to (c), using
rule (a) if less than M dimensions are selected.
This priority rule is equivalent to (c), using
rule (e) for the remaining dimensions.
This priority rule is equivalent to (d), with rule
(e) for the remaining dimensions.
In certain situations, it may not be possible to find
all the wanted M dimensions. In such a case, the
algorithm simply considers this smaller set.
Notice the generality of the above frequency
functions and priority rules. E.g., the priority
function of George and Robinson – selecting
the layer depth according to the largest value of
the smallest dimension of a box – can be achieved
by using frequency function f 3 with priority rule
(a).
3.2. Filling a single strip
Strips may be filled horizontally or vertically.
Since the cases are symmetrical, we will consider a
vertical filling in the following. The filling of a
single strip of width w0 and depth d 0 may be formulated as a Knapsack Problem. First, each box j
is rotated in one of six directions such that wj 6 w0 ,
dj 6 d 0 and hj is minimized. If it is not possible to
fit the box j within w0 d 0 then add it to the set of
discarded boxes D. Otherwise set
aj ¼ hj ;
cj ¼ vj ¼ wj hj dj
for each feasible box j 2 N n D. Then the strip
packing problem becomes
X
maximize
cj xj
j2N nD
subject to
X
aj xj 6 b;
j2N nD
xj 2 f0; 1g;
j 2 N n D;
388
D. Pisinger / European Journal of Operational Research 141 (2002) 382–392
where N n D is the set of feasible boxes, and b is the
strip height h from algorithm fill_layer. The
resulting problem is a Knapsack Problem (KP)
which may be solved in OðjN n DjbÞ time through
dynamic programming.
In the computational experiments we used the
very effective minknap algorithm from Pisinger
[18] for solving the strip problem. Since about half
a million of knapsack problems are solved during
a typical filling of a single container, the majority
of the computational time is spent for solving this
problem.
3.3. Pairing of boxes
The solution found by the KP may be improved
by pairing boxes two by two whenever possible.
Since the complexity of this algorithm is Oðn2 Þ it is
only executed once for each layer having depth d 0 .
Thus assume that a box j has been rotated such
that its depth dj is largest possible satisfying
dj 6 d 0 . A measure of how well it fills the depth is
aðjÞ ¼ vj =ðwj hj d 0 Þ ¼ dj =d 0 . We aim at improving
this filling by pairing box j with another box i.
Thus for each box i 6¼ j all different rotations
of i and j are considered where di þ dj 6 d 0 each
time deriving the filling ratio bði; jÞ ¼ ðvi þ vj Þ=
ðd 0 maxfwi ; wj g maxfhi ; hj gÞ. If bði; jÞ 6 aðjÞ for all
boxes i and all rotations, then the box j remains
alone. Otherwise, the box i (and corresponding
rotation) leading to the largest value of bði; jÞ is
chosen and a new box k is constructed with dimensions
wk ¼ maxfwi ; wj g;
hk ¼ maxfhi ; hj g;
dk ¼ d 0 :
ð1Þ
The original boxes i and j are temporarily removed
from the problem, to avoid that they are selected
twice in the layer filling.
4. Computational experiments
The above algorithm was implemented in C and
tests were run on a AMD Athlon 1.1 GHz processor. Appropriate values of M1 and M2 were
experimentally found to be 4 and 8, respectively,
since this gave a good trade-off between solution
quality and computational time. The maximum
depth of the search tree in fill_layer was set to
R1 ¼ 6, and the maximum nodes considered in a
single call to fill_layer was set to R2 ¼ 10 000.
Finally a time limit of 120 seconds was assigned to
each instance. The code is available for academic
use at http://www.diku.dk/pisinger.
Data instances were randomly generated using
the scheme of Hemminki [14] which reflects typical
properties of industrial loading problems. The
container has dimensions W ¼ H ¼ 230 and D ¼
590, corresponding to the size of a standard 20 ft
container (measured in cm). Twenty different box
types are generated with wj ; hj and dj randomly
distributed in the interval ½25; 115. Then the
cargo is generated by randomly choosing box i as
one of the 20 box types. New boxes are generated
until the overall volume of the boxes exceeds
Tc ¼ 90% of the containers volume WHD. In this
way, each instance consists of about 50–150 boxes.
We will denote these instances weakly heterogeneous.
Table 1 shows a typical weakly heterogeneous
instance. The box types are given by their width
wj , height hj and depth dj and the last row shows
how many boxes were generated of the given type.
Fig. 3 shows a packing chart of the instance where
it was possible to fit all boxes into the container.
To get a more balanced picture of the algorithm, we also considered homogeneous problems
where only one box type is present, and strongly
heterogeneous problems where all boxes may have
different dimensions. The strongly heterogeneous
problems involve 70–100 boxes, while the homogeneous problems involve 20–700 boxes. Due to
the diversity in the number of boxes in a homogeneous problem, the algorithm is tested in quite
extreme situations.
In order to determine the best ranking function
from Section 3.1 a series of 100 problems was run
for each ranking function. The three frequency
functions and nine ranking rules could be combined into 27 ranking functions. The outcome of
this test is shown in Table 2 where the first two
columns define the priority rule, and the following
three columns give the average percentage of the
volume which was filled, the average number of
D. Pisinger / European Journal of Operational Research 141 (2002) 382–392
389
Table 1
Dimensions of boxes for instance number 76 with Tc ¼ 90%
Box type
1
Width wj 85
Height hj 60
Depth dj 26
Number
of boxes
5
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
36
69
28
68
26
46
71
100
100
28
31
42
109
29
51
94
52
43
32
106
113
52
115
45
29
68
44
42
41
115
97
59
48
106
53
40
105
68
32
107
43
110
39
62
80
29
56
73
31
47
42
39
41
114
101
38
40
7
6
5
6
8
9
6
13
9
12
8
5
3
3
6
7
10
8
10
In total 146 boxes were generated with a total volume of 91.8% of the container volume.
Fig. 3. Optimal solution of instance 76 with Tc ¼ 90%. All boxes are packed into the container. The values d state the depth of each
layer. Dotted boxes are placed behind the full-drawn boxes, forming a ‘‘pair’’.
boxes which could not be packed, and finally the
average solution time. The first three columns
correspond to the weakly heterogeneous problems,
the next columns are for the strongly heterogeneous problems, and finally the last columns correspond to the homogeneous problems.
Since the algorithm terminates when an optimal
filling has been found, the solution times strictly
depend on the number of optimal fillings. The
table clearly demonstrates that frequency function
f 1 is superior to the two other frequency functions
f 2 and f 3 . The best values of the objective function
(pct. vol. filled) was obtained for ranking functions
(h), although function (g) and (i) in general also
performed well. Thus ranking rule (h) was selected
for the following tests.
The results in Table 2 show a satisfactory
behavior of the algorithm. The best results are
obtained for the heterogeneous problems as the
variance in dimensions apparently makes it easier
to combine the boxes into appropriate strips and
layers. The filling rate achieved for these problems
is close to 91%, meaning that nearly all the boxes
could be packed. The algorithm also performs
quite well for the homogeneous problems where
the average filling rate becomes around 84%. One
should not expect as good solution values for the
homogeneous problems as it is almost impossible
to obtain a good filling rate when the dimensions
of the box type are huge.
For the weakly heterogeneous problems,
Hemminki [14] obtained a filling ratio of 84.5%
390
D. Pisinger / European Journal of Operational Research 141 (2002) 382–392
Table 2
Comparison of the 27 different ranking functions for Tc ¼ 90%. Average values of 100 instances
Frequency
function
Priority
rule
Weakly heterogeneous
Strongly heterogeneous
Homogeneous
pct. vol.
filled
Boxes
not
packed
pct. vol.
filled
Boxes
not
packed
pct. vol.
filled
f1
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)
(i)
90.44
90.10
90.70
90.73
90.73
90.68
90.77
90.79
90.76
0.6
1.1
0.3
0.2
0.2
0.3
0.1
0.0
0.1
13.25
0.76
1.27
4.81
13.39
6.10
4.69
9.33
9.46
89.44
90.34
90.58
90.87
90.51
90.87
90.88
90.98
90.97
2.3
1.5
1.2
0.5
1.0
0.6
0.5
0.3
0.3
14.18
0.68
0.91
2.48
88.07
8.25
6.67
24.86
23.86
83.79
79.17
83.79
83.79
83.74
83.79
83.79
83.79
83.79
5.9
9.5
5.9
5.9
6.1
5.9
5.9
5.9
5.9
35.38
1.57
35.37
35.56
35.95
35.41
35.39
35.41
35.61
f2
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)
(i)
90.11
88.75
90.11
90.36
90.54
90.36
90.42
90.52
90.51
1.0
2.8
1.3
0.8
0.6
0.9
0.7
0.5
0.6
13.34
0.46
1.51
2.95
7.36
9.61
8.31
7.57
9.08
89.42
88.50
89.17
89.79
90.77
90.18
90.34
90.86
90.82
2.5
4.0
3.5
2.5
0.8
1.8
1.8
0.6
0.7
13.81
0.10
0.28
0.82
39.79
11.86
11.58
29.03
26.41
78.89
78.89
78.89
78.89
78.89
78.89
78.89
78.89
78.89
10.7
10.7
10.7
10.7
10.7
10.7
10.7
10.7
10.7
0.26
0.26
0.26
0.26
0.26
0.26
0.26
0.26
0.26
f3
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)
(i)
89.86
89.00
89.83
90.04
88.86
89.91
89.95
89.99
89.99
1.4
2.5
1.4
1.1
1.8
1.3
1.1
1.2
1.1
81.60
18.60
40.04
53.96
102.33
80.16
73.95
76.90
79.31
90.55
89.17
89.34
89.93
83.72
90.51
90.46
90.11
90.19
1.0
3.0
2.7
1.8
3.3
1.1
1.2
1.4
1.5
77.44
2.34
3.36
11.23
119.43
86.27
88.28
105.06
102.93
75.66
75.66
75.66
75.66
75.66
75.66
75.66
75.66
75.66
17.6
17.6
17.6
17.6
17.6
17.6
17.6
17.6
17.6
0.16
0.16
0.16
0.16
0.16
0.16
0.16
0.16
0.16
Time
(seconds)
using 12 different ranking strategies in the George–
Robinson algorithm and choosing the best solution obtained this way. Using genetic algorithms to
choose the depths of the layers Hemminki obtained
an average filling ratio of 87.0%. Bischoff and
Ratcliff [3] report a filling ratio of around 83.0% for
problems similar to the weakly heterogeneous
problems (i.e., 20 box types), although the box dimensions are slightly different. It should be emphasized that Bischoff and Ratcliff only consider
solutions where the boxes are properly supported.
Bortfeldt and Gehring [4] obtained filling ratios of
around 83.9% for the same instances, providing full
support of all boxes. Gehring and Bortfeldt [10]
obtained a filling ratio of around 87.7% for weakly
heterogeneous instances similar to those of Bischoff
and Ratcliff. Morabito and Arenales [17] obtain a
Time
(seconds)
Boxes
not
packed
Time
(seconds)
filling ratio of around 95% for problems similar to
the weakly heterogeneous problems where an unlimited number of each box type is available. The
latter assumption, however, makes it considerably
easier to achieve good packings.
To see how the tree-search algorithm behaved
when the total volume of the boxes was increased, a
series of tests were run where boxes were generated
until the overall volume of the boxes exceeded
Tc ¼ 80%; 85%; 90%; . . . ; 200% of the container
volume. The outcome of these experiments is
summarized in Table 3. For instances with Tc up to
90%, all the boxes are easily packed into the container. When Tc is increased, it is possible to obtain
an even better filling rate. This is due to the fact
that additional boxes give more freedom to the
algorithm when solving the strip problems. The
D. Pisinger / European Journal of Operational Research 141 (2002) 382–392
391
Table 3
Performance of the best algorithm, using frequency function f 1 and priority rule (h) as ranking rule, for instances with varying total
volume of the boxes
Min. volume
of boxes Tc
Weakly heterogeneous
Strongly heterogeneous
Total no.
of boxes
pct. vol.
filled
Boxes not
packed
Time
(seconds)
Total no.
of boxes
pct. vol.
filled
Boxes not
packed
Time
(seconds)
80
85
90
95
100
110
120
130
140
150
160
170
180
190
200
75.5
80.2
84.7
89.3
94.1
103.3
113.0
122.6
131.7
140.7
149.8
159.0
168.3
177.6
186.8
80.79
85.75
90.79
92.95
93.47
94.16
94.44
94.64
94.82
94.92
95.03
95.08
95.23
95.25
95.30
0.0
0.0
0.0
4.2
8.8
17.2
27.7
36.6
45.5
53.9
63.0
72.0
81.8
90.3
99.4
0.45
0.76
9.34
84.97
87.47
89.48
89.90
88.64
82.36
74.19
64.56
58.24
51.14
48.05
44.75
73.4
77.8
82.5
86.8
91.3
100.2
109.5
118.4
127.4
136.8
145.9
155.3
164.5
173.7
182.8
80.70
85.88
90.98
92.71
93.40
94.20
94.73
95.15
95.46
95.71
95.93
96.13
96.31
96.43
96.57
0.0
0.0
0.3
4.7
9.3
18.5
28.2
36.8
45.6
54.8
64.4
73.2
82.0
91.1
100.9
0.46
0.59
24.88
101.72
107.81
115.42
118.80
118.38
117.92
117.37
117.56
118.57
117.59
116.88
115.22
Average values of 100 instances solved.
filling rate exceeds 95% of the container volume
for large-sized instances. The solution times are
very reasonable, not exceeding one minute on average for the weakly heterogeneous problems and
two minutes for the strongly heterogeneous problems.
As noted by Gehring and Bortfeldt [10] and
Davies and Bischoff [6] the wall building approach
makes it easier to obtain a good weight distribution by repeatedly swapping the walls and interchanging walls with their mirror image. As the
here generated walls consist of separate strips, the
strips may also be interchanged and the ordering
of the boxes within a strip can be changed. It is a
topic of future research to develop a postprocessing algorithm which will be able to balance the
cargo and to improve the support of the boxes.
The algorithm differs from previous wallbuilding algorithms for the KCLP in several respects: by using the m-cut enumeration scheme for
choosing depths and widths/heights, the algorithm
has a possibility of backtracking in order to reach
depth and width/height combinations that fit well
together. Each strip filling problem is solved to
optimality by use of an efficient knapsack algorithm, and pairings of boxes are allowed to form
layers of uniform depth. Finally, the alternating
directions of strips (and thus varying lengths of
strips) allow us to place small series of similar
boxes next to each other.
Several ranking rules for the selection of layer
depths and strip widths have been investigated,
pointing out that a compromise between the largest and most frequent dimensions leads to the best
solution quality.
5. Conclusion
References
A heuristic algorithm for the Knapsack Container Loading Problem has been presented
which is able to fill more than 95% of the total
volume for large-sized instances. This is a considerable improvement compared to previous approaches.
[1] E.E. Bischoff, F. Janetz, M.S.W. Ratcliff, Loading pallets
with non-identical items, European Journal of Operational
Research 84 (1995) 681–692.
[2] E.E. Bischoff, M.D. Marriott, A comparative evaluation
of heuristics for container loading, European Journal of
Operational Research 44 (1990) 267–276.
392
D. Pisinger / European Journal of Operational Research 141 (2002) 382–392
[3] E.E. Bischoff, M.S.W. Ratcliff, Loading multiple pallets,
Journal of the Operational Research Society 46 (1995)
1322–1336.
[4] A. Bortfeldt, H. Gehring, Applying tabu search to
container loading problems, in: Operations Research
Proceedings 1997, Springer, Berlin, 1998, pp. 533–538.
[5] C.S. Chen, S.M. Lee, Q.S. Shen, An analytical model
for the container loading problem, European Journal
of Operational Research 80 (1995) 68–76.
[6] A.P. Davies, E.E. Bischoff, Weight distribution considerations in container loading, European Journal of Operational Research 114 (1999) 509–527.
[7] H. Dyckhoff, A typology of cutting and packing problems,
European Journal of Operational Research 44 (1990) 145–
159.
[8] H. Dyckhoff, G. Scheithauer, J. Terno, Cutting and
Packing, in: M. Dell’Amico, F. Maffioli, S. Martello
(Eds.), Annotated Bibliographies in Combinatorial Optimization, Wiley, Chichester, 1997.
[9] O. Faroe, D. Pisinger, M. Zachariasen, Guided local
search for the three-dimensional bin packing problem,
INFORMS Journal on Computing, 2000, forthcoming.
[10] H. Gehring, A. Bortfeldt, A genetic algorithm for solving
the container loading problem, International Transactions
in Operational Research 4 (1997) 401–418.
[11] M. Gehring, K. Menscher, M. Meyer, A computer-based
heuristic for packing pooled shipment containers, European Journal of Operational Research 44 (1990) 277–288.
[12] J.A. George, D.F. Robinson, A heuristic for packing boxes
into a container, Computers and Operations Research 7
(1980) 147–156.
[13] P.C. Gilmore, R.E. Gomory, Multistage cutting stock
problems of two and more dimensions, Operations Research 13 (1965) 94–120.
[14] J. Hemminki, Container loading with variable strategies in
each layer, presented at ESI-X, EURO Summer Institute,
Jouy-en-Josas, France, 2–15 July 1994.
[15] T. Ibaraki, Enumerative Approaches to Combinatorial
Optimization – Part 2, Annals of Operations Research 11
(1987), Baltzer, Basel.
[16] S. Martello, D. Pisinger, D. Vigo, The three-dimensional
bin packing problem, Operations Research 48 (2000) 256–
267.
[17] R. Morabito, M. Arenales, An AND/OR graph approach
to the container loading problem, International Transactions in Operational Research 1 (1994) 59–73.
[18] D. Pisinger, A minimal algorithm for the 0–1 Knapsack
Problem, Operations Research 45 (1997) 758–767.
[19] D. Pisinger, A tree-search heuristic for the container
loading problem, Ricerca Operativa 28 (1999) 31–48.
[20] G. Scheithauer, A three-dimensional bin packing algorithm, Journal of Information Processing and Cybernetics
27 (1991) 263–271.
[21] G. Scheithauer, Algorithms for the container loading
problem, in: Operations Research Proceedings 1991,
Springer, Berlin, 1992, pp. 445–452.