Abstract 1 Introduction 2 Notation and Preliminaries 3 Container Packing 4 Proof of Structural Lemma 5 Other variants 6 Conclusion References

Improved Approximation Algorithms for Three-Dimensional Knapsack

Klaus Jansen ORCID Kiel University, Germany Debajyoti Kar ORCID Indian Institute of Science, Bengaluru, India Arindam Khan ORCID Indian Institute of Science, Bengaluru, India K. V. N. Sreenivas ORCID Indian Institute of Science, Bengaluru, India Malte Tutas ORCID Kiel University, Germany
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 (7+ε)-approximation algorithm for 3DK and a (5+ε)-approximation algorithm for the variant when the items can be rotated by 90 degrees around any axis, for any constant ε>0. 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 (139/29+ε)4.794-approximation algorithm for 3DK and (30/7+ε)4.286-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 Packing
Funding:
Klaus Jansen: Deutsche Forschungsgemeinschaft (DFG) - Project DFG JA 612/25-2 “Fine-grained complexity and algorithms for scheduling and packing”.
Debajyoti Kar: Google PhD Fellowship.
Arindam Khan: Google India Research Award, SERB Core Research Grant (CRG/2022/001176) on “Optimization under Intractability and Uncertainty”, Ittiam Systems CSR grant, and the Walmart Center for Tech Excellence at IISc (CSR Grant WMGT-23-0001).
K. V. N. Sreenivas: Google PhD Fellowship.
Malte Tutas: Deutsche Forschungsgemeinschaft (DFG) - Project DFG JA 612/25-2 “Fine-grained complexity and algorithms for scheduling and packing”.
Copyright and License:
[Uncaptioned image] © Klaus Jansen, Debajyoti Kar, Arindam Khan, K. V. N. Sreenivas, and Malte Tutas; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Packing and covering problems
Related Version:
Full Version: https://arxiv.org/abs/2503.19365 [16]
Acknowledgements:
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 Wang

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 (9+ε)-approximation algorithms for any constant ε>0. Thereafter, they gave a more sophisticated (7+ε)-approximation algorithm for 3DK. For the case when the items can be rotated by 90 degrees around any axis, they provided a (5+ε)-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 d-dimensional hypercubes, Harren [15] gave a (1+2d+ε)-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 (2+ε)-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 (6+ε) 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 O(1) number of regions (called containers) such that the dimensions of these containers come from a polynomial-sized set. For each container C we define its capacity 𝚌𝚊𝚙(C)0 and for each item i we define its size in C to be fC(i)0. We also associate an algorithm 𝒜C for the container. We require 𝒜C,fC such that for any C and any set of items T satisfying the packing constraint iTfC(i)𝚌𝚊𝚙(C), almost all items in T (barring a small profit subset) can be packed into C by algorithm 𝒜C. 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 O(1) knapsacks, there exists a PTAS for GAP [11]. After the assignment of items to the container C, the corresponding algorithm 𝒜C ensures that the items admit a feasible profitable packing.

Container packing is a powerful and general technique. For example, by choosing appropriate functions fC, 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 fC 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 fC.

Using this, we obtain improved approximation guarantees for 3DK (see Table 1). In particular, we obtain (139/29+ε)-approximation for 3DK and (30/7+ε)-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 17/4+ε and 24/7+ε, 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 4+ε and 3+ε, 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].

