# Solving Packing Problems by a Distributed Global Optimization Algorithm

Authors: Nian-Ze Hu; Han-Lin Li; Jung-Fa Tsai
Journal: Mathematical Problems in Engineering
 (2012)

---

## Abstract

Packing optimization problems aim to seek the best way of placing a given set of rectangular boxes within a minimum volume rectangular box. Current packing optimization methods either find it difficult to obtain an optimal solution or require too many extra 0-1 variables in the solution process. This study develops a novel method to convert the nonlinear objective function in a packing program into an increasing function with single variable and two fixed parameters. The original packing program then becomes a linear program promising to obtain a global optimum. Such a linear program is decomposed into several subproblems by specifying various parameter values, which is solvable simultaneously by a distributed computation algorithm. A reference solution obtained by applying a genetic algorithm is used as an upper bound of the optimal solution, used to reduce the entire search region.


---

## Body

## 1. Introduction

A packing optimization problem is to seek a minimal container, which can hold a given number of smaller rectangular boxes. This problem is also referred to as a container loading problem. Packing cartons into a container is concerning material handling in the manufacturing and distribution industries. For instance, workers in the harbor have to pack more than one type of cartons into a container, and they often deal with this problem by the rule of thumb but a systematic approach. Therefore, the utilization of the container is low, which will cause additional costs.Similar issues can be found in fields such as knapsack [1, 2], cutting stock [3, 4], assortment problems [5, 6], rectangular packing [7], pallet loading [8, 9], and container loading problems [10, 11]. In addition, researchers have dealt with various related problems. For instance, Dowsland [12] and Egeblad and Pisinger [1], He et al. [13], Wu et al. [14], de Almeida and Figueiredo [15], Miyazawa and Wakabayashi [16], and Crainic et al. [17] proposed different heuristic methods for solving three-dimensional packing problems, Chen et al. [10] formulated a mixed integer program for container loading problems, and Li and Chang [6] developed a method for finding the approximate global optimum of the assortment problem. However, Li and Chang’s method [6] requires using numerous 0-1 variables to linearize the polynomial objective function in their model, which would involve heavy computation in solving packing problems. Moreover, Chen et al.’s approach [10] can only find a local optimum of packing problems with nonlinear objective function. Recently, many global optimization methods have been developed, where Floudas’ method [18] is one of most promising methods for solving general optimization problems. Although Floudas’ method [18] can be applied to solve a packing problem to reach finite ε-convergence to the global minimum, it requires successively decomposing the concave part of the original problem into linear functions. Besides, it adopts lower boundary techniques, which is time consuming. Li et al. [19] designed a distributed optimization method to improve the computational efficiency for solving packing problems. Tsai and Li [20] also presented an enhanced model with fewer binary variables and used piecewise linearization techniques to transform the nonconvex packing problem into a mixed-integer linear problem, which is solvable to find a global solution.Due to the complexity and hardness of three-dimensional packing problems, most results on this topic are based on heuristics [21]. Furthermore, parallel computing [22] was adopted to improve the efficiency of combinatorial computation. Parallel Genetic Algorithm (GA) [23], parallel with heuristic [24], and parallel Tabu Search Algorithm (TSA) [25] were proposed to solve container-packing problems under some conditions. These methods are capable of obtaining solutions with good performance relative to test examples in the literature. However, the algorithms cannot guarantee to get a global optimum.This paper proposes another method for finding the optimum of the packing problem. The major advantage of this method is that it can reformulate the nonlinear objective function of original packing problem as an increasing function with single variable and two given parameters. In addition, distributed computation and genetic algorithm are adopted to improve the efficiency and ensure the optimality. The proposed method then solves the reformulated programs by specifying the parameters sequentially to reach the globally optimal solution on a group of network-connected computers.


## 2. Problem Formulation

