Approximating Smallest Containers for Packing Three-dimensional Convex Objects

We investigate the problem of computing a minimal-volume container for the non-overlapping packing of a given set of three-dimensional convex objects. Already the simplest versions of the problem are NP-hard so that we cannot expect to find exact polynomial time algorithms. We give constant ratio approximation algorithms for packing axis-parallel (rectangular) cuboids under translation into an axis-parallel (rectangular) cuboid as container, for cuboids under rigid motions into an axis-parallel cuboid or into an arbitrary convex container, and for packing convex polyhedra under rigid motions into an axis-parallel cuboid or arbitrary convex container. This work gives the first approximability results for the computation of minimal volume containers for the objects described.


Introduction
The problem of efficiently packing objects arises in a large variety of contexts. Apart from the obvious ones, where concrete objects need to be packed for transportation or storage, there are more abstract ones, for example cutting stock or scheduling. Given a set of objects that have to be cut out from the same material the objective is to minimize the waste, i.e., place the pieces to be cut out as close as possible. In the case of scheduling, a list of jobs is given. Each job needs a certain amount of given resources and the aim is to minimize under certain constraints this need of resources such as time, space, or number of machines. Altogether, this situation can be described as a problem of packing high-dimensional cuboids into a strip with * alt@mi.fu-berlin.de † nadja.scharf@fu-berlin.de This research was partially funded by DFG (Deutsche Forschungsgemeinschaft) under grant no. AL253/7-2. bounded side lengths. So, both problems can be viewed as a given list of objects for which a container of minimal size is wanted.
In this work, we consider the more general and abstract problem of packing three-dimensional convex polyhedra into a minimum volume container. All variants of this problem are NP-hard and we will develop constant factor approximation algorithms for some of them. The worst case constant factors are still very high, but probably they will be much lower for realistic inputs. The major aim of this paper, however, is to show the existence of constant factors at all, i.e., that the problems belong to the complexity class APX.

Related Work
So far, there are only few results about finding containers of minimum volume. Related problems include strip packing and bin packing. In two-dimensional strip packing the width of a strip is given and the objects should be packed in order to minimize the length of the strip used. In three dimensions, the rectangular cross section of the strip is fixed. Bin-packing is the problem where the complete container is fixed and the objective is to minimize the number of containers to pack all objects. For both problems usually only translations are allowed to pack the objects.
For two-dimensional bin packing there exists an algorithm with an asymptotic approximation ratio of 1.405 [3] and Bansal et al. proved that there cannot be an APTAS unless P = N P [2]. For two-dimensional strip packing there exists an AFPTAS [7]. In three dimensions there are algorithms with an asymptotic approximation ratio of 4.89 for bin packing [9] and an asymptotic approximation ratio of 3 2 + ε for strip packing [6]. The best known worst case approximation ratio for three-dimensional strip packing is 29 4 [5]. For two dimensions, von Niederhäusern [10] gave algorithms for packing rectangles or convex polygons in a minimal-area rectangular container with approximation ratios 3 and 5 respectively. A recent result shows that packing convex polygons under translation into a minimum-area rectangular or convex container can be approximated with ratios 17.45 and 27 respectively [1].
PARTITION can be reduced to one-dimensional bin packing and one-dimensional bin packing is a special case of higher dimensional bin or strip packing. If one-dimensional bin packing could be approximated with a ratio smaller than 3 2 , we could solve PARTITION. Therefore, none of the mentioned problems can be approximated better than with ratio 3 2 unless P = N P. PARTITION can also be reduced to our problem showing N P-hardness.

Our Results
In this work we give the first approximation results for packing three-dimensional convex objects in a minimum-volume container. For packing axis-parallel rectangular cuboids under translation into an axis-parallel rectangular cuboid as a container, we achieve a 7.25 + ε approximation. If we allow the cuboids to be packed under rigid motions (translation and rotation) then we achieve an approximation ratio of 17.737 for an axis-parallel cuboid as container and an approximation ratio of 29.135 for an arbitrary convex container. For packing convex polyhedra under rigid motions we achieve an approximation ratio of 277.59 for computing an axis-parallel cuboid as container and 511.37 for a convex container.