Table 1: Summary of our results.
General case Cardinality case Profit = Volume
Without rotations 13929+ε<4.794 174+ε=4.25+ε 4+ε
With rotations 307+ε<4.286 247+ε<3.429 3+ε

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 T22.86 [6] and 3/2+ε [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 n items I={1,2,,n}. Each item iI is a cuboid with width wi(0,1], depth di(0,1], height hi(0,1], and an associated profit pi. The volume of an item i is v(i)=wi×di×hi, and its base area is defined as widi. We are also given a 3D unit cube knapsack K:=[0,1]×[0,1]×[0,1]. If an item i is placed (by translation) in an axis-aligned way at (ix,iy,iz) then it occupies the region: [ix,ix+wi]×[iy,iy+di]×[iz,iz+hi]. For a feasible packing we need ix[0,1wi],iy[0,1di],iz[0,1hi]. 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 T, we shall let p(T),h(T) and v(T) denote the total profit, sum of heights, and volume of T, respectively. Let OPT denote an optimal packing and 𝚘𝚙𝚝:=p(OPT).

2.1 Packing subroutines

We now describe a few procedures that we repeatedly use throughout the paper to pack items. For a cuboidal box B, let wB,dB,hB denote the width, depth, and height of B, respectively. The volume of the box is then v(B)=wB×dB×hB.

Figure 1: 3D-NFDH with three layers. Each layer is packed using (two-dimensional) NFDH.

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 b (vertical dimension), and a set S of n (2D) rectangles, where each iS has length iε and breadth biεb. If iSibi(12ε)b, then the whole set S can be packed into the box using NFDH in O(nlogn) time.

Lemma 2.

We are given a cuboidal box B, and a set T of n items where each iT satisfies wiεwB, diεdB and hiεhB. If v(T)(13ε)v(B), then the whole set T can be packed into B using 3D-NFDH in O(nlog2n) 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 S of n rectangles and a rectangular box of size ×b. Let max and bmaxb be the maximum length and maximum breadth among the rectangles in S, respectively, and let a(S) be the total area of the rectangles in S. Also, we denote x+:=max(x,0). If 2a(S)b(2max)+(2bmaxb)+, then there is an algorithm that can pack the whole set S into the rectangular box in O(nlog2nloglogn) 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 B with height hB, width wB, and depth dB, and a set of items T.

3D-Vol-Pack.

We assume that each iT satisfies either wiwB/2 or didB/2. Let Tw be the items of T having width at most wB/2, and let Td=TTw. Then, similar to [10], we further classify Tw as follows: let TwTw be the items whose base area (area of the bottom face) exceeds 16wBdB, and let Tws=TwTw. Next, we sort the sets Tw and Tws in non-increasing order of heights. We group the items of Tw in pairs (except possibly the last item), and pack each pair in a single layer. See Figure 2. For packing items in Tws, we group them into maximal collections of total base area not exceeding 12wBdB, and pack each collection in a single layer using Steinberg’s algorithm (Lemma 3). Analogously, we obtain a packing of the items in Td in layers. Finally, we stack the layers one above the other inside the box B 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.

Figure 2: An example packing by Algorithm 3D-Vol-Pack.
Lemma 4.

Given a box B, and a set T of n items where each iT satisfies wiwB, didB and hiεhB. Further, either wiwB/2 or didB/2 holds for every iT. If v(T)(132ε)v(B), then 3D-Vol-Pack packs the whole set T into B in O(nlog2nloglogn) time.

Next, we give an algorithm when the items can be rotated by 90 degrees about any axis.

3DR-Vol-Pack.

Let T={iTwi>wB/2 and di>dB/2}, and let Ts=TT. First, we pack Ts in layers using 3D-Vol-Pack. Next, we sort the items of T 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 T 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 B is a cube and when the height of each item is very small compared to box B, we can pack a significant volume.

Lemma 5.

Given a cubical box B of side length w, and a set T of n items where for each iT, there exists an orientation so that wiw, diw and hiε2w holds. If v(T)(7245ε)v(B), then T can be packed into B by 3DR-Vol-Pack in O(nlog2nloglogn) time.

Figure 3: An example packing by Algorithm 3DR-Vol-Pack.

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 II 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 C𝒞 has an associated capacity 𝚌𝚊𝚙(C), a function fC:I0, and a polynomial-time algorithm 𝒜C,

  • there is a function g:I𝒞, such that for each C𝒞, items in g1(C) are packed into C using algorithm 𝒜C,

  • for any C𝒞 and TI such that iTfC(i)𝚌𝚊𝚙(C), for any constant ε>0, there exists a polynomial-time computable set TT with p(T)(1O(ε))p(T) such that T can be packed into C by the algorithm 𝒜C.

A Container Packing is said to be guessable if

  • the number of containers inside the knapsack is bounded by a constant Oε(1),111The notation Oε(f(n)) means that the implicit constant hidden in big-O notation can depend on ε.

  • the number of distinct possible types of containers (defined by their sizes along each dimension) is bounded by nOε(1), a polynomial in n,

  • whether a given collection of Oε(1) containers can be placed non-overlappingly inside the knapsack, can be checked in nOε(1) (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 C has capacity 𝚌𝚊𝚙(C) and the size of an item i for the (1D) knapsack is given by fC(i). 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 O(1) knapsacks [11], we obtain a feasible assignment of items into the containers, and finally for each container C, we use the algorithm 𝒜C to pack a subset of the items assigned to it, by losing only an O(ε)-fraction of profit.

3.1 Classification of containers

Figure 4: Different kinds of containers that we use. We have one type of Volume container and three types of Stack, Area, and Steinberg containers (one for each dimension).

We now describe the various types of containers that we use to pack items. For a container C, its width, depth, and height are denoted by wC,dC, and hC, respectively, and its volume v(C):=wC×dC×hC. For each container C, we specify its capacity 𝚌𝚊𝚙(C), the function fC, and the packing algorithm 𝒜C. Let T denote the set of items assigned to C such that iTfC(i)𝚌𝚊𝚙(C). 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 C that stacks items along the height. See container (1a) in Figure 4. The capacity 𝚌𝚊𝚙(C) of such a container is set to its height hC, and for any item i, fC(i):=hi if wiwC and didC, and fC(i):= otherwise.

    𝒜C just stacks the items of set T in the container C one above the other. Analogously containers (1b) and (1c) 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 (2a)). For such a container C, we set 𝚌𝚊𝚙(C):=wChC, and for any item i, we set fC(i):=wihi if wiεwC, hiεhC and didC, and fC(i):= otherwise.

    𝒜C first sorts the items of set T in non-increasing order of profit/front area ratio. Then, we select the largest prefix whose total front area does not exceed (12ε)wChC. We pack this prefix using NFDH on the front face. Analogously, container (2b) and (2c) show packing when NFDH is used on the left and bottom face of C, respectively.

  • Volume containers: The items are packed using 3D-NFDH inside these containers (see container (3)). The capacity of such a container C is set to be its volume v(C), and fC(i):=v(i) if wiεwC, diεdC and hiεhC, and fC(i):= otherwise.

    𝒜C sorts the items of T in non-decreasing order of profit/volume and selects the largest prefix with volume not exceeding (13ε)wChCdC. 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 𝚌𝚊𝚙(C):=v(C)/3. For any item i, we set fC(i):=v(i) if hiεhC, and either wiwC/2 or didC/2 holds. For all other items, we set fC(i):=.

    𝒜C first sorts the items in T in non-increasing order of profit/volume ratio. Then, we select the largest prefix whose volume does not exceed (132ε)v(C), and pack this prefix using 3D-Vol-Pack. Analogously, container (4b) and (4c) show packing when layers are stacked along the depth and width, respectively.

3.2 Our Structural Lemma

Let 𝚘𝚙𝚝gs be the maximum profit of a guessable container packing. The main structural result of our paper is the following.

Lemma 8.

For any ε>0, the optimal profit 𝚘𝚙𝚝 and the optimal profit of a guessable container packing 𝚘𝚙𝚝gs satisfies 𝚘𝚙𝚝(13929+ε)𝚘𝚙𝚝gs.

Together with Theorem 7, this gives us the following theorem.

Theorem 9.

For any constant ε>0, there is a polynomial-time (13929+ε)-approximation algorithm for 3DK.

We prove Lemma 8 in Section 4 by establishing several lower bounds on 𝚘𝚙𝚝gs. 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 OPT(I1L) (or similarly OPT(I2L) or OPT(I3L)). 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 ε>0 be an accuracy parameter. Let μ be a sufficiently small constant depending on ε (setting μ:=ε21/ε2 suffices). We now classify the input items based on their dimensions. Let LI be the set of items whose width, depth and height all exceed μ. Let I1I be the set of items having height at most μ. Similarly, let I2II1 be those items whose widths are at most μ, and I3:=I(LI1I2) be the remaining items. Thus each item in I3 has depth at most μ. Let I1 consist of the items in I1 whose width and depth are both more than 1/2, and let I1s=I1I1. See Figure 5.

Figure 5: Classification of input items. Front area and base area are shown at the bottom right.

The sets I2,I2s,I3,I3s are defined analogously.

Let 𝚘𝚙𝚝i:=p(OPTIi) for i[3], and 𝚘𝚙𝚝L:=p(OPTL), so that 𝚘𝚙𝚝=𝚘𝚙𝚝1+𝚘𝚙𝚝2+𝚘𝚙𝚝3+𝚘𝚙𝚝L. Let 𝚘𝚙𝚝1:=p(OPTI1) and 𝚘𝚙𝚝1s:=p(OPTI1s), so that 𝚘𝚙𝚝1+𝚘𝚙𝚝1s=𝚘𝚙𝚝1. The quantities 𝚘𝚙𝚝2,𝚘𝚙𝚝2s and 𝚘𝚙𝚝3,𝚘𝚙𝚝3s are defined analogously for the sets I2 and I3, respectively.

Finally, let v1:=v(OPTI1), and define v2,v3 analogously. Clearly, v1,v2,v3 sum up to at most the volume of the knapsack which is 1. We define h1:=h(OPTI1) and v1s:=v(OPTI1s). The quantities v2s,v3s are defined analogously.

4.1 First lower bound on 𝚘𝚙𝚝𝐠𝐬

We consider the packing of the items in OPTI1 (i.e., items with height at most μ) whose total profit is 𝚘𝚙𝚝1. 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 [δ10,δ) for a suitably chosen δ) at a (1+ε)-factor loss in the approximation ratio. Then the items are divided into four classes depending on their dimensions. An item i is big if both wiδ and diδ, wide if wiδ and di<δ10, long if wi<δ10 and diδ, and small if both wi<δ10 and di<δ10. The following lemma is obtained by an adaptation of the result of [19] (see Figure 6).