Givenn rectangular boxes with fixed lengths, widths, and heights, a packing optimization problem is to allocate these n boxes within a rectangular container having minimal volume. Denote x, y, and z as the width, length, and height of the container; the packing optimization problem discussed here is stated as follows:
(2.1)minimizexyzsubjectto(1)allofnboxesarenonoverlapping.subjectto(2)allofnboxesarewithintherangeofx,y,andz.subjectto(3)x_≤x≤x¯,y_≤y≤y¯,z_≤z≤z¯subjectto(x_,y_,z_,x¯,y¯,z¯areconstants).According to Chen et al. [10], the current packing model adopts the terminologies as follows.(pi,qi,ri)
: Dimension of boxi, pi is the length, qi is the width, and ri is the height, and pi, qi, and ri are integral constants. i∈J, J={1,2,3,…,n} is the set of the given boxes.(x,y,z): Variables indicating the length, width, and height of the container.(xi,yi,zi): Variables indicating the coordinates of the front-left-bottom corner of box i.(lxi,lyi,lzi): Binary variables indicating whether the length of box i is parallel to the X-axis, Y-axis, or Z-axis. The value of lxi is equal to 1 if the length of box i is parallel to the X-axis; otherwise, it is equal to 0. It is clear that lxi+lyi+lzi=1.(wxi,wyi,wzi): Binary variables indicating whether the width of box i is parallel to the X-axis, Y-axis, or Z-axis. The value of wxi is equal to 1 if the width of box i is parallel to the X-axis; otherwise, it is equal to 0. It is clear that wxi+wyi+wzi=1.(hxi,hyi,hzi): Binary variables indicating whether the width of box i is parallel to the X-, Y-, or Z-axis. The value of hxi is equal to 1 if the height of box i is parallel to the X-axis; otherwise, it is equal to 0. It is clear that hxi+hyi+hzi=1.For a pair of boxes(i,k), where i<k, there is a set of 0-1 vector (aik,bik,cik,dik,eik,fik) defined asaik=1 if box i is on the left of box k, otherwise aik=0,bik=1 if box i is on the right of box k, otherwise bik=0,cik=1 if box i is behind box k, otherwise cik=0,dik=1 if box i is in front of box k, otherwise dik=0,eik=1 if box i is below box k, otherwise eik=0,fik=1 if boxi is above box k, otherwise fik=0.The front-left-bottom corner of the container is fixed at the origin. The interpretation of these variables is illustrated in Figure1. Figure 1 contains two boxes i and k, where box  i is located with its length along the X-axis and the width parallel to the Z-axis, and box k is located with its length along the Z-axis and the width parallel to the X-axis. We then have lxi, wzi, hyi, lzk, wxk, and hyk equal to 1. In addition, since box  i  is located on the left-hand side of and in front of box k, it is clear that aik=dik=1 and bik=cik=eik=fik=0.Figure 1
Graphical illustration.According to Chen et al. [10] and Tsai and Li [20], the packing problem can be formulated as follows.Problem 1.
(2.2)
Minimize
Obj
=
x
y
z
(2.3)
subject
to
x
i
+
p
i
l
x
i
+
q
i
w
x
i
+
r
i
h
x
i
≤
x
k
+
(
1
-
a
i
k
)
M
∀
i
,
k
∈
J
,
i
<
k
,
(2.4)
x
k
+
p
k
l
x
k
+
q
k
w
x
k
+
r
k
h
x
k
≤
x
i
+
(
1
-
b
i
k
)
M
∀
i
,
k
∈
J
,
i
<
k
,
(2.5)
y
i
+
p
i
l
y
i
+
q
i
w
y
i
+
r
i
h
y
i
≤
y
k
+
(
1
-
c
i
k
)
M
,
∀
i
,
k
∈
J
,
i
<
k
,
(2.6)
y
k
+
p
k
l
y
k
+
q
k
w
y
k
+
r
k
h
y
k
≤
y
i
+
(
1
-
d
i
k
)
M
,
∀
i
,
k
∈
J
,
i
<
k
,
(2.7)
z
i
+
p
i
l
z
i
+
q
i
w
z
i
+
r
i
h
z
i
≤
z
k
+
(
1
-
e
i
k
)
M
,
∀
i
,
k
∈
J
,
i
<
k
,
(2.8)
z
k
+
p
k
l
z
k
+
q
k
w
z
k
+
r
k
h
z
k
≤
z
i
+
(
1
-
f
i
k
)
M
,
∀
i
,
k
∈
J
,
i
<
k
,
(2.9)
a
i
k
+
b
i
k
+
c
i
k
+
d
i
k
+
e
i
k
+
f
i
k
≥
1
,
∀
i
,
k
∈
J
,
i
<
k
,
(2.10)
x
i
+
p
i
l
x
i
+
q
i
w
x
i
+
r
i
h
x
i
≤
x
,
∀
i
∈
J
,
(2.11)
y
i
+
p
i
l
y
i
+
q
i
w
y
i
+
r
i
h
y
i
≤
y
,
∀
i
∈
J
,
(2.12)
z
i
+
p
i
l
z
i
+
q
i
w
z
i
+
r
i
h
z
i
≤
z
,
∀
i
∈
J
,
(2.13)
l
x
i
+
l
y
i
+
l
z
i
=
1
,
∀
i
∈
J
,
(2.14)
w
x
i
+
w
y
i
+
w
z
i
=
1
,
∀
i
∈
J
,
(2.15)
h
x
i
+
h
y
i
+
h
z
i
=
1
,
∀
i
∈
J
,
(2.16)
l
x
i
+
w
x
i
+
h
x
i
=
1
,
∀
i
∈
J
,
(2.17)
l
y
i
+
w
y
i
+
h
y
i
=
1
,
∀
i
∈
J
,
(2.18)
l
z
i
+
w
z
i
+
h
z
i
=
1
,
∀
i
∈
J
,
where
(2.19)lxi,lyi,lzi,wxi,wyi,wzi,hxi,hyi,hzi,aik,bik,cik,dik,eik,fikare0-1variables,(2.20)M=max⁡{x¯,y¯,z¯},xi,yi,zi≥1,1≤x_≤x≤x¯,1≤y_≤y≤y¯,1≤z_≤z≤z¯,x_,y_,z_,x¯,y¯,z¯areconstants,(2.21)x,y,zarepositivevariables.The objective of this model is to minimize the volume of the container. The constraints (2.3)–(2.9) are nonoverlapping conditions used to ensure that none of these n boxes overlaps with each other. Constraints (2.10)–(2.12) ensure that all boxes are within the enveloping container. Constraints (2.13)–(2.18) describe the allocation restrictions among logic variables. For instance, (2.13) implies that the length of box  i  is parallel to one of the axes. (2.16) implies that only one of the length, the width, and the height of box  i is parallel to X-axis.Since the objective function of Problem1 is a product term, Problem 1 is a nonlinear mixed 0-1 program, which is difficult to be solved by current optimization methods. Chen et al. [10] can only solve linear objective function. Tsai and Li’s method [20] can solve Problem 1 at the price of adding many extra 0-1 variables.


