Online packing of d-dimensional boxes into the unit cube

Any sequence of d-dimensional boxes of edge length smaller than or equal to 1 with total volume not greater than (3-22)·3-d\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$(3-2\sqrt{2})\cdot 3^{-d}$$\end{document} can be packed online into the d-dimensional unit cube.


Introduction
We say that a collection of d-dimensional boxes (i.e., rectangular parallelepipeds) can be packed into the d-dimensional unit cube I d (i.e., a cube of edges of length 1) if the boxes can be rotated and translated so that they are subsets of I d and that they have pairwise disjoint interiors. When boxes arrive one by one and each box that has arrived must be packed (without any information about the size of next boxes) and cannot be moved thereafter, the packing method is called online. We focus on the problem of online packing of d-dimensional boxes into the unit cube.
Denote by b d [by c d , respectively] the greatest number such that any sequence of ddimensional boxes [cubes, respectively] of edge length smaller than or equal to 1 and of total volume not greater than b d [than c d , respectively] can be packed online into I d .
More is known for offline packing. Moon and Moser [13] proved that any collection of squares with total area not greater than 1/2 can be packed offline into a unit square, which is tight. Moser [14] conjectured also that a similar result may be obtained for packing rectangles of side lengths not greater than 1. This has been confirmed in [8]. Furthermore, Meir and Moon [12] showed that any collection of d-dimensional cubes of total volume 2 1−d can be packed (offline) into I d .
The main result of this paper, presented in Theorem 4.6, is as follows The packing method is based on the drawer algorithm described in [4]. Our basic algorithm P(d) is defined inductively from lower dimensions to higher and the inductive step goes two dimensions back, so we will start with cases d = 1 and d = 2.
We will assume that any edge of each box and any edge of each unit cube is parallel to an axis of the coordinate system. Denote by |B| the d-dimensional volume of a d-dimensional box B.

Packing algorithm for d = 1
Consider m unit intervals I 1 is divided into 2 j intervals of length 2 − j , called j-units, for l = 1, 2, . . . , m. Moreover, for each j = 1, 2, . . ., all j-units are numbered by 1 to m · 2 j so that ( j − 1)-unit numbered with q is partitioned into two j-units with numbers 2q − 1 and 2q in an arbitrary order.
Let S 1 , S 2 , . . . be a sequence of segments of length not greater than 1. Denote by j i the greatest integer such that S i can be packed into j i -unit. For example, if the length of S i equals 0.3, then j i = 1 (S i can be packed into a unit of length 2 −1 , but it cannot be packed into any unit of length 2 −2 ). Packing method P (1) Each segment S i is packed into I into a unit. A unit is called active, if its interior has an empty intersection with any packed segment. At the beginning all m2 t units of length 2 −t , for t = 0, 1, 2 . . ., are active.
-We find the smallest integer k such that the j i -unit with number k is active. Let U be such a unit. We pack S i into U . We say that U is full. From now on only units that have an empty intersection with the interior of U are active. Figure 1 illustrates the packing method. At the beginning all units are active. The first segment S 1 of length 0.35 is packed into the first 1-unit. No other segment will be packed into this 1-unit (this unit is not active and full). All j-units ( j ≥ 1) contained in this 1-unit are also not active. Moreover, the first 0-unit is not active. The second interval of length 0.1 is packed into the fifth 3-unit in I