Lemma 10.

There exist disjoint sets T1,T2OPTI1 having a profit of at least (23O(ε))𝚘𝚙𝚝1, such that

  • Items of T1 are packed into a collection of O(1/δ6) configurations, where each configuration is a box having a 1×1 base, that is partitioned into O(1/δ2) (cuboidal) slots for packing big items, O(1/δ6) slots for packing wide and long items (using NFDH), and O(1/δ5) 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 12ε,

  • The set T2 contains only wide, long and small items and has a total volume of O(δ4).

Figure 6: In Step 1, we remove at most (1/3+O(ε)) fraction of the profit. In Step 2, we obtain a structured packing by [19].

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 δ𝚘𝚙𝚝1, and rounding the height of each configuration to the next integer multiple of μ/ε, each configuration for T1 can be further partitioned into O(1/δ6) guessable containers. Moreover, the items of T2 can be packed inside a Steinberg container of height ε.

After applying the above lemma, the rounded heights of all the configurations for T1 sum up to at most (12ε)+μεO(1δ6)1ε, for sufficiently small μ. Since items of T2 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 OPTI1 with profit at least (23O(ε))𝚘𝚙𝚝1 into O(1/δ12) guessable Stack, Area, and Volume containers.

An equivalent restructuring of OPTI2 and OPTI3 gives the following corollary.