Preliminaries and Notation
For most algorithms considered here, the input is a set of rectangular boxes B = {b 1 , b 2 , . . . b n }. We denote a box b i in axis-parallel orientation by a tuple of its height, width and depth For points P and Q we denote by P Q the line segment between P and Q of length P Q . → P Q denotes the vector from P to Q. When we write "axis-parallel container" we mean "axis-parallel rectangular cuboid as a container". We use the term box as a synonym for rectangular cuboid. Definition 2.2 (orthogonal minimal container packing-OMCOP). An instance of this problem is a set of convex polyhedra. The aim is to pack these polyhedras non-overlapping such that the minimal axis-parallel container has minimal volume. Variants include the kind of motions allowed or that more specialized objects are to be packed.
This work only considers algorithms in two or three dimensions. For ease of notation we always assume the lower left (front) corner of the container to lie in the origin. V opt denotes the minimal possible volume for a container.
The following algorithm was given by von Niederhäusern [10]. It will be used later as a subroutine. For an example see Figure 1.
Algorithm 1: Input: A list S of rectangles r i , denoted by their width w i and height h i , a width for the strip w 1. Order the rectangles in S by decreasing width, such that if i < j then Start with packing the rectangles in S 1 on top of each other in the strip [0, w] × [0, ∞). 4. Split the remaining strip in two substrips with width w 2 and pack the rectangles in S 2 one after another into these substrips. r i is packed in the substrip with current minimal height. 5. Again split the substrips into two and pack S 3 . Iterate that process until everything is packed.
Remark 1. Note that the strip is half filled with rectangles up to the lower boundary of the highest rectangle that touches the upper end of the packing. Otherwise,this rectangle could have been placed lower. That means that the strip is half filled with rectangles except for a part with area at most w ⋅ h max .

Reduction from 3D-OMCOP to Strip Packing
In this section we consider the version of OMCOP where the given objects are axis-parallel boxes that are to be packed under translation. The idea behind the reduction of OMCOP to strip packing is to test different base areas for the strip and to return the result with minimal volume. Assuming that the lower left corner of the base area is located at the origin, we test each point in a set S as a possible upper right corner for the base area. Testing means that we call a strip packing algorithm with the given boxes and the base area implied by the point of S. S will be determined by a parameter ε: the smaller ε, the more elements S contains, the better the approximation ratio gets. Note that for the width W opt of an optimal container, the following inequalities hold: 1. W opt ≤ W ∑ , where W ∑ denotes the sum of all widths of the boxes to be packed. It is an upper bound because the width of an optimal container has to be the sum of width of some of the objects. Otherwise they can be pushed together reducing the width of the container and thereby its volume.
2. W opt ≥ w max , where w max denotes the width of the widest box. Since this box needs to be packed, this is a lower bound for the width of the container.
The analogous bounds for the depth of an optimal container hold for the same reasons. In the following H opt , W opt and D opt denote the height, width and depth of the same optimal container. Let ε ′ = ε 2(ε+α) for a constant α defined later. The set S is obtained by dividing the intervals of possible width and depth logarithmically.
For an example for S see Figure 2.
Theorem 1. If we use an α-approximation algorithm to pack the boxes under translation into the strips and the set S defined above, we obtain an (α + ε)approximation for the OMCOP variant where n axis aligned boxes are to be packed under translation.
where T (n) is the runtime of the α-approximation algorithm for strip packing.
Eventually the boxes will be packed in Since the extensions of the base area are at least the ones for an optimal container, we obtain a packing with height H ≤ αH opt . The associated container has volume V with The size of S is and therefore we get the desired running time.
If we use the algorithm given by Diedrich et al. [5] to pack the boxes into the strips, we obtain the following corollary.
There exists a (7.25 + ε)-approximation algorithm for packing axisparallel boxes under translation into a minimal volume axis-parallel box with running time polynomial in both the input size and 1 ε .

Algorithms for Variants of OMCOP
In this section, we will give algorithms for variants of OMCOP. The basic idea is to get rid of the third dimension by dividing the set of objects into sets of objects with similar height and then packing those using an algorithm for two-dimensional boxes. These containers then get cut into pieces with equal base area and the pieces will be stacked on top of each other.

Packing Cuboids under Translation
Even though this algorithm gets outperformed by the construction in the previous section, we state it here as base for the algorithms for the other variants.
Algorithm 2: Input: Set of axis parallel boxes B = {b 1 , . . . , b n }, parameter ε, parameter c 1. Partition B into subsets of boxes that have almost the same height:    Proof. Let D j denote the depth of the strip obtained in step 2 for the boxes in B j . Then we get by step 3 ⌈ D j −dmax (c−1)dmax ⌉ pieces. After step 4 each piece has volume c ⋅ d max w max h max (1 − ε) j−1 . Consider the total volume V j of the pieces obtained for the subset B j : We know from the two-dimensional packing algorithm that the base area of the strip is half filled with boxes except for the last part of depth d max (Remark 1), so We also know that for every b i ∈ B j the inequality h max (1 − ε) j−1 < h i 1−ε holds. Therefore, we get for the total volume of the packing V that The factor before V opt in term (2) is minimized if the partial derivatives with respect to c and ε are 0. Solving the resulting system of equations we get c = 3 √ 2 + 1 and ε = 1 This gives an approximation ratio of 3

