Improved Approximation Algorithms for Three-Dimensional Knapsack
Abstract
We study the three-dimensional Knapsack (3DK) problem, in which we are given a set of axis-aligned cuboids with associated profits and an axis-aligned cube knapsack. The objective is to find a non-overlapping axis-aligned packing (by translation) of the maximum profit subset of cuboids into the cube. The previous best approximation algorithm is due to Diedrich, Harren, Jansen, Thöle, and Thomas (2008), who gave a -approximation algorithm for 3DK and a -approximation algorithm for the variant when the items can be rotated by 90 degrees around any axis, for any constant . Chlebík and Chlebíková (2009) showed that the problem does not admit an asymptotic polynomial-time approximation scheme.
We provide an improved polynomial-time -approximation algorithm for 3DK and -approximation when rotations by 90 degrees are allowed. We also provide improved approximation algorithms for several variants such as the cardinality case (when all items have the same profit) and uniform profit-density case (when the profit of an item is equal to its volume). Our key technical contribution is container packing – a structured packing in 3D such that all items are assigned into a constant number of containers, and each container is packed using a specific strategy based on its type. We first show the existence of highly profitable container packings. Thereafter, we show that one can find near-optimal container packing efficiently using a variant of the Generalized Assignment Problem (GAP).
Keywords and phrases:
Approximation Algorithms, Hyperrectangle Packing, Multidimensional Knapsack, Three-dimensional PackingFunding:
Klaus Jansen: Deutsche Forschungsgemeinschaft (DFG) - Project DFG JA 612/25-2 “Fine-grained complexity and algorithms for scheduling and packing”.Copyright and License:
![[Uncaptioned image]](x1.png)
2012 ACM Subject Classification:
Theory of computation Packing and covering problemsAcknowledgements:
We are grateful to Lars Prädel for helping us with some details of the 3D Strip Packing result. We are also thankful to Marvin Lira for initial discussions. We also thank the anonymous reviewers for their valuable comments.Editors:
Oswin Aichholzer and Haitao WangSeries and Publisher:

1 Introduction
Three-dimensional Knapsack (3DK) is a fundamental problem in computational geometry, operations research, and approximation algorithms. In 3DK, we are given a set of items which are axis-aligned cuboids (defined by their width, depth, and height) with associated profits, and a three-dimensional (3D) knapsack which is an axis-aligned unit cube. The goal is to find a nonoverlapping axis-aligned packing (by translation) of a subset of items into the knapsack such that the profit of the packed items is maximized.
In 1965, Gilmore and Gomory [13] introduced the 3D Knapsack problem – motivated by cutting stock problems (e.g., cutting up of graphite blocks for anodes). They provided heuristics for the special case when the items need to be cut along axis-aligned planes. Since then, the problem and its several variants (under practical constraints) have been well-studied in operations research – typically from the viewpoints of meta-heuristics, MILP, tree search, machine learning methods, and greedy algorithms [5, 25]. In the last decade, 3DK has become a central problem in logistics to increase operational efficiency by efficiently utilizing the space in various domains, such as airline cargo management, warehouse management, and robotic container loading [1]. The prominence of this problem in the industry is evidenced by the comprehensive survey on 3D packing by Ali, Ramos, Carravilla, and Oliveira [1], who have mentioned hundreds of papers in recent years.
Packing problems are fundamental and popular among mathematicians (e.g., see Kepler’s sphere packing conjecture [23] and Soma cube puzzle [14]). Surprisingly, 3DK is relatively less studied in computational geometry and approximation algorithms. Only in 2008, Diedrich, Harren, Jansen, Thöle, and Thomas [10] provided the first provable approximation guarantees for the problem. They first gave a simple polynomial-time -approximation algorithms for any constant . Thereafter, they gave a more sophisticated -approximation algorithm for 3DK. For the case when the items can be rotated by 90 degrees around any axis, they provided a -approximation algorithm. Afterward, Chlebík and Chlebíková [7] showed that the problem admits no asymptotic polynomial-time approximation schemes (APTAS) even for the cardinality case (when each item has the same profit). Lu, Chen, and Cha [24] showed that even packing cubes into a cube is strongly NP-hard.
There has been progress in some special cases. When all items are -dimensional hypercubes, Harren [15] gave a -approximation algorithm. Recently, Jansen, Khan, Lira, and Sreenivas [17] gave a PTAS for this special case. Afterwards, Buchem, Deuker, and Wiese [4] obtained an EPTAS. Furthermore, they gave dynamic algorithms with polylogarithmic query and update times, matching the same approximation guarantees.
For the 2D variant when all items are rectangles (2DK), Jansen and Zhang [20] gave a -approximation algorithm. Gálvez, Grandoni, Ingala, Heydrich, Khan, and Wiese [11] gave an improved 1.89-approximation algorithm. Later, Gálvez, Grandoni, Khan, Ramírez-Romero, and Wiese [12] gave a pseudopolynomial-time 4/3-approximation algorithm. For the variant of guillotine packing (where items need to be packed such that they can be separated by a series of end-to-end cuts), Khan, Maiti, Sharma, and Wiese [21] gave a pseudopolynomial-time approximation scheme (PPTAS) for the problem.
Compared to the classical (1D) Knapsack, multidimensional Knapsack is much harder as there are different types of items and they can interact in a complicated way. For example, 2D items can be big (large in both dimensions), small (tiny in both dimensions), vertical (large in height, small in width), or horizontal (large in width, small in height). Most approximation algorithms for 2DK show the existence of a highly profitable structured packing where the knapsack is partitioned into a constant number of boxes such that each box contains only items of one type and can be packed easily by simple greedy algorithms. Large boxes contain a single large item, vertical (resp. horizontal) boxes contain only vertical (resp. horizontal) items (thus, one can essentially ignore the long dimension of the item, and the box becomes a 1D knapsack), and small boxes contain small items (one can consider the area of an item as a proxy and use 1D knapsack solution). However, this is difficult for 3D packing. As pointed out by Bansal, Correa, Kenyon, and Sviridenko [3], one of the obstacles to generalize methods from rectangle packing to cuboid packing is that “the interaction of say 3-dimensional rectangles which are long in one direction but short in the other two seems much more complicated than in the two-dimensional case.”
In 2008, the authors in [10] mentioned that “it is of interest whether here (for 3DK) an algorithm with ratio or less exists.” However, despite significant progress in the 2D case, there has been no improved approximation algorithm for 3DK in almost two decades.
1.1 Our results
In this paper, we introduce container packing for 3D Knapsack. We show that we can divide the 3D knapsack into number of regions (called containers) such that the dimensions of these containers come from a polynomial-sized set. For each container we define its capacity and for each item we define its size in to be . We also associate an algorithm for the container. We require such that for any and any set of items satisfying the packing constraint , almost all items in (barring a small profit subset) can be packed into by algorithm . The assignment of items into containers thus becomes a variant of the Multiple Knapsack problem (however, the knapsacks can have different capacities and items can have sizes specific to the knapsacks) – also a special case of Generalized Assignment Problem (GAP). For knapsacks, there exists a PTAS for GAP [11]. After the assignment of items to the container , the corresponding algorithm ensures that the items admit a feasible profitable packing.
Container packing is a powerful and general technique. For example, by choosing appropriate functions , our containers can handle complicated packings, beyond simple greedy algorithms. For example, we use six different types of containers in this work (see Figures 4 and 8). Apart from the Stack containers and Volume containers (similar to 2D packing), we introduce Area containers (packed using a variant of Next-Fit-Decreasing-Height (NFDH) algorithm [9]), Steinberg containers (where different types of items are packed together using our new volume-based packing algorithm 3D-Vol-Pack – it packs items in layers where each layer is packed using either a greedy algorithm or a 2D packing algorithm called Steinberg’s algorithm [26]), and -Containers (where two different types of stacks are packed together when rotations are allowed). Note that Steinberg container or -Container goes beyond simple stack or shelf-based algorithms and equips us to handle more complicated packings of different types of items. Finally, we show that given an optimal packing, we can modify it to some container packing having significant profit. The functions can be considered analogous to the weighting functions in bin packing [9], and we expect that more complicated packing algorithms can be incorporated into this framework by suitably defining .
Using this, we obtain improved approximation guarantees for 3DK (see Table 1). In particular, we obtain -approximation for 3DK and -approximation for 3DKR (when rotations by 90 degrees are allowed around all axes). For the cardinality case (when all items have the same profit), we obtain and , respectively, for the cases without and with rotations. Finally, in the case when the profit of an item is equal to its volume (also called uniform profit-density), we obtain approximation guarantees of and , without and with rotations, respectively.
Due to space limitations, some parts of the proofs are omitted in this extended abstract. For missing details, we refer the reader to the full version [16].
General case | Cardinality case | Profit = Volume | |
---|---|---|---|
Without rotations | |||
With rotations |
1.2 Related work
Two other related problems are 3D Bin Packing (BP) and Strip Packing (SP). In 3D BP, given a set of cuboids and unit cubes as bins, the goal is to find a nonoverlapping axis-aligned packing of all items into the minimum number of bins. In 3D SP, given a set of cuboids, the goal is to pack them into a single 3D rectangular box of unlimited height such that the height of the packing is minimized. For 3D BP and 3D SP, the best-known (asymptotic) approximation ratios are [6] and [19], respectively. For more details on related problems, we refer the readers to surveys [2, 8] on approximation and online algorithms for multidimensional packing.
2 Notation and Preliminaries
We are given a set of items . Each item is a cuboid with width , depth , height , and an associated profit . The volume of an item is , and its base area is defined as . We are also given a 3D unit cube knapsack . If an item is placed (by translation) in an axis-aligned way at then it occupies the region: . For a feasible packing we need . In a packing, two items are nonoverlapping if their interiors are disjoint. Our goal is to find a nonoverlapping packing of a subset of these items that maximizes the total profit. In 3DK, we allow only translation, whereas 3DKR allows translation and rotation by 90 degrees around all axes. For any set of items , we shall let and denote the total profit, sum of heights, and volume of , respectively. Let OPT denote an optimal packing and .
2.1 Packing subroutines
We now describe a few procedures that we repeatedly use throughout the paper to pack items. For a cuboidal box , let denote the width, depth, and height of , respectively. The volume of the box is then .
Next-Fit-Decreasing-Height (NFDH) Algorithm [9].
NFDH is a shelf-based packing algorithm for packing rectangles. 3D-NFDH is its generalization in three dimensions (see Figure 1). The following lemmas summarize the guarantees of these algorithms.
Lemma 1 ([11]).
We are given a rectangular box of length (horizontal dimension) and breadth (vertical dimension), and a set of (2D) rectangles, where each has length and breadth . If , then the whole set can be packed into the box using NFDH in time.
Lemma 2.
We are given a cuboidal box , and a set of items where each satisfies , and . If , then the whole set can be packed into using 3D-NFDH in time.
Steinberg’s Algorithm [26].
Steinberg’s Algorithm is a commonly used 2D packing algorithm with the following performance guarantee.
Lemma 3 ([26]).
We are given a set of rectangles and a rectangular box of size . Let and be the maximum length and maximum breadth among the rectangles in , respectively, and let be the total area of the rectangles in . Also, we denote . If , then there is an algorithm that can pack the whole set into the rectangular box in time.
We utilize the above algorithm to pack items in layers inside a box. Below, we present two algorithms 3D-Vol-Pack and 3DR-Vol-Pack for packing 3D items for the cases without and with rotations, respectively. As Steinberg’s algorithm is used as a black box in many 2D packing problems, we believe our volume-based bounds and algorithms should find usage in other 3D packing problems. In both cases, we are given a box with height , width , and depth , and a set of items .
3D-Vol-Pack.
We assume that each satisfies either or . Let be the items of having width at most , and let . Then, similar to [10], we further classify as follows: let be the items whose base area (area of the bottom face) exceeds , and let . Next, we sort the sets and in non-increasing order of heights. We group the items of in pairs (except possibly the last item), and pack each pair in a single layer. See Figure 2. For packing items in , we group them into maximal collections of total base area not exceeding , and pack each collection in a single layer using Steinberg’s algorithm (Lemma 3). Analogously, we obtain a packing of the items in in layers. Finally, we stack the layers one above the other inside the box as long as the height of the box is not exceeded. The following lemma provides a guarantee when the item heights are small compared to the box height.
Lemma 4.
Given a box , and a set of items where each satisfies , and . Further, either or holds for every . If , then 3D-Vol-Pack packs the whole set into in time.
Next, we give an algorithm when the items can be rotated by 90 degrees about any axis.
3DR-Vol-Pack.
Let , and let . First, we pack in layers using 3D-Vol-Pack. Next, we sort the items of in non-increasing order of their widths and pack them in layers, one in each layer, touching the left face of the box, as long as the height of the box is not exceeded. Following this, we rotate the remaining items of about the depth dimension so that their widths and heights are interchanged, and as long as possible, pack them next to each other starting from the right face of the box, such that each item touches the top face of the box (see Figure 3).
The next lemma states that when is a cube and when the height of each item is very small compared to box , we can pack a significant volume.
Lemma 5.
Given a cubical box of side length , and a set of items where for each , there exists an orientation so that , and holds. If , then can be packed into by 3DR-Vol-Pack in time.
3 Container Packing
In this section, we first define container packing and describe the containers used in our work. Then, we state our main structural result which shows that there exist container packings with high profit that can be found in polynomial time.
Definition 6 (Container Packing).
A packing of a set of items is said to be a Container Packing if
-
the knapsack can be partitioned into a collection of non-overlapping regions called containers and some empty spaces. Each container has an associated capacity , a function , and a polynomial-time algorithm ,
-
there is a function , such that for each , items in are packed into using algorithm ,
-
for any and such that , for any constant , there exists a polynomial-time computable set with such that can be packed into by the algorithm .
A Container Packing is said to be guessable if
-
the number of containers inside the knapsack is bounded by a constant ,111The notation means that the implicit constant hidden in big- notation can depend on .
-
the number of distinct possible types of containers (defined by their sizes along each dimension) is bounded by , a polynomial in ,
-
whether a given collection of containers can be placed non-overlappingly inside the knapsack, can be checked in (polynomial) time.
We shall call a container guessable if it comes from some polynomially-sized set of distinct container types. Though, in this paper we only use cuboids as containers, the idea of container packing can be generalized to other shapes in 3D or higher dimensions.
Theorem 7.
There is a PTAS for maximum profit guessable container packing.
Proof.
We consider all feasible choices of containers that fit into the 3D knapsack, and for each such choice, we create an instance of GAP with one (1D) knapsack per container, where the (1D) knapsack corresponding to a container has capacity and the size of an item for the (1D) knapsack is given by . The profit of an item for any (1D) knapsack is set to be the same as the actual profit of the item. Using the PTAS for GAP with knapsacks [11], we obtain a feasible assignment of items into the containers, and finally for each container , we use the algorithm to pack a subset of the items assigned to it, by losing only an -fraction of profit.
3.1 Classification of containers
We now describe the various types of containers that we use to pack items. For a container , its width, depth, and height are denoted by , and , respectively, and its volume . For each container , we specify its capacity , the function and the packing algorithm . Let denote the set of items assigned to such that . We suggest the reader to follow the descriptions alongside Figure 4.
-
Stack containers: These containers pack items in layers, with one item in each layer. We consider a container that stacks items along the height. See container () in Figure 4. The capacity of such a container is set to its height , and for any item , if and , and otherwise.
just stacks the items of set in the container one above the other. Analogously containers () and () show containers that stack along width and depth, respectively.
-
Area containers: Inside these containers, the items are packed using the NFDH algorithm, by ignoring one of the dimensions. We describe Area containers that use NFDH along the front face of the container (see container ()). For such a container , we set , and for any item , we set if , and , and otherwise.
first sorts the items of set in non-increasing order of profit/front area ratio. Then, we select the largest prefix whose total front area does not exceed . We pack this prefix using NFDH on the front face. Analogously, container () and () show packing when NFDH is used on the left and bottom face of , respectively.
-
Volume containers: The items are packed using 3D-NFDH inside these containers (see container (3)). The capacity of such a container is set to be its volume , and if , and , and otherwise.
sorts the items of in non-decreasing order of profit/volume and selects the largest prefix with volume not exceeding . We pack this prefix using 3D-NFDH.
-
Steinberg containers: These containers pack items in layers using 3D-Vol-Pack. We describe Steinberg containers that pack items in layers along the height (analogous for other cases). We set . For any item , we set if , and either or holds. For all other items, we set .
first sorts the items in in non-increasing order of profit/volume ratio. Then, we select the largest prefix whose volume does not exceed , and pack this prefix using 3D-Vol-Pack. Analogously, container () and () show packing when layers are stacked along the depth and width, respectively.
3.2 Our Structural Lemma
Let be the maximum profit of a guessable container packing. The main structural result of our paper is the following.
Lemma 8.
For any , the optimal profit and the optimal profit of a guessable container packing satisfies .
Together with Theorem 7, this gives us the following theorem.
Theorem 9.
For any constant , there is a polynomial-time -approximation algorithm for 3DK.
We prove Lemma 8 in Section 4 by establishing several lower bounds on . Specifically, we present five different ways to restructure OPT into a guessable container packing. Our first lower bound is based on a structural result of the 3D Strip Packing problem due to [19]. The second lower bound is obtained by restructuring the packing of items in (or similarly or )). The third and fourth lower bounds are based on volume-based arguments, using our simple packing algorithm 3D-Vol-Pack. Our final lower bound is based on a structural result from the 2D Knapsack problem [11].
4 Proof of Structural Lemma
Now we prove the structural lemma. First, we classify the items.
Classification of items.
Let be an accuracy parameter. Let be a sufficiently small constant depending on (setting suffices). We now classify the input items based on their dimensions. Let be the set of items whose width, depth and height all exceed . Let be the set of items having height at most . Similarly, let be those items whose widths are at most , and be the remaining items. Thus each item in has depth at most . Let consist of the items in whose width and depth are both more than 1/2, and let . See Figure 5.
The sets are defined analogously.
Let for , and , so that . Let and , so that . The quantities and are defined analogously for the sets and , respectively.
Finally, let , and define analogously. Clearly, sum up to at most the volume of the knapsack which is 1. We define and . The quantities are defined analogously.
4.1 First lower bound on
We consider the packing of the items in (i.e., items with height at most ) whose total profit is . We build on the structure derived from the 3D Strip Packing algorithm of Jansen and Prädel [19]. However, we need several refinements to transform the packing of [19] into a guessable container packing.
First, using standard arguments, we discard a set of (medium) items (items whose widths or depths lie in the range for a suitably chosen ) at a -factor loss in the approximation ratio. Then the items are divided into four classes depending on their dimensions. An item is big if both and , wide if and , long if and , and small if both and . The following lemma is obtained by an adaptation of the result of [19] (see Figure 6).
Lemma 10.
There exist disjoint sets having a profit of at least , such that
-
Items of are packed into a collection of configurations, where each configuration is a box having a base, that is partitioned into (cuboidal) slots for packing big items, slots for packing wide and long items (using NFDH), and slots for packing small items (using 3D-NFDH). The height of a slot is the same as the height of the corresponding configuration,
-
The configurations are stacked one on top of the other inside the knapsack and their heights sum up to at most ,
-
The set contains only wide, long and small items and has a total volume of .
Our objective is to build Area and Volume containers out of the slots for packing the wide/long and small items, respectively. The trouble is that the slot dimensions might not be large enough compared to the dimensions of the packed items, which is a necessary condition for the construction of such containers (see Section 3.1). We obtain a guessable container packing by the following lemma.
Lemma 11.
By losing a profit of at most , and rounding the height of each configuration to the next integer multiple of , each configuration for can be further partitioned into guessable containers. Moreover, the items of can be packed inside a Steinberg container of height .
After applying the above lemma, the rounded heights of all the configurations for sum up to at most , for sufficiently small . Since items of are packed inside a Steinberg container of height , all the containers fit inside the knapsack and we obtain the following theorem overall.
Theorem 12.
We can repack a subset of with profit at least into guessable Stack, Area, and Volume containers.
An equivalent restructuring of and gives the following corollary.
Corollary 13.
.
4.2 A simple -approximation
We now present a simple -approximation for 3DK, which already improves upon the -approximation [10]. For this, first, we provide the following packing guarantee.
Lemma 14.
Let be a set of items such that each satisfies . If , then there exists with such that there is a guessable container packing of into a Stack and a Steinberg container.
Then the following lemma, together with Theorem 7, gives a -approximation.
Lemma 15.
.
Proof.
Trivially we have , since we can create a Stack container for every item in (at most such items). Hence if , we are already done. Otherwise we have . Now since , there must exist an such that – w.l.o.g. assume . We have two cases.
Case 1: .
In this case, Lemma 14 implies that (since each item in has height at most ). Hence if , we are done. Otherwise we have . W.l.o.g. assume that , Corollary 13 gives us .
Case 2: .
In this case, we sort the items of in non-increasing order of their profit to volume ratio, and pick the maximal prefix whose volume does not exceed . Then we have . Applying Lemma 14 to , we obtain , thus completing the proof.
The ratio of is tight. One such instance is given when and and
We will obtain further improvements by using the lower bounds in the following sections.
4.3 Second lower bound on
In this subsection, we consider the packing of , and restructure it to obtain a guessable container packing, by losing only an -fraction of the profit. Let and . Since each item in has all side lengths at least , the number of such items in the packing is . Also, since the width and depth of each item in is at least 1/2, the items of must be packed in layers, i.e., the top and bottom faces of any item in when extended parallel to the bottom face of the knapsack will not intersect another item from . We now discretize the positions of the items in the packing.
Lemma 16.
The distance of the left (resp. front) face of any item from the left (resp. front) face of the knapsack can be assumed to lie in a polynomial-sized set.
Let be the items of largest profit in , for some to be chosen later. Our goal is to obtain a container packing of all items in , together with a subset of having a profit of at least . To this end, we shall pack all items in and ensure that the number of discarded items of is bounded by , for some constant . By a result of [18], the profit of the discarded items can be bounded by , for appropriately chosen . We now outline the details of our restructuring procedure. See Figure 7.
We draw horizontal planes passing through the top and bottom faces of the items in , and discard the items of intersecting these planes (see Figure 7). The number of discarded items is bounded by . The remaining items of are now completely packed inside at most horizontal strips demarcated by the planes. Each such strip is a cuboidal box that is pierced from top to bottom by at most Large items. Further, there are only polynomially-many positions of these Large items inside the strip owing to Lemma 16. We focus on one such strip .
Lemma 17.
The items of present inside the strip can be repacked into at most Stack containers, whose widths and depths lie in a polynomial-sized set.
For each item in , we create a Stack container containing the single item itself. Together with Lemma 17, we get number of Stack containers inside the knapsack. We now discretize the heights of the Stack containers, so that they lie in a polynomial-sized set.
Lemma 18.
By discarding items from , the height of each Stack container can be made of the form , where and is the height of some item in .
Together with the items that were discarded previously, Lemma 18 gives us that the total number of discarded items so far is at most . We now use the following lemma from [18].
Lemma 19 ([18]).
Let be a sequence of real numbers and . Let be a nonnegative integer and . If , then there is an integer such that .
The above lemma invoked with and with the correct guess of gives us that the total profit of the discarded items is at most , assuming that was sufficiently large (at least ) to begin with (otherwise, it is trivial). The following theorem summarizes the arguments of this section.
Theorem 20.
Consider the packing of . Then by discarding items of having a total profit of at most , the remaining items can be repacked into a guessable container packing, wherein items of are placed inside at most Stack containers, and items of are packed into at most Stack containers.
4.4 Third lower bound on
In this subsection, we restructure the packing of items in . Recall that and , so that . Also, and .
Theorem 21.
Consider the packing of . It is possible to repack subsets of and into a guessable Stack and Steinberg container, respectively, whose profit, say , satisfies the following properties:
-
,
-
If , then ,
-
If , then .
4.5 Fourth lower bound on
In the previous sections, we repacked items from exactly one set out of . In this subsection, we restructure the packing of a subset of items from , together with items from . To this end, we introduce a classification of the items in . Let (resp. ) be the set of items in (resp. ) with height at most 1/2. Define and , so that . The quantities and are defined analogously. Let and so that . The following theorem repacks items from .
Theorem 22.
Consider the packing of and assume that and . Then there is a guessable container packing of a subset of these items into Stack and Steinberg containers having a profit of at least
4.6 Fifth lower bound on
In the previous subsection, we repacked items from or together with items in . Now we consider items in in OPT. As all these items have heights of more than 1/2, they can not be stacked on top of each other. So, we can ignore their heights, and effectively obtain a 2D Knapsack instance. Now we use a container-based algorithm for 2DK from [22] to obtain a container packing of these items.
Theorem 23.
Consider the packing of . Then there is a guessable container packing into Stack and Area containers each of height 1, having profit at least .
4.7 Bounding
Equipped with all the lower bounds of the preceding subsections, we establish Lemma 8 by an intricate case analysis depending on the volumes of various sets of items in the optimal packing. Since sum up to at most the volume of the knapsack which is 1, at least one among them must not exceed . If at most one of them exceeds , we show a stronger bound of on the approximation ratio. Otherwise, we assume w.l.o.g. that and . We further divide into subcases depending on the values of and . It turns out that the worst bound on occurs when both exceed and . However for this case, Theorem 22 and Theorem 23 give us highly profitable packings, and we achieve an approximation ratio of . The details of the analysis are deferred to the full version [16].
5 Other variants
Using our techniques, we obtain further improvements for other variants: (1) cardinality case (when all items have the same profit), and (2) uniform profit-density case (when the profit of an item is equal to its volume).
Theorem 24.
For any constant , there is a polynomial-time -approximation algorithm for 3DK when all items have the same profit.
Theorem 25.
For any constant , there is a polynomial-time -approximation algorithm for 3DK when the profit of an item is equal to its volume.
5.1 Rotational case
When the items can be rotated by 90 degrees around any axis, we show the existence of improved container packing. Specifically, we introduce a new type of container called -Container and obtain improved guarantees based on the packed volume.
-Container.
We describe -Containers which ignore depth while packing the items (see Figure 8; two other types of -Containers exist which ignore width, height, respectively). We first require that must satisfy the condition . The capacity of , , is given by . For each item packed inside , there must be some orientation with width at least , depth at least , and height at most . If these conditions are satisfied, then we set and otherwise. Algorithm is as follows. Given a set of items satisfying , we arrange them in non-increasing order of profit/(front area) ratio. Then, we select the largest prefix whose total front area does not exceed . We now sort the items in in non-increasing order of widths, start from the bottom left corner, and keep stacking them one upon each other to the maximum extent possible. Then, we rotate the remaining items by degrees around the depth axis, start from the top right corner and keep packing them side by side.
The main ingredient to obtain improved approximation ratios in the rotational case is our algorithm 3DR-Vol-Pack (see Section 2.1). Although, as stated the algorithm does not pack into (guessable) containers, it can be modified to return a guessable container packing into Stack, Steinberg, and -Containers. Using this, we obtain the following theorems for the general case, cardinality case, and uniform profit-density case, respectively.
Theorem 26.
For any constant , there is a polynomial-time -approximation algorithm for 3DKR.
Theorem 27.
For any constant , there is a polynomial-time -approximation algorithm for 3DKR when all items have the same profit.
Theorem 28.
For any constant , there is a polynomial-time -approximation algorithm for 3DKR when the profit of an item is equal to its volume.
6 Conclusion
In this work, our primary focus has been to obtain improved polynomial-time approximation guarantees. Our current runtime of is mainly because of the step where we guess the containers and assign the items. Once this is done, every runs in time . Hence, one interesting direction is whether the time to guess the containers and assign the items can be brought down to using the recent techniques of [4]. Another interesting open problem is to provide a tight approximation for algorithms based on container packing.
References
- [1] Sara Ali, António Galrão Ramos, Maria Antónia Carravilla, and José Fernando Oliveira. On-line three-dimensional packing problems: A review of off-line and on-line solution approaches. Computers & Industrial Engineering, 168:108122, 2022. doi:10.1016/j.cie.2022.108122.
- [2] Helmut Alt. Computational aspects of packing problems. Bulletin of EATCS, 1(118), 2016.
- [3] Nikhil Bansal, José R. Correa, Claire Kenyon, and Maxim Sviridenko. Bin packing in multiple dimensions: inapproximability results and approximation schemes. Mathematics of Operations Research, 31(1):31–49, 2006. doi:10.1287/moor.1050.0168.
- [4] Moritz Buchem, Paul Deuker, and Andreas Wiese. Approximating the geometric knapsack problem in near-linear time and dynamically. In Symposium on Computational Geometry (SoCG), volume 293, pages 26:1–26:14, 2024. doi:10.4230/LIPIcs.SoCG.2024.26.
- [5] Valentina Cacchiani, Manuel Iori, Alberto Locatelli, and Silvano Martello. Knapsack problems – An overview of recent advances. Part II: Multiple, multidimensional, and quadratic knapsack problems. Computers & Operations Research, 143:105693, 2022. doi:10.1016/j.cor.2021.105693.
- [6] Alberto Caprara. Packing -dimensional bins in stages. Mathematics of Operations Research, 33(1):203–215, 2008. doi:10.1287/moor.1070.0289.
- [7] Miroslav Chlebík and Janka Chlebíková. Hardness of approximation for orthogonal rectangle packing and covering problems. Journal of Discrete Algorithms, 7(3):291–305, 2009. doi:10.1016/j.jda.2009.02.002.
- [8] Henrik I. Christensen, Arindam Khan, Sebastian Pokutta, and Prasad Tetali. Approximation and online algorithms for multidimensional bin packing: A survey. Computer Science Review, 24:63–79, 2017. doi:10.1016/j.cosrev.2016.12.001.
- [9] Edward G. Coffman, Jr, Michael R. Garey, David S. Johnson, and Robert E. Tarjan. Performance bounds for level-oriented two-dimensional packing algorithms. SIAM Journal on Computing, 9(4):808–826, 1980. doi:10.1137/0209062.
- [10] Florian Diedrich, Rolf Harren, Klaus Jansen, Ralf Thöle, and Henning Thomas. Approximation algorithms for 3D orthogonal knapsack. Journal of Computer Science and Technology, 23(5):749–762, 2008. doi:10.1007/s11390-008-9170-7.
- [11] Waldo Gálvez, Fabrizio Grandoni, Salvatore Ingala, Sandy Heydrich, Arindam Khan, and Andreas Wiese. Approximating geometric knapsack via L-packings. ACM Transactions on Algorithms, 17(4):33:1–33:67, 2021. doi:10.1145/3473713.
- [12] Waldo Gálvez, Fabrizio Grandoni, Arindam Khan, Diego Ramírez-Romero, and Andreas Wiese. Improved approximation algorithms for 2-dimensional knapsack: Packing into multiple L-shapes, spirals, and more. In International Symposium on Computational Geometry (SoCG), pages 39:1–39:17, 2021. doi:10.1007/s00453-023-01130-2.
- [13] P. C. Gilmore and Ralph E. Gomory. Multistage cutting stock problems of two and more dimensions. Operations Research, 13(1):94–120, 1965.
- [14] David Hillel Goodman and Ilan Garibi. Soma Puzzle Book, The: A New Approach To The Classic Pieces. World Scientific, 2019.
- [15] Rolf Harren. Approximation algorithms for orthogonal packing problems for hypercubes. Theoretical Computer Science, 410(44):4504–4532, 2009. doi:10.1016/J.TCS.2009.07.030.
- [16] Klaus Jansen, Debajyoti Kar, Arindam Khan, KVN Sreenivas, and Malte Tutas. Improved approximation algorithms for three-dimensional knapsack. arXiv preprint arXiv:2503.19365, 2025.
- [17] Klaus Jansen, Arindam Khan, Marvin Lira, and K. V. N. Sreenivas. A ptas for packing hypercubes into a knapsack. In International Colloquium on Automata, Languages, and Programming (ICALP), volume 229, pages 78:1–78:20, 2022. doi:10.4230/LIPIcs.ICALP.2022.78.
- [18] Klaus Jansen and Lorant Porkolab. Improved approximation schemes for scheduling unrelated parallel machines. In ACM Symposium on Theory of Computing (STOC), pages 408–417, 1999. doi:10.1145/301250.301361.
- [19] Klaus Jansen and Lars Prädel. A new asymptotic approximation algorithm for 3-dimensional strip packing. In SOFSEM: Theory and Practice of Computer Science, pages 327–338, 2014. doi:10.1007/978-3-319-04298-5_29.
- [20] Klaus Jansen and Guochuan Zhang. Maximizing the total profit of rectangles packed into a rectangle. Algorithmica, 47(3):323–342, 2007. doi:10.1007/S00453-006-0194-5.
- [21] Arindam Khan, Arnab Maiti, Amatya Sharma, and Andreas Wiese. On guillotine separable packings for the two-dimensional geometric knapsack problem. In International Symposium on Computational Geometry (SoCG), volume 189, pages 48:1–48:17, 2021. doi:10.4230/LIPIcs.SoCG.2021.48.
- [22] Arindam Khan, Eklavya Sharma, and K. V. N. Sreenivas. Approximation algorithms for generalized multidimensional knapsack. arXiv preprint, 2021. arXiv:2102.05854.
- [23] Jeffrey C. Lagarias. The Kepler Conjecture: The Hales-Ferguson Proof. Springer Science & Business Media, 2011.
- [24] Yiping Lu, Danny Z. Chen, and Jianzhong Cha. Packing cubes into a cube is NP-complete in the strong sense. Journal of Combinatorial Optimization, 29(1):197–215, 2015. doi:10.1007/s10878-013-9701-1.
- [25] Everton Fernandes Silva, Túlio Angelo Machado Toffolo, and Tony Wauters. Exact methods for three-dimensional cutting and packing: A comparative study concerning single container problems. Computers & Operations Research, 109:12–27, 2019. doi:10.1016/j.cor.2019.04.020.
- [26] A. Steinberg. A strip-packing algorithm with absolute performance bound 2. SIAM Journal on Computing, 26(2):401–409, 1997. doi:10.1137/S0097539793255801.