Corollary 13.

𝚘𝚙𝚝gs(23O(ε))max{𝚘𝚙𝚝1,𝚘𝚙𝚝2,𝚘𝚙𝚝3}.

4.2 A simple (𝟓+𝜺)-approximation

We now present a simple (5+ε)-approximation for 3DK, which already improves upon the (7+ε)-approximation [10]. For this, first, we provide the following packing guarantee.

Lemma 14.

Let T be a set of items such that each iT satisfies hiε4. If v(T)1/4, then there exists TT with p(T)(1ε)p(T) such that there is a guessable container packing of T into a Stack and a Steinberg container.

Then the following lemma, together with Theorem 7, gives a (5+ε)-approximation.

Lemma 15.

𝚘𝚙𝚝(5+ε)𝚘𝚙𝚝gs.

Proof.

Trivially we have 𝚘𝚙𝚝gs𝚘𝚙𝚝L, since we can create a Stack container for every item in OPTL (at most 1/μ3 such items). Hence if 𝚘𝚙𝚝L>𝚘𝚙𝚝/5, we are already done. Otherwise we have 𝚘𝚙𝚝1+𝚘𝚙𝚝2+𝚘𝚙𝚝345𝚘𝚙𝚝. Now since v1+v2+v31, there must exist an i[3] such that 𝚘𝚙𝚝ivi45𝚘𝚙𝚝 – w.l.o.g. assume i=1. We have two cases.

Case 1: 𝒗𝟏𝟏𝟒.

In this case, Lemma 14 implies that 𝚘𝚙𝚝gs(1ε)𝚘𝚙𝚝1 (since each item in I1 has height at most μ<ε4). Hence if 𝚘𝚙𝚝1>𝚘𝚙𝚝/5, we are done. Otherwise we have 𝚘𝚙𝚝2+𝚘𝚙𝚝335𝚘𝚙𝚝. W.l.o.g.  assume that 𝚘𝚙𝚝2310𝚘𝚙𝚝, Corollary 13 gives us 𝚘𝚙𝚝gs(23O(ε))310𝚘𝚙𝚝=(15O(ε))𝚘𝚙𝚝.

Case 2: 𝒗𝟏>𝟏𝟒.