## 3. Proposed Method

Consider the objective functionObj=xyz in (2.2), where x≥y≥z, 1≤x_≤x≤x¯, 1≤y_≤y≤y¯, 1≤z_≤z≤z¯ and x, y, z are positive variables.  Denote r and s as two variables defined as r=x-y+z, s=x-z. Replace y by 2x-s-r and replace z by x-s. xyz then becomes Obj′ as follows. 						(3.1)Obj′=x[2x2-(r+3s)x+rs+s2].
We then have the following propositions.Proposition 3.1.
Supposer and s in (3.1) are fixed values, then Obj′ is an increasing function.Proof.
Since∂Obj′/∂x=6x2-2x(r+3s)+rs+s2=xy+yz+2xz>0, it is clear that Obj′ is an increasing function.Proposition 3.2.
The optimal solution of Problem1 is integral.Proof.
Since dimensions of boxi, pi, qi, ri, are integral constants for i=1,2,…,n and all of  n  boxes are nonoverlapping, therefore, x*, y*, and z* that indicate the optimal solution of the container must be integral.Proposition 3.3.
∑
i
=
1
n
p
i
q
i
r
i
3
≤
(
x
+
y
+
z
)
/
3, where pi is the length, qi is the width, and ri is the height of the given box i. [19, 20]Proof.
Since∑i=1npiqiri≤xyz and xyz3≤(x+y+z)/3, then we can have ∑i=1npiqiri3≤(x+y+z)/3.According to the above propositions and given values ofr and s (denoted as r^ and s^), consider the following program.Problem 2.
(3.2)
Minimize
Obj
′
(
x
)
=
2
x
3
-
(
r
^
+
3
s
^
)
x
2
+
(
r
^
s
^
+
s
^
2
)
x
subject
to
∑
i
=
1
n
p
i
q
i
r
i
3
≤
x
+
y
+
z
3
,
subject
to
r
^
=
x
-
y
+
z
,
s
^
=
x
-
z
,
(
2.3
)
~
(
2.21
)
,
subject
to
r
^
and
s
^
are
fixed
values
.Proposition 3.4.
If(xΔ,yΔ,zΔ) is the solution of Problem 2 found by a genetic algorithm and (x*,y*,z*) is the globally optimal solution of Problem 2, then x*≤xΔ.Proof.
SinceObj′ is an increasing function with single variable x (following Proposition 3.1) and 2(x*)3-(r^+3s^)(x*)2+(r^s^+s^2)x*≤2(xΔ)3-(r^+3s^)(xΔ)2+(r^s^+s^2)xΔ. Hence, x*≤xΔ.Adding the constraintx≤xΔ to Problem 2 for reducing the search region of the optimal solution, we can have the following two programs.Problem 3.
(3.3)
Minimize
Obj
′
(
x
)
=
2
x
3
-
(
r
^
+
3
s
^
)
x
2
+
(
r
^
s
^
+
s
^
2
)
x
subject
to
x
≤
x
Δ
,
subject
to
r
^
=
x
-
y
+
z
,
s
^
=
x
-
z
,
(
2.3
)
~
(
2.21
)
,
(
3.2
)
,
subject
to
r
^
and
s
^
are
fixed
values
.Problem 4.
(3.4)
Minimize
x
subject
to
all
the
constraints
in
Problem
3
.Proposition 3.5.
Let (x*,y*,z*) be the global optimum of Problem 3, then (x*,y*,z*) is also the global optimum of Problem 4.Proof.
SinceObj′(x) is an increasing function with single variable x (following Proposition 3.1), Problems 2 and 3 have the same global optimum (x*, y*, z*).According to the above propositions, a packing optimization problem, which is a nonlinear 0-1 programming problem, can be transformed into a linear 0-1 program by introducing two parametersr and s. Then we can guarantee to obtain the global optimum of a packing problem by solving the transformed linear 0-1 programs. The distributed computation scheme is also proposed to enhance the computational efficiency.