Packing Cuboids under Rigid Motions
Now we consider the variant of OMCOP where the objects to be packed are boxes and rigid motions are allowed. We basically use the algorithm stated above but with an extra preprocessing step, namely rotating every box b i ∈ B such that it becomes axis parallel and h i ≥ w i ≥ d i . This can be done in O(n) time. To prove the performance bound of this algorithm we need the following lemma.
Proof. Since an optimal container has to contain the box determining h max , it contains a line segment of length h max . The projection of that line segment on at least one of the axes has to have length at least 1 √ 3 h max . W.l.o.g. let this axis be the x-axis. Therefore, the optimal container has an expansion of at least 1 Since every box is higher then wide, a box with width w max contains a disk D with diameter w max and so the optimal container does. Observe that D contains a diametric line segment l which is parallel to the y-z-plane. Consequently, the projection of l and therefore the one of the whole box on the y-axis or on the z-axis has a length of at least 1 √ 2 w max . W.l.o.g. let this be the y-axis. A box with depth d max contains a sphere with diameter d max . The projection of this sphere on any axis has length at least d max .
Summarizing, each optimal box has volume at least 1 Observe that every argument leading to inequality (1) still holds for this variant of the algorithm. Using Lemma 4 to estimate h max ⋅ w max ⋅ d max we get an approximation factor of Minimizing this expression as before yields the following theorem.

Convex Container
If we allow a convex container instead of an orthogonal container, we can use the same algorithm but adapt the analysis. The arguments leading to inequality (1) still hold since they only use the total volume of the boxes as estimate for the volume of an optimal container. To estimate h max ⋅ w max ⋅ d max , we use the following lemma. Note that V opt here denotes the volume of a minimal convex container instead of an axis parallel container.
Proof. Consider the line segment, disk and sphere from the proof of Lemma 4. The line segment has length h max . The disk with diameter w max contains a line segment of length w max that is perpendicular to the first line segment. The sphere with diameter d max contains a line segment of length d max that is perpendicular to the first two line segments. It is well known (see, e.g., Lemma 6 from [8]) that the convex hull of these three line segments has a volume of at least 1 6 h max w max d max .
This leads with inequality (1) to the following approximation ratio: Minimizing this term as before yields the following theorem.
Theorem 7. Using the algorithm described in section 4.2 we get a 29.135-approximation for packing n axis parallel boxes under rigid motions into a smallest-volume convex container in time O(n log n).

