An Efficient Algorithm For 3D Rectangular Box Packing
An Efficient Algorithm For 3D Rectangular Box Packing
2009
Published by the Society for ETAI of Republic of Macedonia, Skopje, 2009
Abstract: Getting highest occupancy rate of capacity of a container is very important for the companies,
which deals in shipping or has shipping as a part of their main activities. They have to fit 3D boxes in
container with optimum or nearest to optimum placement in order to ship more products with a minimum
cost. The problem of fitting the boxes which is different from or the same to each other into a big
container in optimum level, is called 3-dimensional packing problem. In this problem, the main objective
is to minimize used container volume or wasted container space. This provides the reduction of costs in
shipments with the use minimum number of containers. Copyright © 2009 Authors & ETAI Society
Keywords: Packaging, optimization problems, three-dimensional packing, combinatorial problem,
transportation.
width and depth of the container is computed by considering
1. INTRODUCTION
the size of boxes to be placed.
The best utilization of capacity of a vehicle reduces the
In this paper, we propose a new heuristic algorithm to solve
number of vehicles used in a shipment. This is very important
3D packing problem. This is organized as follows: Section 2
for companies especially deal in transportation and/or
gives a mathematical model of the problem.
exporting. In order to transport more packages with less
number of vehicles, boxes should be packed optimally or
2. PROPOSED ALGORITHM
near optimally. So, this helps to reduce the transportation
costs. The problem of packing all boxes into a container is In this section, we first define the inputs and outputs for the
called 3D packing problem. The 3D packing problem is very algorithm with our assumptions and then describe the
complicated. If number of boxes increases, the complexity of proposed algorithm. The algorithm is called Largest Area
the problem increases with nondeterministic polynomial time First-Fit (LAFF) minimizing height. The algorithm places the
George and Robinson (1980). Therefore, the packing problem boxes with largest surface area first by minimizing height
is a type of NP-Hard problem. from the bottom of the container.
For the solution method of 3D packing problem, many
different methods are suggested by George and Robinson 1.1 Inputs for LAFF Algorithm
(1980), NGoi et.al. (1994), Eley (2002) and Pisinger (2002).
Data structures methods (Brunetta and Gre’goire (2005)), The first input is the number of different sized boxes denoted
some meta-heuristic methods like genetic algorithm (Gehring it by N. The second input is the dimensions for each type of
and Borthfeldt (1997)), simulated annealing (Lai and Chan different sized boxes. We denote this input parameter with
(1996)), some heuristic methods (Fareo at.al. (1999)) and four values (an, bn, cn, kn) where an is width, bn is depth, cn
some other efficient algorithms (faina(1999) and Mal et.al. is height and kn is the number of boxes for a given size.
(2005)) is suggested to solve this problem.
Depending upon how you view a box, each dimension can be
3D packing problem is usually solved using optimization and considered as width, height or depth. If you assume bn as
heuristics methods. Some studies assume an unlimited width, other dimensions an and cn can be accepted as height
capacity for a container and try to solve 3D packing problem or depth as well. Because, the box is three dimensional and it
with similar or different sized boxes from each other can be rotated and be viewed from different perspectives. The
(Martello et.al. (1997)). Some researchers consider other following lists the input parameters of the proposed
measures such as shipment of boxes that are more profitable algorithm:
than others boxes. In this case, the more profitable boxes
Number of different sized Boxes ..... : N
have a priority to be placed into containers (Fareo et.al.
Width of nth box ............................. : an
(1999)). Some researchers also accept one of dimensions
Depth of nth box ............................. : bn
unlimited and the others fixed (Fareo et.al (1999)). In this
Height of nth box ............................ : cn
paper, we assume an unlimited height for a container. The
131
Applied Automatic Systems: Proceedings of Selected AAS 2009 Papers, Ohrid 26-29.09.2009
Published by the Society for ETAI of Republic of Macedonia, Skopje, 2009
Number of nth box........................... : kn in the container. The largest surface of the selected box
should be parallel to the bottom of the container (Fig. 1).
1.2 Outputs for LAFF Algorithm
132
Applied Automatic Systems: Proceedings of Selected AAS 2009 Papers, Ohrid 26-29.09.2009
Published by the Society for ETAI of Republic of Macedonia, Skopje, 2009
k
p
p 0
where k is constant.
1.4 The LAFF Algorithm
Therefore, the complexity of the algorithm is
The main steps of the LAFF algorithm are summarized
below: 4. COMPUTATIONAL EXPERIMENTS
Step1: Input box dimensions and numbers. We tested the program with several numbers of boxes with
N: number of unique boxes. different sizes in order to see practical performance of the
algorithm. The program generates random boxes with
Step2: Determine the width(ak) and depth(bk) of different sizes as an input and then places the boxes into the
container. Table 1 shows the results of experiments. The first
The container. column (A) is the number of different types of boxes. The
second column (B) is the total number of boxes. The third
ak : First longest edge of all boxes.
column (C) is the volume of all placed boxes. The forth
bk : Second longest edge of all boxes. column (D) is the volume of constructed container. Finally,
the last column (E) shows the percentage amount of the
ck : 0 (zero). wasted space. The algorithm tries to place boxes in a best
way. The amount of the wasted space is considerably low. As
Step3: Chose the box which has the widest surface area. If
it can be seen from the table, when the types of boxes
there is more than one, chose the box which has minimum
increase, the wasted space will also increase. Because, it is
height. Place this box (ith) on the largest surface parallel to
more difficult to place the different sized boxes into the
the base of container.
container than that of the same sized boxes.
Step3.1: Determine the height of container and decrement the
number of ith box. Table 1. Sample box placement results
Number of Total Volume Volume of Waste
ck=ck+ ci Different Number of Container (%)
Boxes of placed
ki=ki-1 Boxes Boxes
(A) (B) (C) (D) (E)
Step3.2: if the number of Boxes is zero then terminate. 1 10 8400 8400 0
1 20 12480 12480 0
k p 0 2 5 2547 2610 2,41
p 2 10 6252 6480 3,52
2 15 25554 25920 1,41
Step 3.3: if the space (ak-ai)=0 and (bk-bi)=0 then go to Step 2 20 49032 49320 0,58
3. Otherwise, chose the box which fits into this space. If there 5 5 3910 5100 23,3
5 10 11359 13680 16,97
is no box that fits into this space, go to Step 3. If there is 5 20 22596 25840 12,55
more than one box that fits into this space, chose the box 10 10 13419 19200 30,11
which has the biggest volume. It called jth box. 10 20 21694 27740 21,80
10 30 12854 16800 23,49
Step3.3.1: Determine the dimension of the space.
as = ak–ai –aj ve bs = max(bk–bi, bk–bj ) The program is coded with C programming language. The
coded program is run in a computer on with the following
or
configuration: Intel Core Duo 1.73 GHZ CPU 1536 MB
as = max(ak–ai, ak–aj ) and bs = bk–bi–bj Ram. The Program executes very fast. The execution time of
all experiments is below 16 milliseconds. We also tested the
133
Applied Automatic Systems: Proceedings of Selected AAS 2009 Papers, Ohrid 26-29.09.2009
Published by the Society for ETAI of Republic of Macedonia, Skopje, 2009
program with 10000 boxes with 20 different sizes. In this L., Faina (1999), “A global optimization algorithm for the
case, the program execution time is about 380 milliseconds. three-dimensional packing problem”, European Journal
of Operational Research, 126, 340-354.
5. CONCLUSION O., Fareo, D., Pisinger, M., Zachriasen (1999), Guided Local
Search for the Three-dimensional Bin Packing Problem.
The 3D packing problem is a well-known NP hard problem, Technical Report 99-13, Dept. of Computer Science,
which is too complex to be solved exactly in polynomial University of Copenhagen, Copenhagen, DK.
time. This paper presents a heuristic algorithm for the 3D H., Gehring, A., Bortfeldt (1997), “A genetic algorithm for
packing problem. The proposed algorithm uses a heuristics solving the container loading problem.” International
strategy that places the boxes with largest surface area first Transactions in Operational Research, 4 (5/6), pp. 401-
by minimizing height from the bottom of the container. This 418.
algorithm assumes that the height of the container is J. A. George and D.F. Robinson (1980), “A heuristic for
unlimited and there is no restriction on the orientation of packing boxes into a container.” Computer and
boxes, that is, all boxes can be rotated around any of the three Operations Research, 7 (3), 147-156.
dimensions. K. K. Lai, J.W.M., Chan (1996), “Developing a Simulated
Annealing Algorithm for the cutting stock problem.”
Several conclusions can be drawn from the proposed
Computers and Industrial Engineering, 32 (1), 115-127.
heuristic algorithm and experiments. The proposed algorithm
Y. Mal, X., Hong, S., Dong, C.K., Cheng (2005), “3D CBL:
is an efficient algorithm which is the running time in the
An Efficient Algorithm for General 3-Dimensional
order of . The amount of wasted space is also in Packing Problems.” Midwest Symp. on Circuits and
acceptable ranges. Systems,pp. 1079-1082
As a future work, other parameters such as weight of boxes, S. Martello, D., Pisinger, D., Vigo (1997), “Three
the distribution of the weight in a container, the use of dimensional bin packing problem”, Technical Report
DEIS-OR-97-6, Bologna University.
multiple containers, the order of shipment of boxes can be
B. K. A. NGoi, M. L. Tay, and E. S. Chua (1994), “Applying
considered to develop new algorithms.
spatial representation techniques to the container packing
problem.” International Journal of Production Research,
6. REFERENCES
32 (1), 111-123.
L., Brunetta, P., Gre’goire (2005), “A general purpose D. Pisinger (2002), “Heuristics for the container loading
algorithm for three-dimensional packing.” INFORMS problem.” European Journal of Operational Research,
Journal on Computing, vol.17, pp. 328-338 141 (2), 382-392.
M. Eley (2002), “Solving container loading problems by
block arrangement.” European Journal of Operational
Research, 141 (2), 393-409.
134