## 4. Distributed Algorithm

The solution procedure for solving Problem1 to obtain a global optimum is presented in the following with a flow chart shown in Figure 2.Figure 2
Solution algorithm.Step 1.
(Find an initial solution by GA). From Proposition3.4, the obtained solution is (xΔ, yΔ, zΔ) and the constraint x≤xΔ can be utilized to reduce the searching space of the global solution.Step 2.
Denotes(m) and s(1) as the upper and lower bounds of s, respectively. Find the bounds of s=x-z by solving the following linear programs:
(4.1)s(m)=Max⁡{x-z∣subjectto(2.3)~(2.21),(3.2)},s(1)=Min⁡{x-z∣subjectto(2.3)~(2.21),(3.2)}.
Let x-z=s(i), i=m, and go to Step 3.Step 3.
Denoter(n) and r(1) as the upper and lower bounds of r, respectively. Find the bounds of r=x-y+z by solving the following linear programs:
(4.2)r(n)=Max⁡{x-y+z∣subjectto(2.3)~(2.21),(3.2),x-z=s(i)},r(1)=Min⁡{x-y+z∣subjectto(2.3)~(2.21),(3.2),x-z=s(i)},
Let r=r(j),j=1, and go to Step 4.Step 4.
Decompose main problem and perform distributed packing algorithm. According to verity ofr and s, the main problem can be decomposed into several subproblems. The transformed subproblem of each iterative process is listed as follows.ProblemPij.
(4.3)
Minimize
Obj
i
j
=
x
subject
to
(
2.3
)
-
(
2.21
)
,
(
3.2
)
,
(
3.3
)
,
x
-
z
=
s
(
i
)
,
x
-
y
+
z
=
r
(
j
)
,
subject
to
Obj
′
=
x
[
2
x
2
-
(
r
(
j
)
+
3
s
(
i
)
)
x
+
r
(
j
)
s
(
i
)
+
s
(
i
)
2
]
,
subject
to
1
≤
i
≤
m
,
1
≤
j
≤
n
.
Every sub-problem can be submitted to client computer and solved independently. Server computer controls the whole process and compares the solutions (xij, yij, zij) of the problem Pij with the initial solution (xΔ, yΔ, zΔ). If xij is smaller than xΔ, then xΔ is replaced by xij.
The structure of distributed packing algorithm is developed based on star schema. Owing to reduce the network loading and improve the computational performance of each client computer, all results found on all clients are directly sent to host computer.Step 5.
Letj=j+1. If j>n, then go to Step 6. Otherwise, go to Step 4.Step 6.
Leti=i-1. If i<1, then go to Step 3. Otherwise, go to Step 7.Step 7.
The whole process is finished and the host computer obtains the optimal solution(x*,y*,z*) with the objective value x*y*z*.