Packing Convex Polyhedra under Rigid Motions
We use the algorithm from the previous sections to pack convex polyhedra under rigid motions into an axis-parallel box of minimal volume. To do so, we add another preprocessing step where we compute a bounding box for every polyhedron according to the following lemma. We then pack these boxes with the algorithm discussed in the previous section.
where m is the number of vertices of K.
Proof by induction over n. In two dimensions, the minimal enclosing rectangle has at most twice the area of the contained polygon.
In higher dimensions n, let P, Q be two points of K with maximum distance and P Q = l. Let π p be the hyperplane normal to P Q in the point P . Let K ′ be the orthogonal projection of K onto π p . By the inductive hypothesis there is a (n − 1)-dimensional box B ′ containing K ′ for which where V ′ denotes the (n − 1)-dimensional volume. Then K is contained in the box B with base B ′ and height l.
It is well known (see e.g. [8]) that for any convex body K, its projection K ′ on some hyperplane π P , and a line segment l perpendicular to π P , it holds: V (K) ≥ The construction in the proof of Lemma 8 is the same as in Lemma 7 from [8]. We get a total running time of O m 2 for computing the bounding boxes of threedimensional polyhedra with m vertices in total since the dimension is fixed.
For the analysis of the algorithm presented in this section we need several notations and lemmata that follow. Consider the box b = (h, w, d) with h ≥ w ≥ d obtained from the polyhedron p by Lemma 8. Notice that in every facet of b lies at least one point contained in p. We call the top and bottom one T and B. In the left and right facet of b, we choose a point each and call them L and R. By construction, the distance from them to the front facet has to be the same. We do the same for the front and rear facet and call them F and D respectively. We know from the construction that T B = h and T B is parallel to the longest edge of b. If we project the polyhedron onto a plane perpendicular to T B, we call the images of T , L, R, F and D under the projection T ′ , L ′ , R ′ , F ′ and D ′ , respectively. See Figure 4 for illustration. Due to the construction of b, L ′ R ′ = w holds. . If we choose a plane parallel to the given one, such that the intersection between the plane and △(T, B, L) contains T , B or L but is not only one point, then we know that the intersection is at least a line segment with length min (a t , a b , a l ) ≥ w . We only show that a b ≥ w √ 5 since the proof for a t is analogous. Figure 5b depicts possible triangles with given distance T B and height a l . a b is the distance between B and the line defined by T and L. Since β ≤ 90°this distance is minimal for β = 90°.
Let A be the area of △(T, B, L) with β = 90°.
with h ≥ w ≥ d be the enclosing box obtained for a polyhedron p. Then the projection of p onto an arbitrary line g has length at least Proof. We construct four line segments inside of p such that the projection of at least one of them onto the line has the desired length. Consider the projection of p onto a plane perpendicular to T B as described above (Figure 4). Then △(L ′ , R ′ , F ′ ) or △(L ′ , R ′ , D ′ ) has an area A ≥ dw 4 . The perimeter of the projection of the box, namely 2(w + d), gives an upper bound for the perimeter U of the triangles. It is well known (see ,e.g., [4]) that the radius of a triangle with area A and perimeter U is r = 2A U . Hence, we know that the projection of p contains a circle with radius r where See Figure 6a for an example. Now we can find points U ′ , V ′ , W ′ in the projection, such that U ′ , V ′ , W ′ lie on the circle with radius r and T ′ V ′ = k ≥ r, U ′ W ′ = l = 2r and T ′ V ′ ⊥ U ′ W ′ . To obtain V ′ , we shoot a ray from T ′ through the center of the circle until we hit the circle and call this point V ′ . U ′ W ′ is the diameter of the circle perpendicular to T ′ V ′ . See Figure 6b for an example.
Let U , V , W be preimages of U ′ , V ′ , W ′ under the projection. Hence, they lie inside p. The line segments whose projections on the given line g we consider are BT , BV , V T and W U .
The length of the projection of a line segment onto g is the scalar product of the vector between the endpoints of the line segment and a unit vector with same direction as g. To simplify the computation of the scalar product, we define the coordinate system as follows: B is equal to the origin. T lies on the z-axis. The y-coordinate of V is 0. Then U and W have the same x-coordinate. Now we have be the direction of g in the defined coordinate system, with → g = 1. We now look at the lengths of the projections of the line segments onto the given line.
From Lemma 8 we know that the volume of the smallest enclosing box for a polyhedron is at most 6 times the volume of the polyhedron. With the previous lemma and this knowledge we derive the following approximation ratio from inequality (1): 12c The running time of this algorithm is determined by the computation of the bounding boxes and the packing of these boxes: O m 2 + n log n where m is the total number of vertices of the polyhedra. Hence, we get by minimizing term (3) as before the following theorem.
Theorem 12. The given algorithm computes an orthogonal container with volume at most 277.59 times the volume of an orthogonal minimal container for the variant of three-dimensional OMCOP where n convex polyhedra having m vertices in total are to be packed under rigid motions in time O m 2 + n log n .

Convex Container
If we allow arbitrary convex containers instead of axis parallel boxes we get the following lemma instead of Lemma 11: Lemma 13. For packing convex polyhedra under rigid motions into a minimumvolume convex container, the following inequality holds: Proof. As before let p 1 , p 2 , p 3 be the polytopes that determine h max , w max and d max . that is perpendicular to the first two lines. Since any convex body containing three pairwise perpendicular line segments of length a, b, c has volume at least 1 6 abc (cf. Lemma 6 in [8]), we get a lower bound on the volume of the convex hull which is also a lower bound for the volume of an optimal container. As before we use Lemma 8 and the previous lemma to estimate inequality (1) and optimize the following approximation ratio: By minimizing this term as before, we yield the following result.
Theorem 14. The algorithm given in Section 4.3 computes a convex container with volume at most 511.37 times the volume of a minimal convex container for packing n convex polyhedra having m vertices in total under rigid motions in time O m 2 + n log n .