In this case, we sort the items of OPTI1 in non-increasing order of their profit to volume ratio, and pick the maximal prefix T whose volume does not exceed 14. Then we have v(T)14μ. Applying Lemma 14 to T, we obtain 𝚘𝚙𝚝gs(1ε)(1/4μv1)𝚘𝚙𝚝1(15O(ε))𝚘𝚙𝚝, thus completing the proof.

The ratio of (5+ε) is tight. One such instance is given when v1=18,v2=v3=38 and 𝚘𝚙𝚝1=𝚘𝚙𝚝L=15𝚘𝚙𝚝 and 𝚘𝚙𝚝2=𝚘𝚙𝚝3=310𝚘𝚙𝚝.

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 OPT(I1L), and restructure it to obtain a guessable container packing, by losing only an O(ε)-fraction of the profit. Let OPT1:=OPTI1 and OPTL:=OPTL. Since each item in L has all side lengths at least μ, the number of such items in the packing is |OPTL|1/μ3. Also, since the width and depth of each item in I1 is at least 1/2, the items of OPT1 must be packed in layers, i.e., the top and bottom faces of any item in OPT1 when extended parallel to the bottom face of the knapsack will not intersect another item from OPT1. 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.

Figure 7: Packing of items in OPT(LI1): The dotted (resp. dashed) lines show (front view of) horizontal planes passing through the top and bottom faces of items in OPTL (resp. T). We discard the items in OPT1T that are cut by these planes.

Let TOPT1 be the k items of largest profit in OPT1, for some k to be chosen later. Our goal is to obtain a container packing of all items in OPTL, together with a subset of OPT1 having a profit of at least (1ε)𝚘𝚙𝚝1. To this end, we shall pack all items in T and ensure that the number of discarded items of OPT1 is bounded by ck, for some constant c. By a result of [18], the profit of the discarded items can be bounded by ε𝚘𝚙𝚝1, for appropriately chosen k. 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 TOPTL, and discard the items of OPT1T intersecting these planes (see Figure 7). The number of discarded items is bounded by 2|OPTL|=O(1/μ3). The remaining items of OPT1T are now completely packed inside at most k+2|OPTL|+1 horizontal strips demarcated by the planes. Each such strip is a cuboidal box that is pierced from top to bottom by at most 1/μ2 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 OPT1T present inside the strip 𝒮 can be repacked into at most O(1/μ8) Stack containers, whose widths and depths lie in a polynomial-sized set.

For each item in TOPTL, we create a Stack container containing the single item itself. Together with Lemma 17, we get Oμ(1) 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 O(1/μ11)k items from OPT1T, the height of each Stack container can be made of the form jh¯, where j[n] and h¯ is the height of some item in I1L.

Together with the O(1/μ3) items that were discarded previously, Lemma 18 gives us that the total number of discarded items so far is at most O(1/μ11)k. We now use the following lemma from [18].

Lemma 19 ([18]).

Let p1p2pn>0 be a sequence of real numbers and P=i=1npi. Let c be a nonnegative integer and ε>0. If n=cΩ(1/ε), then there is an integer kcO(1/ε) such that pk+1+pk+ckεP.

The above lemma invoked with c=O(1/μ11) and with the correct guess of k gives us that the total profit of the discarded items is at most ε𝚘𝚙𝚝1, assuming that |OPT1| was sufficiently large (at least n0:=(1/μ)Ω(1/ε)) to begin with (otherwise, it is trivial). The following theorem summarizes the arguments of this section.

Theorem 20.

Consider the packing of OPT(I1L). Then by discarding items of OPTI1 having a total profit of at most ε𝚘𝚙𝚝1, the remaining items can be repacked into a guessable container packing, wherein items of L are placed inside at most 1/μ3 Stack containers, and items of I1 are packed into at most (1/μ)O(1/ε) Stack containers.

4.4 Third lower bound on 𝚘𝚙𝚝𝐠𝐬

In this subsection, we restructure the packing of items in OPTI1. Recall that 𝚘𝚙𝚝1=p(OPTI1) and 𝚘𝚙𝚝1s=p(OPTI1s), so that 𝚘𝚙𝚝1+𝚘𝚙𝚝1s=𝚘𝚙𝚝1. Also, v1:=v(OPTI1) and v1s=v(OPTI1s).

Theorem 21.