Example 2.1
1 (four 3-units contained in the first 1-unit are not active). From now on all j-units ( j ≥ 3) contained in this 3-unit are not active. Furthermore, both the second 1-unit as well as the third 2-unit are not active. The next segment is placed into the 1-unit with number 3 (in I (2) 1 -there is no active 1-unit in I (1) 1 ). The proper unit for the fourth segment is 2-unit. We pack this segment into the 2-unit with the smallest possible number, i.e., with number 4. Full and active j-units ( j ∈ {1, 2, 3}) after packing S 4 are shown 1 plus the length of S z is greater than l/2.
Proof Assume that S z is the first segment that cannot be packed and let k = j z , i.e., S z should be packed into k-unit (if l = 1, then z = 3 and k = 1 on Fig. 1). Denote by F the union of full units in I (1) 1 ∪ · · · ∪ I (l) 1 and let E be the closure of Clearly, E is the union of segments with pairwise disjoint interiors. For example, on Fig. 1 if we pack only S 1 and S 2 in I (1) 1 , then E is a segment equal to the union of the fourth 2-unit and the sixth 3-unit. There is no interval in E with length greater than or equal to 2 −k ; otherwise S z can be packed into it. Moreover there is at most one interval with length 2 −k−1 ; the numbering of units causes that if there are two active (k + 1)-units, then there is an active k-unit. Thus E is smaller than the length of (k + 1)-unit plus the length of (k + 2)-unit plus the length of (k + 3)-unit, etc., i.e., Consequently, The length of any segment packed into a full unit is greater than 1/2 times the length of this full unit. Hence the sum of lengths of segments packed into I 1 is greater than Since |S z | > (1/2) k+1 , it follows that the sum of length of all segments packed into I 1 ∪ · · · ∪ I (l) 1 plus |S z | is greater than l/2.

Packing algorithm for d = 2
Let R i be a rectangle of side lengths w i and h i , where w i ≤ h i ≤ 1 (for i ≥ 1). We say that For any small rectangle R i there is a positive integer r such that (r, s)-units    Note that no (0, s)-unit for s ≥ 1 is the proper unit for a small rectangle R i ; the reason is that both sides of any small rectangle are not longer than 1/3 (there are no small rectangles of type (0, s)).

Lemma 3.1
The area of any small rectangle R i of type (r , s) is greater than √ 2/4 times the area of (r , s)-unit.
Proof Let R i be a small rectangle and let U (R i ) be the proper unit for R i . If It is easy to see that If R i is a non-special rectangle of type (r , s), then U (R i ) is the rectangle of sides of length Consider m unit squares I 2 are denoted by D 2 and T 2 , respectively). Small items will be packed into D 2 is divided into six (0, 0)-units numbered with natural numbers in the order showed on Fig. 4. Each (0, 0)-unit is divided into smaller units. When (r − 1, s)unit (for r ≥ 1, s ≥ 0) numbered with q is partitioned into two (r , s)-units, these two units are numbered by 2q − 1 and 2q in an arbitrary order. Moreover, when an (r , s − 1)-unit (for s ≥ 1) numbered with p is partitioned into two (r , s)-units, these two units are numbered by 2 p − 1 to 2p in an arbitrary order (see Fig. 5).
We say that a rectangle is packed along the right side of the unit square if its shorter side is contained in the right side of the square. Now we describe an algorithm for packing rectangles of sides of length not greater than 1 into I 2 . Each small rectangle will be placed into corresponding unit with the smallest number.

