Online Packing of Orthogonal Polygons
Abstract
While rectangular and box-shaped objects dominate the classic discourse of theoretic investigations, a fascinating frontier lies in packing more complex shapes. Given recent insights that convex polygons do not allow for constant competitive online algorithms for diverse variants under translation, we study orthogonal polygons, in particular of small complexity. For translational packings of orthogonal 6-gons, we show that the competitive ratio of any online algorithm that aims to pack the items into a minimal number of unit bins is in , where denotes the number of objects. In contrast, we show that constant competitive algorithms exist when the orthogonal 6-gons are symmetric or small. For (orthogonally convex) orthogonal 8-gons, we show that the trivial -competitive algorithm, which places each item in its own bin, is best-possible, i.e., every online algorithm has an asymptotic competitive ratio of at least . This implies that for general orthogonal polygons, the trivial algorithm is best possible.
Interestingly, for packing degenerate orthogonal polygons (with thickness ), called skeletons, the change in complexity is even more drastic. While constant competitive algorithms for 6-skeletons exist, no online algorithm for 8-skeletons achieves a competitive ratio better than .
For other packing variants of orthogonal 6-gons under translation, our insights imply the following consequences. The asymptotic competitive ratio of any online algorithm is in for strip packing, and there exist online algorithms with competitive ratios in for perimeter packing, or in for minimizing the area of the bounding box. Moreover, the critical packing density is positive (if every object individually fits into the interior of a unit bin).
Keywords and phrases:
Packing, orthogonal polygon, algorithm, offline, online, competitive ratio, bin packing, strip packing, perimeter packing, critical density, 6-gon, 8-gon, L-shape, Z-shape, skeletonCopyright and License:
2012 ACM Subject Classification:
Theory of computation Computational geometryAcknowledgements:
We thank the anonymous reviewers for their valuable comments and suggestions, which helped to improve the quality of this work. In particular, we thank an anonymous reviewer for the suggestion to use NextFit in the proof of Theorem 6(i) and improving the analysis to obtain a competitive ratio of 2.Editors:
Hee-Kap Ahn, Michael Hoffmann, and Amir NayyeriSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
Packing problems not only present us with constant challenges in everyday life, but also find applications in manufacturing industries, logistics, and scheduling. While rectangular and box-shaped objects dominate the classic discourse of theoretic investigations, a fascinating frontier lies in the packing of more complex objects, e.g., convex polygons. The problem of packing convex polygons is particularly interesting when restricting the allowed motions to translations, as allowing for rotations reduces the problem to mere rectangle packing. Across the numerous variants – be it strip packing, bin packing, or perimeter packing – the overall picture is that constant factor approximations exist for translational packings of convex polygons [7, 8, 1, 41]. However, the landscape changes when we step into the online realm where items arrive sequentially one after the other and decisions have to be made irrevocably without knowing the future items: In this setting, no online algorithm for translational packings of convex polygons has a constant competitive ratio, as recently shown by Aamand, Abrahamsen, Beretta, and Kleist [1]. This is in stark contrast to the case of rectangles, for which constant competitive algorithms exist for various variants, cf. Section 1.1.
In this work, we study the online packing problem of orthogonal polygons which are orthogonally convex, combining relaxed features of both orthogonality and convexity. A polygon is orthogonally convex if the intersection with any axis-parallel line has at most one connected component. The simplest yet unresolved setting involves orthogonal 6-gons, which include L-shapes. For examples, consider Figure 1.
The diverse applications motivate a multitude of interesting packing problems. Among them are bin packing, strip packing, perimeter packing and area packing for various types of objects and allowed motions; for definitions see Section 2. Many variants of these packing problems are known to be computationally difficult. While NP-hardness has usually been known for a long time [5, 28, 35, 43], more recently, some variants were proved to even be -complete by Abrahamsen, Miltzow, and Seiferth [4]. Adding to this difficulty, we might not have complete information about the objects in advance, e.g., they may appear over time. This is captured by the so called online setting where the objects are presented one after another and the next object is only revealed when the previous one has been placed.
In competitive analysis, the performance of an online algorithm is measured against the optimal offline solution. While the absolute competitive ratio gives the worst-case performance over all possible inputs, the asymptotic competitive ratio describes the behavior when the input size goes to infinity. For precise definitions, we refer to Section 2. In the following we present our contributions, see also Tables 1 and 2. Usually, we present lower bounds on the asymptotic competitive ratio and upper bounds on the absolute competitive ratio which imply the statements for both ratios.
Bin Packing of 6-gons.
For bin packing of orthogonal polygons, it is natural to consider the variants where the objects can only be translated, and where the objects may be rotated by multiples of 90 degrees. The following proposition shows that even in the latter variant we may restrict our analysis to the translational case. In the problem Ortho-BinPack, we receive orthogonal polygons which have to be placed into a unit square bin by translation. The goal is to minimize the number of used bins. Ortho-BinPack denotes the variant where the polygons might be rotated by multiples of 90 degrees.
Proposition 1.
The best (absolute/asymptotic) competitive ratios for Ortho-BinPack and Ortho-BinPack are within constant factors of each other. The analogous statements hold for the best approximation ratios of the offline variants.
Proposition 1 allows us to focus on translations only. We start with a lower bound on the competitive ratio of any online algorithm for L-shapes. To this end, let L-BinPack denote the variant of Ortho-BinPack where each polygon is an L-shape.
Theorem 2.
The asymptotic competitive ratio of any online algorithm for L-BinPack is in .
We obtain this lower bound by reducing from an online sorting problem where natural numbers have to placed in arrays such that the numbers in each array are increasing. Note that the trivial algorithm, which packs each object into its own bin, is -competitive.
In contrast to Theorem 2, there exist constant competitive algorithms for some interesting subclasses of L-shapes, namely when the L-shapes are either all symmetric or all small. An L-shape is described by four parameters . It is small if , large if , and symmetric if and . For illustrations see Figure 1.
Theorem 3.
There is an online algorithm for L-BinPack with a constant asymptotic competitive ratio when all L-shapes are symmetric or small. In particular, there exist algorithms that use at most
-
(a)
bins when all L-shapes are large and symmetric.
-
(b)
when all L-shapes are small.
-
(c)
when all L-shapes are symmetric.
Theorem 3 directly yields algorithms with a constant absolute competitive ratio of 35, 15 and 50, respectively, as in bin packing, we have for any nonempty set of items.
The results for symmetric L-shapes are based on identifying their connection to scheduling problems. Competitive algorithms for two special cases of large and symmetric L-shapes follow directly from previous work on scheduling problems. Precisely, an -competitive algorithm for objects of equal widths [22] and a 2-competitive algorithm for the case of equal lengths [24] can be deduced, see Subsection 1.1 for explanations. A connection to scheduling problems is also used for the 33-competitive algorithm which builds on a constant competitive algorithm by Devanur et al. [22] for a special machine minimization problem in combination with an online coloring algorithm for intervals graphs by Kierstead and Trotter [39]. For details on the connection to scheduling problems, we refer to Subsection 1.1.
Other packing variants.
Our insights on online bin packing of L-shapes have consequences for other packing variants. In the problem L-PeriPack, we receive L-shapes , and the goal is to place them in the plane such that the perimeter of the bounding box is minimized. In L-AreaPack, the goal is to minimize the area of the bounding box. For a unit square bin and L-shapes with arm lengths bounded by some constant , the online critical density is the largest value of such that there exists an online algorithm which packs any sequence with total area at most into the bin.
Corollary 4.
The following statements hold for L-shapes with arm lengths in :
-
(i)
The asymptotic competitive ratio of any online algorithm for L-StripPack is in .
-
(ii)
There is an online algorithm for L-PeriPack with absolute competitive ratio in .
-
(iii)
There is an online algorithm for L-AreaPack with asymptotic competitive ratio in .
-
(iv)
The online critical packing density is positive if the arm lengths of each L-shape are bounded by . For , the online critical packing density is .
The -competitive algorithm for L-AreaPack is asymptotically best-possible, as a lower bound of already for rectangles has been shown by Abrahamsen and Beretta [3].
Orthogonal polygons of higher complexity.
For bin packing of orthogonal 8-gons, we show that the trivial algorithm, that places each shape into its own bin, achieves the best possible competitive ratio. Hence, the trivial algorithm is also best possible for Ortho-BinPack.
Theorem 5.
There is no online algorithm for Ortho-BinPack that achieves an asymptotic competitive ratio better than , even when restricting to orthogonally convex 8-gons.
We obtain Theorem 5 by considering Z-shapes of equal thickness; Figure 2(a) depicts an example. Interestingly, we obtain this result via first considering packings of skeletons, which can be viewed as orthogonal polygons of widths 0, see Figures 2(b) and 2(c). In the problem L-Skel-BinPack (Z-Skel-BinPack), L-skeletons (Z-skeletons) shall be packed into a minimum number of bins. In this context, we consider a packing of skeletons as valid if any two objects are disjoint, with the exception that either of the two endpoints of one skeleton may touch another; a point of a Z-skeleton is an endpoint if it is a unique extreme point, i.e., topmost, bottommost, leftmost, or rightmost. From L- to Z-skeletons, there is a quite drastic jump in complexity.
Theorem 6.
For online bin packing of orthogonal skeletons the following holds.
-
(i)
There exists an online algorithm for L-Skel-BinPack with a constant absolute competitive ratio.
-
(ii)
No online algorithm for Z-Skel-BinPack has an asymptotic competitive ratio better than .
Organization.
The remainder of the paper is organized as follows. In Section 1.1, we discuss related work. In Section 2, we give a concise dictionary on crucial notions. In Section 3, we prove Theorem 2, i.e., the lower bound on the competitive ratio for L-BinPack and use our insights to show a lower bound for L-StripPack in Section 4. In Section 5, we consider orthogonal polygons of higher complexity and sketch the proofs of Theorems 5 and 6(ii). Complete proofs of all results can be found in the full version of this paper [30].
1.1 Related work
As the literature on online packing problems is extensive, we refer to the surveys of Christensen, Khan, Pokutta, and Tetali [19], Epstein and van Stee [26], van Stee [49, 50], and Csirik and Woeginger [21] for an overview. Below we discuss the most important results related to the packing problems studied in this paper.
Rectangles.
Rectangle packings has been studied for almost 50 years. A straightforward reduction from partition shows that the offline strip packing problem cannot be approximated with an absolute factor better than 3/2 unless , and the best known approximation ratio is by Harren, Jansen, Prädel, and Van Stee [35]. For the online variant, first fit shelf algorithms as proposed by Baker and Schwarz [10], are widely studied. The best known competitive ratio of is achieved by Ye, Han, and Zhang [52]. Restricting the attention to large instances, the best asymptotic competitive ratio is lower bounded by by van Vliet [51] and upper bounded by by Han, Iwama, Ye, and Zhang [32].
For bin packing of rectangles under translation, there exist approximation algorithms with approximation ratio 2 [34] and asymptotic approximation guarantee by Bansal and Khan [14]. For online bin packing of rectangles, the upper bound on the asymptotic competitive ratio for online translational bin packing axis-parallel rectangular pieces into unit square bins has been decreased in a series of papers from [20] to about by Han, Chin, Ting, Zhang and Zhang [31] and the lower bound has been increased from [29] to by Epstein [23]. For the special case of squares, the lower bound is approximately 1.75 due to Balogh, Békési, Dósa, Epstein, and Levin [11], while the upper bound is above 2.08 by Epstein and Mualem [25].
For the problem of area minimization, Abrahamsen and Beretta [3] present -competitive algorithms and show a lower bound of for both versions of rotation allowed and translations only. For perimeter minimization, they gave a -competitive algorithm for both, translation and rotation, as well as a lower bound on the competitive ratio of for the case of translation and of for the case of rotation.
Convex Polygons.
Constant-factor approximations for packing convex polygons exist for many variants [7, 8, 1, 41]; an exception is bin packing where constant approximation factors are only known if the diameter of the items is bounded by a constant. In contrast to these constant guarantees, for online translational packings of convex polygons, Aamand, Abrahamsen, Beretta and Kleist [1] show that strip packing, bin packing, and perimeter packing do not allow for constant competitive online algorithms, even if all pieces have a diameter bounded by an arbitrarily small constant. To this end, they reduce to an online sorting problem which sparked follow-up investigations [2, 9, 47]. Concerning upper bounds, they give an online algorithm with competitive ratio for strip packing. The knapsack problem for convex polygons under rigid motions is studied by Merino and Wiese [45].
Orthogonal Polygons and Scheduling.
We identified interesting connections between packings of special L-shapes and scheduling problems such as open end bin packing and machine minimization. These yield algorithms for large and symmetric L-shapes in the case where all L-shapes have equal lengths or equal widths; for an overview see Table 3.
The case of equal lengths is related to open end bin packing. In a variant of classical 1D bin packing known as ordered open end bin packing, items of sizes in (0, 1] are presented one by one, and must be assigned to bins in this order. An item can be assigned to any bin for which the current total size is strictly below 1, i.e., the bin can be overloaded by its last packed item. Balogh, Epstein, and Levin [13] present a -competitive online algorithm and Epstein [24] designs a approximation. As packings of large, symmetric L-shapes of equal lengths can be reduced to open end bin packing, we obtain offline and online algorithms with constant factors. Specifically, for packing L-shapes of length , we consider open end bins of capacity . An L-shape with arm length and width is associated with a real . It is easy to see that an can be packed into a bin containing (bottom-leftmost) if . Similarly, can be packed into an open bin containing if (and only if) . As these conditions are equivalent, solutions of open end bin packing translate to (bottom-leftmost) packings of large, symmetric L-shapes of equal lengths. This implies a 2-competitive online algorithm and a 1.5-approximation in this case.
For bin packing of large and symmetric L-shapes with different lengths, we identified a close connection to the machine minimization problem: Given a set of jobs, each of which has a release time , a processing time and deadline , the task is to schedule these jobs on a minimum number of machines such that each machine processes at most one job at a time and each job starts not before its release time, and finishes not after its deadline. For large and symmetric L-shapes, we show that the two parameters, length and width , translate to a job with release time , processing time , and deadline . Therefore, we present relevant work in the context of machine minimization. Yu and Zhang [53] present approximation algorithms for the special cases of equal deadlines and equal processing times. In particular, their 2-approximation algorithm for the special case of equal deadlines translates to a 2-approximation for offline bin packing of large, symmetric L-shapes. Kao, Chen, Rutter, and Wagner [38, Lemmas 1 and 2] present a polynomial algorithm that computes the offline optimal solution for jobs of unit processing times. This translates to a polyomial time algorithm for offline packings of instances where all L-shapes are large, symmetric, and have equal widths. Devanur, Makarychev, Panigrahi, and Yaroslavtsev [22, Section 2,3] present an -competitive online algorithm for unit processing times; they also show that the competitive ratio of is optimal. This result is also implied by Bansal, Kimbrel, and Pruhs [15, Lemmas 4.7 and 4.8]. The insights can be translated to an -competitive algorithm for packing large, symmetric L-shapes of equal widths. Moreover, Devanur et al. [22] present a 16-competitive online algorithm for the case with equal deadlines; their techniques are the basis of our 33-competitive algorithm for packing large symmetric L-shapes, namely Theorem 3(a).
There are many more results on the general case of machine minimization. However, due to a lower bound of by Saha [48], most subsequent work allows preemption of the jobs [18, 17, 36], a setting that does not carry over to packings of L-shapes.
Critical densities.
For a given container of volume and a class of objects in , the critical density is the largest value of such that any sequence of objects of the class with a total volume of at most can always be packed in the container. For convex bodies of bounded diameter in , Auerbach, Banach, Mazur and Ulam [44] stated (without proof) that the critical density is positive, i.e., there exists a function such that any sequence of convex bodies in , each of diameter and total volume of at most , can be packed into a cube with side length when rotations are allowed. The first proof, even for arbitrary dimension, is given by Kosiński [40]. When rotations are not allowed, Alt, Cheong, Park, and Scharf [6] showed that the critical density of packing convex bodies of bounded diameter into a cube is ; in particular for packing unit disks in . However, for cubes, Moon and Moser [46] showed that any sequence of cubes in of total volume can be packed into the unit cube. This bound is the best possible, because for any , two cubes with side lengths cannot be packed in the unit cube.
The study of critical densities likewise makes sense when the pieces appear in an online fashion. A lower bound on the critical density of online packing squares into the unit square has been improved in a sequence of papers [37, 16, 33, 27] from [37] to [16]. Interestingly, Januszewski and Lassak [37] proved that in dimension , the critical density of online packing cubes into the unit cube is , just as in the offline case. Lassak and Zhang [42] showed that for some constant , any sequence of axis-parallel boxes of diameter and total area at most can be packed online in the -dimensional unit hypercube using translations. This implies that the critical packing density for convex bodies is positive for any dimension when rotations are allowed as each body can be rotated so that it has a constant (depending on the dimension) density in its axis-parallel bounding box. In contrast, for translational and online packing convex polygons, Aamand, Abrahamsen, Beretta and Kleist [1] show that the critical packing density is .
2 Notions: packing variants, competitive analysis, and objects
We briefly define the packing variants, review the common terminology for competitive analysis, and introduce the considered objects.
Packing variants.
Depending on the context, there are numerous packing variants specified by the container and objective. The variants discussed in this paper are as follows. Consider a set (or sequence) of items. Given an unbounded supply of identical unit bins, the goal of bin packing is to pack the items into as few bins as possible. Given a horizontal strip of height which is bounded to the left but infinite to the right, the aim of strip packing is to place the items in the strip such that the maximum -coordinate of an occupied point is minimized. In perimeter packing or area packing, the goal is to find a placement of the items in the plane such that the perimeter or the area of the bounding box is minimized, respectively. All of these variants are interesting as offline and online problems. In this work we focus on online problems and therefore review competetitive analysis.
Competitive analysis.
In an online problem, the input is a sequence of objects, and we need to process object (in a problem-specific manner) before the next object is revealed. In this work, the objects are either natural numbers, orthogonal polygons, or their skeletons. We briefly revisit the standard terminology of competitive analysis for an online algorithm of a minimization problem. For an instance , denotes the cost of the offline optimum solution and denotes the cost of the solution computed by for input . Let be a function of the size of the instance, in our context typically the number of objects. We say that has (absolute) competitive ratio if, for all instances , it holds that Similarly, has asymptotic competitive ratio if there exists a constant such that for all .
Objects.
We focus on packings of orthogonal polygons that we call L-shapes and Z-shapes. An L-shape is the union of a rectangle of width and height with a rectangle of width and height , with and , such that their lower left corners coincide. Figure 3(a) presents an example. We describe the placement of an L-shape by specifying the coordinates of its reference point, namely its lower left corner.
We note that each orthogonal 6-gon is either an L-shape or a rotated L-shape. An L-shape is small if , large if , and symmetric if and .
A Z-shape is the union of three rectangles: A base rectangle of height and width , and two arm rectangles: One arm (above) of width and height , whose lower left corner coincides with the lower left corner of the base, and one arm (below) of width and height such that its upper right corner coincides with the upper right corner of the base, where , see also 3(c). In this paper, we will mostly be concerned with Z-shapes of equal thickness, i.e., the case where . Note that all L-shapes and Z-shapes are orthogonally convex, i.e., the intersection with any axis-parallel line is connected.
L-skeletons and Z-skeletons are the corresponding shapes with zero thickness, i.e., and , respectively. Figures 3(b) and 3(d) present examples.
3 Lower bound for bin packing of L-shapes – Proof of Theorem 2
We now prove the lower bound for L-BinPack. See 2
We show this in two steps. We prove that any online algorithm for L-BinPack yields an algorithm for an online sorting problem called BinSorting with the same competitive ratio, and show that every online algorithm for BinSorting has a competitive ratio in . We start by introducing the problem BinSorting.
3.1 Bin sorting
The online problem BinSorting can be described as a game between two players, Presenter and Algorithm, playing on several arrays with slots each, in which natural numbers have to be inserted. Within each array, the numbers must be increasing. Presenter presents distinct numbers. When receiving a number, Algorithm has to irrevocably decide in which array and in which slot the number is placed while obeying the rule that the numbers of each array are increasing. The goal of Algorithm is to minimize the number of used arrays, while Presenter wants to maximize it. Figure 4 presents an example of this game.
The offline optimum corresponds to the setting where Algorithm knows all numbers in advance and is simple to determine: For numbers in arrays with slots, arrays are necessary and, as the numbers can be inserted in a sorted manner, also sufficient. Consequently, .
We start by presenting a strategy for Presenter forcing Algorithm to use at most a logarithmic number of slots in each array.
Lemma 7.
The asymptotic competitive ratio of any online algorithm for BinSorting is at least . For , the lower bound is .
Proof.
We show that Presenter has a strategy to present numbers such that Algorithm uses at least arrays while arrays would suffice. The idea is as follows: Consider a partially filled array . The numbers in partition it into maximal sections of free slots. If a new number shall be inserted in , it may be placed into at most one of these sections, since the entries in the array must be increasing. We say that two (possible future) numbers are similar with respect to if they must be placed in the same section. The idea of Presenter is to maintain a set of active numbers that are similar for all arrays.
In order to present natural numbers , Presenter maintains the following invariant: In the beginning of iteration , it has an active set of similar numbers. In the very beginning (of iteration 1), the set is , each array has one section containing all slots, and Presenter presents . In iteration , Presenter determines the next number to be presented based on the action of Algorithm in iteration . Algorithm places in a section of some array which results in two smaller sections. If the smaller of the two section lies to the left of , then the active set is updated to and ; otherwise it is updated to and . As the new active set is a subset of the previous, Algorithm must place numbers presented in the future in (subsets of) the current sections of the active set. By construction, the numbers of the active set remain similar. The active set is non-empty for at least iterations because it contains numbers if .
When we restrict our attention to a fixed array with slots, then the section for the active numbers is (at least) halved each time a number is inserted; this is because we ensure that the active set must be inserted in the smaller section. Therefore, Algorithm can place at most of the numbers in each array and thus needs at least bins. This yields a competitive ratio of at least .
We remark that the lower bound of Lemma 7 is tight, that is, there exists an online algorithm BinSorting that matches this bound.
Lemma 8.
There exists an online algorithm for BinSorting with absolute competitive ratio of .
Proof.
For each partially filled array and any number, the valid slots form a consecutive interval. Clearly, in an empty array, all slots are valid. Let denote the algorithm that places a new number in the first array with a valid slot, and in particular, in the middle slot of the section. With this choice, the smallest section of an array containing numbers has length . Therefore each array contains at least numbers before a new array is opened. Consequently, uses at most arrays while .
3.2 From L-BinPack to BinSorting
We now show how to create instances of L-BinPack which simulate BinSorting. The construction is visualized in Figure 5. For fixed , we consider the family of L-shapes with the following parameters:
The key idea is that in L-BinPack mimics the natural number for BinSorting. We start with the crucial property that each subset of packed into a bin is sorted.
Lemma 9.
Each set packs into one bin if and only if and the items are placed in descending order of their indices .
Proof.
By construction up to items of fit into one bin in descending order of their indices: With respect to the -coordinate, exactly items can be packed next to each other. For the -coordinate, we note the following. When is placed somewhere in the bin, the free space above is lower bounded by
So when placed in descending order, there is space for items. Figure 5(c) depicts an example for . It remains to show that cannot be placed below/left of when . It cannot be placed entirely to the left of , because , and it cannot be placed below because .
We now show how an algorithm for L-BinPack yields an algorithm for BinSorting.
Lemma 10.
An online-algorithm for L-BinPack yields an algorithm for BinSorting with the same (absolute/asymptotic) competitive ratio.
Proof.
Let be an -competitive algorithm for L-BinPack and consider an instance of BinSorting with numbers. We describe an online algorithm for BinSorting which uses as a subroutine. For each presented number , presents to . By Lemma 9, at most L-shapes of fit into one bin. Let denote the -coordinate of the reference point of in the th bin as assigned by . Then places number in the slot of the th array. As , it holds that . We shortly argue that this position is valid. Firstly, because all L-shapes have width , the assigned -values differ by at least and for any and with , we have . Secondly, as guarantees that the numbers of each array are increasing, the same holds for the indices of the L-shapes. Hence, by Lemma 9, the placement is valid. Consequently, we may translate the -position of in the th bin to a unique slot in the th array. The number of used arrays equals the number of used bins. Moreover, the offline optimum is in both problems. Hence, is -competitive.
Corollary 11.
For each online algorithm for L-BinPack and each , there exists a strategy to present L-shapes from (no duplicates) such that they can all be packed into one bin while uses at least bins.
4 Strip packing of L-shapes – Proof of Corollary 4(i)
We now prove Corollary 4(i). To this end, we show how a strip packing algorithm yields a bin packing algorithm.
Lemma 12.
An algorithm for strip packing a sequence of L-shapes from (without duplicates) with asymptotic competitive ratio yields an algorithm for L-BinPack with asymptotic competitve ratio .
Proof.
Let be an asymptotic -competitive algorithm for L-StripPack and consider an instance of L-BinPack with objects from . We describe an online algorithm for L-BinPack which uses as a subroutine. For each each , presents it to and observes its placement in the strip. The idea is to partition the strip into slots of widths ; each slot will correspond to a placement in a bin. For an illustration, see Figure 6. We show that objects of consecutive slots can be packed into one bin. If the reference point of is placed at in the strip, then places it as follows. Let such that and . Then places in the st bin such that its reference point is at .
We now argue that this yields a valid bin packing. Let and be two L-shapes in a same bin and denote their -coordinates in the strip by and , and in the bin by and , respectively. We assume that . By construction, we have that . The placement implies that and hence , i.e., in each bin the L-shapes are non-increasing. Moreover, due to the equal width of , no two L-shapes intersect in the -direction. Without duplicates, no intersections in the -direction follow from the definition of . Lastly, if then . Therefore, the -span of the L-shapes is at most 1.
It remains to check the number of bins. Let and denote the offline optimum values for L-StripPack and L-BinPack, respectively. Clearly, we have ; recall that all objects pack into one bin by Lemma 9. As is asymptotically -competitive, there is a constant such that the width of the strip packing is at most . The number of bins is , so is asymptotically -competitive.
Together, Lemmas 12 and 11 imply Corollary 4(i).
5 Orthogonal polygons of higher complexity – Theorems 5 and 6(ii)
As a stepping stone towards a proof of Theorem 5, we first consider Z-skeletons.
Proposition (corresponding to Theorem 6(ii)).
No online algorithm for Z-Skel-BinPack has an asymptotic competitive ratio better than .
For the proof, we consider an arbitrary online algorithm for Z-Skel-BinPack, and use Algorithm 1 to generate a sequence of Z-skeletons such that they can be packed into one bin, but is forced to use one bin per Z-skeleton.
Lemma 13.
For every online algorithm of Z-Skel-BinPack, Algorithm 1 generates a sequence of Z-skeletons such that uses bins.
Proof Sketch.
For any Z-skeleton packed by , Algorithm 1 ensures that all future it presents cannot be placed into the bin of . In particular, if places far to the left, all have a longer upper arm than , but are too wide to fit under , as in 7(a). Similarly, if places a Z-skeleton far to the right, then all have a shorter upper arm than , but are too wide to fit above , as in 7(b).
In order to expand the Z-skeletons to Z-shapes, we ensure the Z-skeletons can even be packed with some positive distance to each other.
Lemma 14.
Let be Z-skeletons generated by some execution of Algorithm 1. Then, can be packed into one bin, such that all horizontal gaps between the Z-skeletons and the bin boundary have width at least .
Proof Sketch.
First, we show that we may partition the generated Z-skeletons into two subsets and , where the parameter grows or shrinks, respectively, as the parameter grows. By induction on , we show that, given any , the shapes of can be packed into the L-shape with parameters , depicted in 8(a), such that all horizontal gaps have size .
Similarly, can be packed into a rotated L-shape with parameters , illustrated in 8(c). Finally, both of these L-shapes can be packed into a unit bin with the desired distances, see 8(d).
Lemmas 14 and 13 directly imply Theorem 6(ii). Moreover, the horizontal gap sizes of Lemma 14 allow to expand the Z-skeletons of Algorithm 1 to Z-shapes with thickness . Lemma 14 guarantees that if the Z-skeletons cannot be packed disjointly, the Z-shapes cannot be packed interiorly disjoint. Consequently, there is no online algorithm for Ortho-BinPack of Z-shapes of equal thickness that achieves an asymptotic competitive ratio better than , which implies the following result.
Theorem 5. [Restated, see original statement.]
There is no online algorithm for Ortho-BinPack that achieves an asymptotic competitive ratio better than , even when restricting to orthogonally convex 8-gons.
The similarity to Lemma 13 is in contrast to orthogonal 6-gons, where bounds on the competitive ratios for L-skeletons and L-shapes differ drastically, cf. Theorems 2 and 6(i).
6 Conclusion and open problems
In this work, we investigated various packing problems of orthogonal polygons under translation. For L-shapes, the yet smallest open case, we wondered whether they behave more like rectangles or convex polygons. For bin packing, we provided a surprisingly large lower bound on the competitive ratio of about for general L-shapes and for general orthogonal polygons. That means that the trivial algorithm, which packs each item into its private bin, is worst-case optimal for orthogonal polygons. These lower bounds are much higher than for convex polygons, cf. Table 2. In contrast, for symmetric and small L-shapes there exist constant competitive algorithms. This insight implies that in terms of the competitive ratio, L-shapes behave more like rectangles for perimeter packing, area packing, and the online critical density.
Many interesting problems remain for future work. Most notably, it remains to improve the bounds or even close the gaps for the problems stated in Tables 2 and 1. This includes the problem of determining the best competitive ratio for online bin packing of L-shapes, as it remains open whether it it possible to beat the trivial algorithm for L-BinPack.
References
- [1] Anders Aamand, Mikkel Abrahamsen, Lorenzo Beretta, and Linda Kleist. Online sorting and translational packing of convex polygons. In Symposium on Discrete Algorithms (SODA 2023), pages 1806–1833. SIAM, 2023. doi:10.1137/1.9781611977554.ch69.
- [2] Mikkel Abrahamsen, Ioana O. Bercea, Lorenzo Beretta, Jonas Klausen, and László Kozma. Online Sorting and Online TSP: Randomized, Stochastic, and High-Dimensional. In European Symposium on Algorithms (ESA 2024), volume 308 of LIPIcs, pages 5:1–5:15, 2024. doi:10.4230/LIPIcs.ESA.2024.5.
- [3] Mikkel Abrahamsen and Lorenzo Beretta. Online Packing to Minimize Area or Perimeter. In 37th International Symposium on Computational Geometry (SoCG 2021), pages 6:1–6:15, 2021. doi:10.4230/LIPIcs.SoCG.2021.6.
- [4] Mikkel Abrahamsen, Tillmann Miltzow, and Nadja Seiferth. Framework for -completeness of two-dimensional packing problems. TheoretiCS, 3, 2024. doi:10.46298/theoretics.24.11.
- [5] Helmut Alt. Computational aspects of packing problems. Bulletin of the EATCS, 118, 2016. URL: http://eatcs.org/beatcs/index.php/beatcs/article/view/390.
- [6] Helmut Alt, Otfried Cheong, Ji-won Park, and Nadja Scharf. Packing 2D disks into a 3D container. In International Workshop on Algorithms and Computation (WALCOM 2019), pages 369–380, 2019. doi:10.1007/978-3-030-10564-8_29.
- [7] Helmut Alt, Mark de Berg, and Christian Knauer. Approximating minimum-area rectangular and convex containers for packing convex polygons. Journal of Computational Geometry, 8(1):1–10, 2017. doi:10.20382/jocg.v8i1a1.
- [8] Helmut Alt, Mark de Berg, and Christian Knauer. Corrigendum to: Approximating minimum-area rectangular and convex containers for packing convex polygons. Journal of Computational Geometry, 11(1):653–655, 2020. doi:10.20382/jocg.v11i1a26.
- [9] Yossi Azar, Debmalya Panigrahi, and Or Vardi. Nearly tight bounds for the online sorting problem. CoRR, abs/2508.14287, 2025. doi:10.48550/arXiv.2508.14287.
- [10] Brenda S. Baker and Jerald S. Schwarz. Shelf algorithms for two-dimensional packing problems. SIAM Journal on Computing, 12(3):508–525, 1983. doi:10.1137/0212033.
- [11] János Balogh, József Békési, György Dósa, Leah Epstein, and Asaf Levin. Lower bounds for several online variants of bin packing. Theory of Computing Systems, 63:1757–1780, 2019. doi:10.1007/s00224-019-09915-1.
- [12] János Balogh, József Békési, György Dósa, Leah Epstein, and Asaf Levin. A new lower bound for classic online bin packing. Algorithmica, 83:2047–2062, 2021. doi:10.1007/s00453-021-00818-7.
- [13] János Balogh, Leah Epstein, and Asaf Levin. More on ordered open end bin packing, 2020.
- [14] Nikhil Bansal and Arindam Khan. Improved approximation algorithm for two-dimensional bin packing. In Symposium on discrete algorithms (SODA 2014), pages 13–25. SIAM, 2014. doi:10.1137/1.9781611973402.2.
- [15] Nikhil Bansal, Tracy Kimbrel, and Kirk Pruhs. Speed scaling to manage energy and temperature. Journal of the ACM, 54(1):1–39, 2007. doi:10.1145/1206035.120603.
- [16] Brian Brubach. Improved bound for online square-into-square packing. In International Workshop on Approximation and Online Algorithms (WAOA 2014), pages 47–58, 2014. doi:10.1007/978-3-319-18263-6_5.
- [17] Lin Chen, Nicole Megow, and Kevin Schewior. The Power of Migration in Online Machine Minimization. In Symposium on Parallelism in Algorithms (SPAA 2016) and Architectures, pages 175–184, Pacific Grove California USA, 2016. doi:10.1145/2935764.2935786.
- [18] Lin Chen, Nicole Megow, and Kevin Schewior. An -Competitive Algorithm for Online Machine Minimization. SIAM Journal on Computing, 47(6):2057–2077, 2018. doi:10.1137/17M116032X.
- [19] 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.
- [20] Don Coppersmith and Prabhakar Raghavan. Multidimensional On-Line Bin Packing: Algorithms and Worst-Case Analysis. Operations Research Letters, 8(1), 1989. doi:10.1016/0167-6377(89)90027-8.
- [21] János Csirik and Gerhard J. Woeginger. On-line packing and covering problems. In Amos Fiat and Gerhard J. Woeginger, editors, Online Algorithms: The State of the Art, pages 147–177. Springer, 1998. doi:10.1007/BFb0029568.
- [22] Nikhil Devanur, Konstantin Makarychev, Debmalya Panigrahi, and Grigory Yaroslavtsev. Online Algorithms for Machine Minimization, 2014. doi:10.48550/arXiv.1403.0486.
- [23] Leah Epstein. A lower bound for online rectangle packing. Journal of Combinatorial Optimization, 38:846–866, 2019. doi:10.1007/s10878-019-00423-z.
- [24] Leah Epstein. Open-end bin packing: new and old analysis approaches. Discrete Applied Mathematics, 321:220–239, 2022. doi:10.1016/j.dam.2022.07.003.
- [25] Leah Epstein and Loay Mualem. Online bin packing of squares and cubes. Algorithmica, 85(5):1415–1458, 2023. doi:10.1007/S00453-022-01078-9.
- [26] Leah Epstein and Rob van Stee. Multidimensional packing problems. In Teofilo F. Gonzalez, editor, Handbook of Approximation Algorithms and Metaheuristics, pages 553–570. Chapman and Hall/CRC, second edition, 2018. doi:10.1201/9781351236423-31.
- [27] Sándor P. Fekete and Hella-Franziska Hoffmann. Online square-into-square packing. Algorithmica, 77(3):867–901, 2017. doi:10.1007/s00453-016-0114-2.
- [28] Robert Fowler, Michael Paterson, and Steven Tanimoto. Optimal packing and covering in the plane are NP-complete. Information processing letters, 12(3):133–137, 1981. doi:10.1016/0020-0190(81)90111-3.
- [29] Gábor Galambos. A 1.6 lower-bound for the two-dimensional on-line rectange bin-packing. Acta Cybernetica, 10(1-2):21–24, January 1991. URL: https://cyber.bibl.u-szeged.hu/index.php/actcybern/article/view/3389.
- [30] Tim Gerlach, Benhamin Hennies, and Linda Kleist. Online packing of orthogonal polygons, 2026. doi:10.48550/arXiv.2603.22098.
- [31] Xin Han, Francis Y. L. Chin, Hing-Fung Ting, Guochuan Zhang, and Yong Zhang. A new upper bound 2.5545 on 2d online bin packing. ACM Transactions on Algorithms, 7(4):50:1–50:18, 2011. doi:10.1145/2000807.2000818.
- [32] Xin Han, Kazuo Iwama, Deshi Ye, and Guochuan Zhang. Strip packing vs. bin packing. In Algorithmic Aspects in Information and Management (AAIM 2007), pages 358–367, 2007. doi:10.1007/978-3-540-72870-2_34.
- [33] Xin Han, Kazuo Iwama, and Guochuan Zhang. Online removable square packing. Theory of Computing Systems, 43(1):38–55, 2008. doi:10.1007/s00224-007-9039-0.
- [34] Rolf Harren, Klaus Jansen, Lars Prädel, Ulrich M. Schwarz, and Rob van Stee. Two for one: Tight approximation of 2D bin packing. International Journal of Foundations of Computer Science, 24(8):1299–1328, 2013. doi:10.1142/S0129054113500354.
- [35] Rolf Harren, Klaus Jansen, Lars Prädel, and Rob Van Stee. A ()-approximation for strip packing. Computational Geometry, 47(2):248–267, 2014. doi:10.1016/j.comgeo.2013.08.008.
- [36] Sungjin Im, Benjamin Moseley, Kirk Pruhs, and Clifford Stein. An -Competitive Algorithm for Online Machine Minimization, 2018. doi:10.48550/arXiv.1708.09046.
- [37] Janusz Januszewski and Marek Lassak. On-line packing sequences of cubes in the unit cube. Geometriae Dedicata, 67(3):285–293, 1997. doi:10.1023/A:1004953109743.
- [38] Mong-Jen Kao, Jian-Jia Chen, Ignaz Rutter, and Dorothea Wagner. Competitive design and analysis for machine-minimizing job scheduling problem. In International Symposium on Algorithms and Computation, pages 75–84, 2012. doi:10.1007/978-3-642-35261-4_11.
- [39] Henry A. Kierstead and William T. Trotter. An extremal problem in recursive combinatorics. Congressus Numerantium, 33(143-153):98, 1981.
- [40] A. Kosiński. A proof of an Auerbach-Banach-Mazur-Ulam theorem on convex bodies. Colloquium Mathematicae, 4(2):216–218, 1957. doi:10.4064/cm-4-2-216-218.
- [41] Adam Kurpisz and Silvan Suter. Improved Approximations for Translational Packing of Convex Polygons. In European Symposium on Algorithms (ESA 2023), volume 274 of LIPIcs, pages 76:1–76:14, 2023. doi:10.4230/LIPIcs.ESA.2023.76.
- [42] Marek Lassak and Jixian Zhang. An on-line potato-sack theorem. Discrete & Computational Geometry, 6(1):1–7, 1991. doi:10.1007/BF02574670.
- [43] Joseph Leung, Tommy Tam, Chin Wong, Gilbert Young, and Francis Chin. Packing squares into a square. Journal of Parallel and Distributed Computing, 10(3):271–275, 1990. doi:10.1016/0743-7315(90)90019-L.
- [44] R. Daniel Mauldin. The scottish book: Mathematics from the scottish café, with selected problems from the new scottish book, 2015. doi:10.1007/978-3-319-22897-6.
- [45] Arturo I. Merino and Andreas Wiese. On the two-dimensional knapsack problem for convex polygons. In International Colloquium on Automata, Languages, and Programming (ICALP 2020), LIPIcs, pages 84:1–84:16, 2020. doi:10.4230/LIPIcs.ICALP.2020.84.
- [46] J.W. Moon and L. Moser. Some packing and covering theorems. In Colloquium Mathematicum, volume 17, pages 103–110, 1967. doi:10.4064/cm-17-1-103-110.
- [47] Jubayer Nirjhor and Nicole Wein. Improved online sorting. In Approximation and Online Algorithms (WAOA 2025), pages 187–197, 2025. doi:10.1007/978-3-032-06706-7_13.
- [48] Barna Saha. Renting a Cloud. In Annual Conference on Foundations of Software Technology and Theoretical Computer Science (FSTTCS 2013), volume 24 of LIPIcs, pages 437–448, 2013. doi:10.4230/LIPIcs.FSTTCS.2013.437.
- [49] Rob van Stee. SIGACT news online algorithms column 20: the power of harmony. SIGACT News, 43(2):127–136, 2012. doi:10.1145/2261417.2261440.
- [50] Rob van Stee. SIGACT news online algorithms column 26: Bin packing in multiple dimensions. SIGACT News, 46(2):105–112, 2015. doi:10.1145/2789149.2789167.
- [51] André van Vliet. An improved lower bound for on-line bin packing algorithms. Information processing letters, 43(5):277–284, 1992. doi:10.1016/0020-0190(92)90223-I.
- [52] Deshi Ye, Xin Han, and Guochuan Zhang. A note on online strip packing. Journal of Combinatorial Optimization, 17(4):417–423, 2009. doi:10.1007/s10878-007-9125-x.
- [53] Guosong Yu and Guochuan Zhang. Scheduling with a minimum number of machines. Operations Research Letters, 37(2):97–101, 2009. doi:10.1016/j.orl.2009.01.008.
