A Tabu Search Algorithm
A Tabu Search Algorithm
1 Introduction
In the Pallet Loading Problem, PLP, the maximum number of identical rect-
angular boxes have to be packed onto a rectangular pallet. The problem
arises at factories when large quantities of one product must be shipped
onto pallets, and it is sometimes called the Manufacturer’s Loading Problem
(MLP) to distinguish it from the Distributor’s Loading Problem (DLP) in
which in boxes of several sizes are packed together on one pallet. Though
the problem is initially three-dimensional, practical considerations of stabil-
ity and handling usually mean that the boxes must be placed orthogonally
with respect to the edges of the pallet and in the layers in which the ver-
tical orientation of the boxes is fixed. With these restrictions the problem
becomes the two-dimensional problem of packing a large rectangle, a pallet,
with the maximum number of small identical rectangles, boxes.
1
The problem has many practical applications in distribution and logistics.
An increase in the number of boxes which can be shipped on a pallet directly
leads to a decrease in costs. Though the problem is very easy to solve in
many cases, it cannot be considered to have been completely solved. For
example, for the instance (89,75,10,7), a state-of-the-art commercial code for
integer programming such as CPLEX took 89 hours of CPU time to obtain
an optimal solution with 99 boxes. The problem has therefore continued to
attract a lot of research in recent decades.
The exact algorithms proposed to date are basically tree search proce-
dures in which at each node a partial layout of boxes on the pallet has been
built. Different ways of adding boxes, extending the partial solution, and dif-
ferent bounding procedures define the different algorithms [2],[5],[8],[9], [11],
[15]. These exact algorithms have been able to solve problems of only mod-
erate size, up to 50 boxes. Several upper bounds have also been proposed
[6],[7],[16],[19], which consider the geometric structure of the problem and
linearly relax integer programming formulations.
Many heuristic methods have been developed. On the one hand, there
are constructive methods of increasing complexity, from simple structures in
which the pallet is divided into blocks [3],[21], [22], to recursive procedures
[17],[18], [20],[23]. On the other hand, there are metaheuristics based on tabu
search, genetic algorithms and strategic oscillation [1],[10],[13].
The best results to date have been obtained by recursive procedures
that exhaustively study special structures leading to good but not neces-
sarily optimal solutions. The algorithm G − 4 of Scheithauer and Terno [20]
finds, in very short computing times, the best G4-structures of each prob-
lem, structures which produce the optimal solution for all the instances of
set CoverI (up to 50 boxes) and for most of the instances of set CoverII
(up to 100 boxes). The algorithm proposed by Lins et al.[17] finds the best
L-decomposition. This structure contains G − 4 as a special case and obtains
more optimal solutions, but it is computationally much more expensive. The
metaheuristic algorithms described so far present computational results lim-
ited to small subsets of problems and they have not yet obtained results
comparable to those sophisticated recursive procedures.
The purpose of the present paper is to develop an algorithm, based on
tabu search, that can compete with the best recursive procedures in terms of
the quality of the solutions and the computing times. The structure of the
paper is as follows. In Section 2, we formally define the problem and review
the main concepts, especially the idea of equivalence classes. In Section 3
2
we present the main components of the algorithm, defining the moves, the
tabu list and the intensification and diversification strategies. In Section 4 we
present the computational results. Finally, concluding comments are made
in Section 5.
3
suppose solving equivalent problems more than once. It seems more rea-
sonable to work with equivalence classes. Two sets have been proposed[9]:
Cover I, the set of equivalence classes of instances satisfying:
L a L∗W
1≤ ≤ 2, 1≤ ≤ 4, 1≤ < 51
W b a∗b
and Cover II, the set of equivalence classes of instances satisfying:
L a L∗W
1≤ ≤ 2, 1≤ ≤ 4, 51 ≤ < 101
W b a∗b
The definition of sets Cover I and Cover II is subject to some ambiguity.
Sometimes one instance satisfies the conditions defining the set but another
equivalent instance does not. In these cases, the inclusion of the equivalence
class in the set is not clear. In order to avoid this ambiguity, we have fol-
lowed the constructive method proposed by Dowsland[9] to generate all the
equivalence classes for which the lowest dimensional instance strictly satisfies
the defining conditions of the set. Cover I produced in this way has 7827
classes, and Cover II has 40609 classes.
The G-4 structure was defined by Scheithauer y Terno[20] and it is a very
efficient packing structure for the PLP. Some examples appear in Figures 6,
7, 8(a). Most of the optimal solutions for the problem contain some type of
G-4 structure.
4
structures. This is a completely different approach from those already used
in other metaheuristic algorithms.
The move will consist of changing the size of a block of the solution. We
distinguish two types of moves:
• Block reduction
The size of a block is reduced horizontally or vertically by eliminating
some of its rows or columns. That includes the possibility that the
block may disappear completely.
The move starts by eliminating some of the rows or columns of the se-
lected block from the current solution, then resulting in the appearance
of a new region of waste, space not occupied by boxes. We move then
the remaining blocks towards the nearest corners of the pallet so that
waste is located mostly towards the center.
In order to reutilize the new waste, the first step is to merge the waste,
putting together the existing waste rectangles, new and old, in such a
way that the new space can be filled by the maximum number of boxes.
The waste rectangles are then filled, considering the horizontal or ver-
tical block or the G4-structure that best fills each of them . Finally,
adjacent blocks with the same structure are merged to simplify the so-
lution. Examples of reduction moves appear in Figures 1 and 2. In
Figure 1 a block is selected and reduced. None of the blocks is moved
to the corners, the wastes are merged and then filled in two steps to
produce a solution with more boxes. In Figure 2 the selected block dis-
appears, another block is moved to the bottom right corner, the waste
is merged and filled thereby producing a new solution which is optimal.
5
(a) Selection (b) Reduction (c) Filling
6
We now describe the procedures used in the moves:
7
Figure 5: Moving blocks towards the corners
8
Figure 6: Natural G4 structures for a 7 ∗ 3 box
tions of the length and width of the pallet. If this is not the case, we do
not choose the G4-structure. Proceeding in that way, it is possible that
no G4-structure with the same number of horizontal and vertical boxes
is left to be chosen. In this case, we consider structures with different
numbers of horizontal and vertical boxes, as appears in Figure 7.
9
(a) (b)
10
3.2 Reducing the number of moves to explore
If we have a block of dimension (n × m), we can do (n + m − 1) reductions
and, depending on the size of the pallet, a number of augmentations. From
all these possible moves, we are not going to study those considered not
promising, according to several criteria. In that way, we increase the speed
of the procedure, hopefully without a significant decrease in the quality of
the solutions.
• When we reduce or enlarge a block, we only explore the move if the new
block can form part of an efficient partition of the length and width of
the pallet.
• If the bottom left corner of the new block is not a rater point, we do
not consider the move.
• If the new block will produce more waste than that associated with the
best known solution, we do not explore the move.
3. For each type of move, consider all possible numbers of rows and
columns not eliminated by the criteria described above.
11
function, there will be many moves with the same evaluation. Therefore, we
have included other desirable characteristics of the solution in the evaluation
function, which are listed below ordered in decreasing importance:
• Waste in pallet sides. Solutions without waste in the sides of the pallet
are preferred.
• New boxes. We prefer a solution with some new boxes, rather than a
solution which is the same as the previous solution but eliminates some
of its boxes.
These criteria are added to the evaluation function with some weights
reflecting their relative importance, according to the results of a pre-
liminary computational experience on a subset of problems.
12
The aspiration criterion allows us to move to a tabu solution if it improves
the best solution obtained so far.
• Strategic oscillation
Our evaluation function has several terms whose relative importance
is controlled by a set of weights. These weights have been chosen for
having a good average behavior, but maybe they are not the most
appropriate for some particular instances. Therefore, we make them
oscillate in the following way:
We use a coefficient βi , i = 1, . . . 6 which multiplies every weight. Ini-
tially every βi = 1, i = 1, . . . 6. After a given number of iterations
without improving the best known solution, the coefficient oscillates
between 0 and 1.
13
4 Computational results
We have coded our algorithm in C++ and made our tests on a Pentium 4
at 2.0GHz. After every 100 iterations without improving the best known
solution we change the natural G-4 structure to be considered, if there is
more than one alternative. Also, the length of the tabu list changes every 100
iterations without improvement. After 10000 iterations without improving
we perform a strategic oscillation of the objective function coefficients and
after 9000 non-improving iterations we do a diversification phase based on
long term frequencies over 250 iterations and then an intensification phase
over 250 iterations.
All the 7827 classes of Cover I were solved to optimality in less than 250
iterations. That supposes less than 1 second of CPU time. The results for
the complete set Cover II, 40609 classes, appear in Table 4, which shows the
number of instances not optimally solved. A limit of 100000 iterations has
been imposed in order to keep the CPU time below the 10 minutes.
14
Figure 10: Instance (104,69,12,7) of Cover II
of them optimally, though in some cases the computational times are very
high (more than 360 minutes on a Pentium III at 700 Mhz). In fact, they
conjecture that their algorithm always finds optimal solutions for the pallet
loading problem. If this conjecture could be proven, the algorithm would no
longer be heuristic and its lengthy computational times should be compared
with other exact approaches.
On this subset of instances our Tabu Search algorithm has found the
optimal solution for all but one instance, (74,46,7,5), within the imposed
limit of 10 CPU minutes. Therefore, our algorithm seems to achieve a good
balance between solution quality and computational cost.
Finally, in order to explore the possible extension of our algorithm to
larger problems, we have generated what we have called Cover III, the set of
classes satisfying:
L a L∗W
1≤ ≤ 2, 1≤ ≤ 4, 101 ≤ < 151
W b a∗b
extending the structure of Cover I and Cover II to instances of up to 150
boxes. There are 98016 equivalence classes for which the optimal solution is
not known, but for which several upper bounds can be computed. For that
set, we are able to compare the solutions obtained by our heuristic and the
upper bounds. Table 4 shows the number of problems for which the solution
obtained by the heuristic does not match the corresponding upper bound.
These results allow us to conclude that the tabu search algorithm optimally
15
solves most of the classes of Cover III. Figure 11 shows a solution with 149
boxes.
5 Conclusions
We have developed a new Tabu Search algorithm which produces excellent
results for the whole sets Cover I and Cover II and which can be extended
to a new set Cover III of equivalence classes for problem instances of up to
150 boxes.
New types of moves have been defined. On the one hand, increasing and
decreasing blocks and on the other hand those which explicitly consider the
inclusion of G4-structures which have been shown to be very efficient for this
particular packing problem. These moves are embedded in an algorithmic
16
scheme combining diversification and intensification strategies. The results
show that these metaheuristic procedures can obtain good results in reason-
able computing times for large-size pallet problems. We are currently trying
to apply this type of ideas to more complex packing problems, involving
boxes of different sizes.
References
[1] Amaral A, Wright M (2001) Experiments with a strategic oscillation algo-
rithm for the pallet loading problem. International Journal of Production
Research 39-11: 2341-2351
[8] Dowsland KA (1987) An exact algorithm for the pallet loading problem.
European Journal of Operational Research 31: 78-84
17
[10] Dowsland KA (1996) Simple tabu thresholding and the pallet loading
problem. In: Osman IH, Kelly JP(Eds) Metaheuristics: theory and appli-
cations, Kluwer Academic Publishers, pp 379-406
[16] Letchford A, Amaral A (2001) Analysis of upper bounds for the Pallet
Loading Problem. European Journal of Operational Research 132: 582-593
[20] Scheithauer G, Terno J (1996) The G4-Heuristic for the Pallet Loading
Problem. European Journal of Operational Research 46: 511-522
18
[22] Steudel JH (1979) Generating pallet loading patterns: A special Case
of the two-Dimensional Cutting Stock problem. Management Science 25:
997-1004
19