## 5. Numerical Examples

To validate the proposed method, several examples with different number of boxes are solved by LINGO 11.0 [26] with the distributed algorithm. Two of the test problems denoted as Problems 1 and 2 are taken from Chen et al. [10]. The other examples are arbitrarily generated. Solving these problems by the proposed method, the obtained globally optimal solutions are listed in Tables 1 and 3. Comparison results between GA and the proposed method are shown in Table 2, and the associated graphs are presented in Figures 3 and 4.Table 1
Computational results.
Problem number
Box number
p
i
q
i
r
i
x
i
y
i
z
i
(x,y, z)
Objective value
1
1
25
8
6
0
0
0
(28, 26, 6)
4368
2
20
10
5
8
0
0
3
16
7
3
8
10
2
4
15
12
6
16
11
0
2
1
25
8
6
10
20
0
(35, 28, 6)
5880
2
20
10
5
25
0
0
3
16
7
3
0
0
3
4
15
12
6
10
8
0
5
22
8
3
5
0
0
6
20
10
4
0
8
0
3
1
25
8
6
0
10
0
(31, 16, 12)
5952
2
20
10
5
0
0
0
3
16
7
3
9
0
9
4
15
12
6
25
0
0
5
22
8
3
3
7
9
6
20
10
4
0
0
5
7
10
8
4
31
0
0Table 2
Solution comparison of the proposed algorithm and genetic algorithm (GA).
Problem number
GA
Proposed method
(x, y,z)
Objective value
(x, y,z)
Objective value
1 (4 boxes)
(30, 30, 6)
5400
(28, 26, 6)
4368
2 (6 boxes)
(33, 26, 7)
6006
(35, 28, 6)
5880
3 (7 boxes)
(25, 25, 10)
6250
(31, 16, 12)
5952Table 3
Computational results for all boxes are cubic.
Problem number
Number of cubes
Sidepi×qi×ri
(x, y, z)
CPU time (h:min:s)
Objective value
4
3
1
×
1
×
1
(8, 5, 5)
00:00:08
200 Global optimum
3
2
×
2
×
2
1
3
×
3
×
3
1
5
×
5
×
5
5
4
1
×
1
×
1
(8, 6, 5)
00:01:26
240 Global optimum
2
2
×
2
×
2
3
3
×
3
×
3
1
5
×
5
×
5
6
4
1
×
1
×
1
(8, 8, 5)
00:10:12
320 Global optimum
3
2
×
2
×
2
4
3
×
3
×
3
7
4
1
×
1
×
1
(12, 7, 5)
01:37:44
420 Global optimum
3
2
×
2
×
2
3
3
×
3
×
3
1
4
×
4
×
4
1
5
×
5
×
5Figure 3
The graphical representation of 4 boxes.Figure 4
The solid graphical representation of 6 boxes.Packing problems often arise in logistic application. The following example (Problem5) demonstrates how to apply the proposed algorithm in transportation problem and compare the result with traditional genetic algorithm.Problem 5.
Several kinds of goods are packed into a container so as to deliver to 6 different stores on a trip. The dimensions of width and height of the container are 5 and 4. All goods are packed in cubic boxes, which have three different sizes. In order to take less time during unloading, boxes sent to the same store must be packed together. Different groups of boxes cannot overlap each other. Moreover, the packing order to each group must be ordered of the arriving time to each store. The boxes required to be sent to each store are listed in Table4. The objective is to determine the smallest dimensions of the container.Table 4
List of stores and boxes (48 boxes).
Store
Goods
S1
A, A, A, B, B, B, B, C
S2
A, A, B, B, B, B, C, C
S3
A, A, A, B, B, B, B, C
S4
A, A, B, B, B, C, C, C
S5
A, A, A, A, B, B, B, C
S6
A, A, A, A, A, B, C, C
A: 1-inch cubic box; B: 2-inch cubic box; C: 3-inch cubic box.Solution 1.
The arrangement of boxes can be treated as level assortment. The boxes packed in the same level will be delivered to the same store. After performing the proposed method, list of the optimal solutions are shown in Table5, and illustrated graph is presented in Figure 5.Table 5
List of optimal arrangement of the boxes.
Store
S1
S2
S3
S4
S5
S6
(
x
1, y1, z1)
A (1, 2, 0)
A (0, 1, 3)
A (4, 0, 2)
A (0, 0, 3)
A (4, 0, 0)
A (0, 0, 0)
(x2, y2, z2)
A (3, 3, 3)
A (5, 0, 0)
A (0, 1, 0)
A (0, 2, 3)
A (4, 1, 3)
A (5, 2, 0)
(x3, y3, z3)
A (0, 4, 0)
B (3, 0, 0)
A (1, 2, 0)
B (3, 0, 1)
A (0, 2, 0)
A (0, 3, 0)
(x4, y4, z4)
B (4, 0, 0)
B (1, 0, 2)
B (3, 0, 0)
B (7, 0, 1)
A (4, 4, 1)
A (2, 4, 0)
(x5, y5, z5)
B (0, 0, 1)
B (3, 0, 2)
B (0, 3, 0)
B (1, 0, 2)
B (2, 0, 0)
A (5, 1, 0)
(x6, y6, z6)
B (2, 0, 0)
B (1, 0, 0)
B (1, 0, 2)
C (0, 2, 0)
B (2, 0, 2)
B (3, 0, 2)
(x7, y7, z7)
C (0, 2, 1)
C (0, 2, 0)
B (0, 3, 2)
C (6, 2, 0)
B (0, 0, 2)
C (0, 1, 1)
(x8, y8, z8)
C (3, 2, 0)
C (3, 2, 0)
C (2, 2, 1)
C (3, 2, 0)
C (1, 2, 0)
C (3, 2, 1)
Dimension ofsi
6
×
5
×
4
6
×
5
×
4
5
×
5
×
4
9
×
5
×
4
5
×
5
×
4
6
×
5
×
4
Volume ofsi
120
120
100
180
100
120
The global solution is (37, 5, 4), and the minimal volume of the container is 740.Figure 5
The graphical presentation of the 48 boxes for the 6 stores.


## 6. Conclusions

This paper proposes a new method to solve a packing optimization problem. The proposed method reformulates the nonlinear objective function of the original packing problem into a linear function with two given parameters. The proposed method then solves the reformulated linear 0-1 programs by specifying the parameters sequentially to reach the globally optimal solution. Furthermore, this study adopts a distributed genetic algorithm and distributed packing algorithm to enhance the computational efficiency. Numerical examples demonstrate that the proposed method can be applied to practical problems and solve the problems to obtain the global optimum.



---

*Source: 931092-2012-07-18.xml*