Consider the packing of OPTI1. It is possible to repack subsets of OPTI1 and OPTI1s into a guessable Stack and Steinberg container, respectively, whose profit, say P, satisfies the following properties:

  • P(1O(ε))𝚘𝚙𝚝1smax{3v1s,1},

  • If v11/3, then P(1O(ε))(34𝚘𝚙𝚝1+𝚘𝚙𝚝1s),

  • If v11/4, then P(1O(ε))𝚘𝚙𝚝1.

4.5 Fourth lower bound on 𝚘𝚙𝚝𝐠𝐬

In the previous sections, we repacked items from exactly one set out of I1,I2,I3. In this subsection, we restructure the packing of a subset of items from I1, together with items from I2I3L. To this end, we introduce a classification of the items in I2I3L. Let S2 (resp. S3,S) be the set of items in I2 (resp. I3,L) with height at most 1/2. Define 𝚘𝚙𝚝2t:=p(OPTS2) and 𝚘𝚙𝚝2h:=p(OPT(I2S2)), so that 𝚘𝚙𝚝2t+𝚘𝚙𝚝2h=𝚘𝚙𝚝2. The quantities 𝚘𝚙𝚝3t and 𝚘𝚙𝚝3h are defined analogously. Let 𝚘𝚙𝚝Lt:=p(OPTS) and 𝚘𝚙𝚝Lh:=p(OPT(LS)) so that 𝚘𝚙𝚝Lt+𝚘𝚙𝚝Lh=𝚘𝚙𝚝L. The following theorem repacks items from I1S2S3S.

Theorem 22.

Consider the packing of OPT(I1S2S3S) and assume that v11/6 and v2,v3>1/4. Then there is a guessable container packing of a subset T of these items into O(1/μ3) Stack and Steinberg containers having a profit of at least

(1O(ε))(34𝚘𝚙𝚝1+𝚘𝚙𝚝1s+max{320(𝚘𝚙𝚝2t+𝚘𝚙𝚝3t),13𝚘𝚙𝚝Lt}).

4.6 Fifth lower bound on 𝚘𝚙𝚝𝐠𝐬

In the previous subsection, we repacked items from S2,S3 or S together with items in I1. Now we consider items in (I2S2)(I3S3)(LS) 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 OPT((I2I3L)(S2S3S)). Then there is a guessable container packing into Oμ(1) Stack and Area containers each of height 1, having profit at least (12O(ε))(𝚘𝚙𝚝2h+𝚘𝚙𝚝3h+𝚘𝚙𝚝Lh).

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 v1,v2,v3 sum up to at most the volume of the knapsack which is 1, at least one among them must not exceed 1/3. If at most one of them exceeds 1/3, we show a stronger bound of (92+ε) on the approximation ratio. Otherwise, we assume w.l.o.g. that v11/3 and v2,v3>1/3. We further divide into subcases depending on the values of v2s and v3s. It turns out that the worst bound on 𝚘𝚙𝚝gs occurs when v2s,v3s both exceed 1/3 and v11/6. However for this case, Theorem 22 and Theorem 23 give us highly profitable packings, and we achieve an approximation ratio of (13929+ε). 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 ε>0, there is a polynomial-time (17/4+ε)-approximation algorithm for 3DK when all items have the same profit.

Theorem 25.

For any constant ε>0, there is a polynomial-time (4+ε)-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 C must satisfy the condition wChC. The capacity of C, 𝚌𝚊𝚙(C), is given by wChCwC2/4. For each item i packed inside C, there must be some orientation with width at least wC/2, depth at least dC/2, and height at most εhC. If these conditions are satisfied, then we set fC(i)wihi and otherwise. Algorithm 𝒜C is as follows. Given a set of items T satisfying fC(T)𝚌𝚊𝚙(C), we arrange them in non-increasing order of profit/(front area) ratio. Then, we select the largest prefix T whose total front area does not exceed wChCwC2/43εhC2. We now sort the items in T 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 90 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.

Figure 8: An example packing of items inside an 𝖫-Container.
Theorem 26.

For any constant ε>0, there is a polynomial-time (30/7+ε)-approximation algorithm for 3DKR.

Theorem 27.

For any constant ε>0, there is a polynomial-time (24/7+ε)-approximation algorithm for 3DKR when all items have the same profit.

Theorem 28.

For any constant ε>0, there is a polynomial-time (3+ε)-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 nf(1/ε) is mainly because of the step where we guess the containers and assign the items. Once this is done, every 𝒜C runs in time O(nlog2n). Hence, one interesting direction is whether the time to guess the containers and assign the items can be brought down to (n(logn)f(1/ε)) 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 d-dimensional bins in d 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.