Packing method P(2)
At the beginning all units are active.
-If R i is a small rectangle of type (r , s), then we find the smallest integer k such that (r , s)-unit of I with number k is active. Let U i be such a unit and let U + i be (r , 0)-unit containing U i . The rectangle R i is packed into U i . From now on we say that U i is full and not active. All ( p, q)-units ( p ≥ r + 1, q ≥ 0) contained in U + i are not active. Moreover all units that have a non-empty intersection with the interior of U i are not active.
-If R i is big, then we find the smallest integer l such that R i can be packed into I (l) 2 along the right side of the square. We pack R i as near to the top of I (l) 2 as it is possible. All units that have a non-empty intersection with R i became not active. Figure 6 illustrates the packing method. At the beginning all units are active. The first rectangle R 1 is packed into the first (1, 1)-unit. No other rectangle will be packed into this (1, 1)-unit (this unit is not active and full). Clearly, U + 1 is the first (1, 0)-unit. All ( p, q)-units for p ≥ 2 and q ≥ 0 contained in U + 1 are not active. This means that two first (2, 0)-units (and all units contained in these units) become not active. However the second (1, 1)-unit as well as (1, s)-units (s ≥ 1) contained in the second (1, 1)-unit remain active. The second rectangle is packed into the second (0, 0)-unit. In this case U + 2 = U 2 . From now on all units contained in this (0, 0)-unit become not active. Since the proper unit for the third rectangle is (2, 0)-unit, the third rectangle is packed into the (2, 0)-unit with number 3. All units contained in this (2, 0)-unit (U + 3 = U 3 ) as well as (1, s)-units ( for s ≥ 1) contained in the second (1, 0)-unit become not active (these units have a non-empty intersection with

Lemma 3.3 Assume that all big rectangles packed in each I
2 and let R z be the first small rectangle that cannot be packed into Q by P (2). If p and q are integers such that R z is of type ( p, q), then the sum of areas of full units in Q is greater than 2 Proof Denote by F the union of full units in Q and let E be the closure of Q \ F. For example, if l = 1, then Q = D 2 and E is the union of uncolored rectangles contained in D 2 on Fig. 6, left.  (1, 0)-unit. If there is an active (2, 0)-unit in E, then denote it by E 2,0 ; otherwise let E 2,0 = ∅. Similarly, there is at most one active (1, 1)-unit in E \ (E 1,0 ∪ E 2,0 ) (as the second (1, 1)-unit on Fig. 7); if there are two active (1, 1)-units, then there is an active (1, 0)-unit. Arguing in this way we obtain that the area of E is smaller than the sum of the areas of units of different size (smaller than (0, 0)-unit), i.e., |E| < r ≥1,s≥0 A r ,s , where A r ,s is the area of (r , s)-unit. Hence

|E|
The area of E is smaller than the area of two (0, 0)-units (see Fig. 7, where E is contained in the union of first two (0, 0)-units). This implies that Consequently,

Lemma 3.4 Assume that all big rectangles packed in each I
and let R z be the first small rectangle that cannot be packed into Q. If p and q are integers such that R z is of type ( p, q), then the total area of small rectangles packed into Q plus the area of R z is greater than Proof By Lemma 3.3, the sum of areas of full units in Q is greater than By Lemma 3.1, the total area of packed small items plus the area of R z is greater than

Proposition 3.5 Assume that a rectangle R z cannot be packed into I
2 ∪ · · · ∪ I (l) 2 . The total area of all packed rectangles plus the area of R z is greater than (3 − 2 √ 2)l/9.

Proof
Let Denote by J s the set of integers i ∈ {1, 2, . . . , l} such that all big rectangles packed into I Clearly, if j ∈ {1, 2, . . . , l} \ J s , then the total area of big rectangles in I ( j) 2 is greater than 1  , where m 1 < m 2 < · · · < m c , all unit squares from U (c is equal to the number of unit squares in U). It remains to prove that the total area of rectangles packed in U plus |R z | is greater than cv 2 . Case 1 R z is small. By Lemma 3.4, the total area of small rectangles packed into U plus the area of R z is greater than 1 3 Case 2 R z is big. If no small rectangle was packed into U, then we take t = 1. Otherwise, let t be the greatest integer such that a small rectangle was packed into I If t ≥ 2, then by Lemma 3.4, the total area of small rectangles packed into I It remains to show that the total area of big rectangles packed into I plus the area of R z is greater than (c − t + 1)v 2 . First assume that t = c, i.e., that I (m t ) 2 is the last unit square in U. Since R z cannot be packed, it follows that the total area of big rectangles packed in I (m t ) 2 plus the area of R z is greater than 1 Now assume that t < c. In c−t unit squares I

Packing algorithm for d ≥ 3
If then by the front wall of W we mean the set of its points with For example, the front wall of I (1) d (see Fig. 8) is the unit square (see Fig. 4). Another example: the front wall of the box H 3 on Fig. 9 (left) is the rectangle P(B 3 ) (see Fig. 9, right).  Let B 1 , B 2 , . . . be a sequence of d-dimensional boxes. We can assume that where a j (i) is the length of the j-th edge of B i . A box B i with a d−1 (i) ≤ 1 3 is called small, otherwise it is called big. Note that a 1 (i) ≥ · · · ≥ a d−2 (i) ≥ a d−1 (i) > 1 3 , therefore |B i | > 3 1−d · a d (i) for any big box. A small box is of type (r , s) if its front wall is a rectangle of type (r , s). For each small box B of type (r , s), let P(B) be the (r , s)-unit (see Fig. 9 right). Clearly, P(B) is the unit with the smallest area containing the front wall of B. Moreover, let D(B) be the drawer with the front wall P(B). Since the packing algorithm is defined inductively two dimensions back, for d = 1 and d = 2 we use algorithms described in Sects. 2 and 3.
Assume that d ≥ 3. By we mean the set of its points with x d = w d . For example, the top of I (1) 3 on Fig. 9 is the rectangle {(x 1 , x 2 , x 3 Fig. 9 is the unit We say that W is packed along the right edge of I Fig. 9, where B 6 is packed along the right side of I (1) 3 ). Now we will present an algorithm for packing boxes B i of edges not longer than 1 into I d . Small boxes of type (r , s) will be placed into active (r , s)-drawers. At the beginning of the packing process all drawers are active. We say that some (r , s)-drawer is used for the packing if a box of type (r , s) was packed into it. All drawers used for the packing have pairwise disjoint interiors. Not each active drawer will be used for the packing. If a drawer is used for the packing, then it remains active during the whole packing process.
Before we present a detailed description of the packing algorithm, we will give a simple example illustrating how it works.  Fig. 10). First we choose the drawer into which B 1 should be packed. All six (0, 0)-drawers are active at the beginning of the packing process (only two of them will be used for the packing). The (0, 0)-drawers are numbered with natural numbers in the order showed on Fig. 8. Moreover, all twelve (1, 0)-drawers (see Fig. 8) are active at the beginning of the packing process (only one of them will be used for the packing). The first box B 1 is of type (0, 0) and all (0, 0)drawers are active. The 1-dimensional bottoms of active (0, 0)-drawers are unit segments. The numbering of active (0, 0)-drawers causes the numbering of their 1-dimensional bottoms (segments): the 1-dimensional bottom of the first active drawer is the first unit segment I         Figure 11 illustrates the packing method P(4). The front wall of B 1 is a rectangle 0.24 × 0.24 and P(B 1 ) = √ 2/3 × 1/3 is (0, 0)-unit. All (0, 0)-drawers are active at the moment. We pack B 1 into the active (0, 0)drawer with the number 1 in the place [0, 0.24] × [0, 0.24] × [0, 0.24] × [0, 0.24]. From now on this drawer D 1 is used for the packing. The drawer D 1 is still active. Only boxes of type (0, 0) will be packed into it. All (r , s)-drawers (r ≥ 1 s ≥ 0) contained in D 1 become not active. The front wall of B 2 is a rectangle 0.28 × 0.26 and P(B 2 ) = √ 3/2 × 1/3 is a (0, 0)-unit. Since there is enough empty space in (0, 0)-drawer D 1 used for the packing, we pack B 2 into it. Now a 1 (2) > 1/3, therefore we pack B 2 into D 1 in such a way that (d − 2)-dimensional bottom of B 2 , i.e., the rectangle a 1 (2) × a 2 (2) = 0.35 × 0.28 is placed along the right side of the 2-dimensional bottom I   Figure 12 illustrates the packing method P(4). We pack a sequence of eighteen 4-dimensional boxes. We use a similar notation as in Example 4.1. A front wall of each box B i for i = 1, . . . , 18 is a rectangle a 4 (i) × a 3 (i), where √ 2/48 < a 4 (i) ≤ √ 2/24 and 1/48 < a 3 (i) ≤ 1/24. Thus the proper unit P(B i ) for the front wall of B i is (6, 0)-unit. This implies that we pack boxes into (6, 0)-drawers. Recall that any (6, 0)-drawer is of the form 1 × 1 × 1 24 × √ 2 24 . The first fifteen boxes are packed into the first (6, 0)-drawer, boxes B 16 and B 17 are packed into the second (6, 0)-box and B 18 is packed into the third (6, 0)drawer (compare Fig. 6, when we can treat I 24 · 1 24 . Thus the total volume packed boxes is greater than 1 1152 · 2(3−2 Theorem 4.6 Any sequence of d-dimensional boxes of edge length smaller than or equal to 1 with total volume not greater than (3 − 2 √ 2) · 3 −d can be packed online into the d-dimensional unit cube.
Proof Let B 1 , B 2 , . . . be a sequence of boxes of total volume not greater than (3−2 √ 2)·3 −d . Assume that B z is the first box that cannot be packed into I (1) d . We use Proposition 4.5 with l = 1. The total volume of all boxes packed in I (1) d plus the volume of B z is greater than (3 − 2 √ 2) · 3 −d , which is a contradiction.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.