Abstract 1 Introduction 2 Notions: packing variants, competitive analysis, and objects 3 Lower bound for bin packing of L-shapes – Proof of Theorem 2 4 Strip packing of L-shapes – Proof of Corollary 4(i) 5 Orthogonal polygons of higher complexity – Theorems 5 and 6(ii) 6 Conclusion and open problems References

Online Packing of Orthogonal Polygons

Tim Gerlach ORCID Universität Hamburg, Germany    Benjamin Hennies Technische Universität Braunschweig, Germany    Linda Kleist ORCID Universität Hamburg, Germany
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 Ω(n/logn), where n 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 n-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 n. This implies that for general orthogonal polygons, the trivial algorithm is best possible.

Interestingly, for packing degenerate orthogonal polygons (with thickness 0), 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 n.

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 Ω(n/logn) for strip packing, and there exist online algorithms with competitive ratios in O(1) for perimeter packing, or in O(n) 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, skeleton
Copyright and License:
[Uncaptioned image] © Tim Gerlach, Benjamin Hennies, and Linda Kleist; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Computational geometry
Related Version:
Full Version: https://arxiv.org/abs/2603.22098 [30]
Acknowledgements:
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 Nayyeri

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.

(a)
(b)
(c)
Figure 1: (a) An L-shape, (b) a symmetric L-shape, and (c) a bin packing of L-shapes.

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.

Table 1: Bounds on the best asymptotic competitive ratios of bin packing orthogonal polygons.

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 P1,,Pn which have to be placed into a unit square bin by translation. The goal is to minimize the number of used bins. Ortho-BinPackrot 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-BinPackrot 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 Ω(n/logn).

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 n-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 x,y,wx,wy[0,1]. It is small if x,y1/2, large if x,y1/2, and symmetric if x=y and wx=wy. 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

  1. (a)

    33OPT+2 bins when all L-shapes are large and symmetric.

  2. (b)

    8OPT+7 when all L-shapes are small.

  3. (c)

    41OPT+9 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 OPT1 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 e-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 L1,,Ln, 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 x,y bounded by some constant t<1, the online critical density is the largest value of A such that there exists an online algorithm which packs any sequence with total area at most A into the bin.

Corollary 4.

The following statements hold for L-shapes with arm lengths in [0,1]:

  1. (i)

    The asymptotic competitive ratio of any online algorithm for L-StripPack is in Ω(n/logn).

  2. (ii)

    There is an online algorithm for L-PeriPack with absolute competitive ratio in O(1).

  3. (iii)

    There is an online algorithm for L-AreaPack with asymptotic competitive ratio in O(n).

  4. (iv)

    The online critical packing density is positive if the arm lengths of each L-shape are bounded by t<1. For t=1, the online critical packing density is 0.

The O(n)-competitive algorithm for L-AreaPack is asymptotically best-possible, as a lower bound of Ω(n) already for rectangles has been shown by Abrahamsen and Beretta [3].

Table 2: Overview on the known upper and lower bounds on the best competitive ratios for the various packing problems.

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 n, even when restricting to orthogonally convex 8-gons.

(a)
(b)
(c)
Figure 2: (a) A Z-shape (b) A Z-skeleton (c) An L-skeleton.

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.

  1. (i)

    There exists an online algorithm for L-Skel-BinPack with a constant absolute competitive ratio.

  2. (ii)

    No online algorithm for Z-Skel-BinPack has an asymptotic competitive ratio better than n.

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 5/3+ε 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 7/2+106.66 is achieved by Ye, Han, and Zhang [52]. Restricting the attention to large instances, the best asymptotic competitive ratio is lower bounded by 1.54 by van Vliet [51] and upper bounded by 1.59 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 1.4 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 3.25 [20] to about 2.55 by Han, Chin, Ting, Zhang and Zhang [31] and the lower bound has been increased from 1.6 [29] to 1.91 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 O(n)-competitive algorithms and show a lower bound of Ω(n) for both versions of rotation allowed and translations only. For perimeter minimization, they gave a 3.98-competitive algorithm for both, translation and rotation, as well as a lower bound on the competitive ratio of 4/3 for the case of translation and of 5/4 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 O(n0.59) 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 2-competitive online algorithm and Epstein [24] designs a 1.5 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 1. An L-shape Li with arm length and width wi is associated with a real ri:=wi. It is easy to see that an Li can be packed into a bin containing L1,,Lk (bottom-leftmost) if j=1kwj+1. Similarly, ri can be packed into an open bin containing r1,,rk if (and only if) j=1krj1. 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 r, a processing time p and deadline d, 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 w, translate to a job with release time 0, processing time w, and deadline 1. 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 e-competitive online algorithm for unit processing times; they also show that the competitive ratio of e 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 e-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 n 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.

Table 3: Upper bounds on the best asymptotic approximation/competitive ratios for L-BinPack with restricted L-shapes.

Critical densities.

For a given container of volume C and a class of objects in d, the critical density is the largest value of V/C such that any sequence of objects of the class with a total volume of at most V can always be packed in the container. For convex bodies of bounded diameter in 3, Auerbach, Banach, Mazur and Ulam [44] stated (without proof) that the critical density is positive, i.e., there exists a function f such that any sequence of convex bodies in 3, each of diameter δ and total volume of at most V, can be packed into a cube with side length s=f(δ,V) 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 0; in particular for packing unit disks in 3. However, for cubes, Moon and Moser [46] showed that any sequence of cubes in d of total volume 1/2d1 can be packed into the unit cube. This bound is the best possible, because for any ε>0, two cubes with side lengths 1/2+ε 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 5/16 [37] to 2/5 [16]. Interestingly, Januszewski and Lassak [37] proved that in dimension d5, the critical density of online packing cubes into the unit cube is 1/2d1, just as in the offline case. Lassak and Zhang [42] showed that for some constant δ(d)>0, any sequence of axis-parallel boxes of diameter and total area at most δ(d) can be packed online in the d-dimensional unit hypercube using translations. This implies that the critical packing density for convex bodies is positive for any dimension d1 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 0.

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 1 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 x-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 σ1,,σn of objects, and we need to process object σi (in a problem-specific manner) before the next object σi+1 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 I, OPT(I) denotes the cost of the offline optimum solution and 𝒜(I) denotes the cost of the solution computed by 𝒜 for input I. Let f: be a function of the size |I| of the instance, in our context typically the number of objects. We say that 𝒜 has (absolute) competitive ratio f(|I|) if, for all instances I, it holds that 𝒜(I)f(|I|)OPT(I). Similarly, 𝒜 has asymptotic competitive ratio f(|I|) if there exists a constant β>0 such that 𝒜(I)f(|I|)OPT(I)+β for all I.

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 x and height wy with a rectangle of width wx and height y, with wxx and wyy, 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.

Refer to caption
(a)
Refer to caption
(b)
Refer to caption
(c)
Refer to caption
(d)
Figure 3: Parameters and the reference point of an (a) L-shape, (b) L-skeleton, (c) Z-shape, and (d) Z-skeleton.

We note that each orthogonal 6-gon is either an L-shape or a rotated L-shape. An L-shape is small if x,y1/2, large if x,y1/2, and symmetric if x=y and wx=wy.

A Z-shape is the union of three rectangles: A base rectangle of height t and width w, and two arm rectangles: One arm (above) of width ta and height a, whose lower left corner coincides with the lower left corner of the base, and one arm (below) of width tb and height b such that its upper right corner coincides with the upper right corner of the base, where ta,tbw, see also 3(c). In this paper, we will mostly be concerned with Z-shapes of equal thickness, i.e., the case where ta=tb=t. 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., wx=wy=0 and ta=tb=t=0, 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 Ω(n/logn). We start by introducing the problem BinSorting.

3.1 Bin sorting

The online problem BinSorting[k] can be described as a game between two players, Presenter and Algorithm, playing on several arrays with k 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.

Figure 4: An instance of the BinSorting with k=5 for the sequence 16,8,4,2,3.

The offline optimum corresponds to the setting where Algorithm knows all numbers in advance and is simple to determine: For n numbers in arrays with k slots, n/k arrays are necessary and, as the numbers can be inserted in a sorted manner, also sufficient. Consequently, OPT=n/k.

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[k] is at least n/log(k+1)/n/kΩ(k/logk). For k=n, the lower bound is n/log(n+1)Ω(n/logn).

Proof.

We show that Presenter has a strategy to present n numbers such that Algorithm uses at least n/log(k+1) arrays while n/k arrays would suffice. The idea is as follows: Consider a partially filled array A. The numbers in A partition it into maximal sections of free slots. If a new number shall be inserted in A, 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 A 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 n natural numbers a1,,an, Presenter maintains the following invariant: In the beginning of iteration i, it has an active set of 2ni+11 similar numbers. In the very beginning (of iteration 1), the set is (0,2n):={1,,2n1}, each array has one section containing all slots, and Presenter presents a1=2n1. In iteration i+1, Presenter determines the next number to be presented based on the action of Algorithm in iteration i. Algorithm places ai in a section of some array which results in two smaller sections. If the smaller of the two section lies to the left of ai, then the active set (l,r) is updated to (l,ai) and ai+1=(l+ai)/2=ai2n(i+1); otherwise it is updated to (ai,r) and ai+1=(ai+r)/2=ai+2n(i+1). 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 n iterations because it contains 2ni+111 numbers if in.

When we restrict our attention to a fixed array with k 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 log(k+1) of the n numbers in each array and thus needs at least n/log(k+1) bins. This yields a competitive ratio of at least n/log(k+1)/n/kΩ(k/logk).

We remark that the lower bound of Lemma 7 is tight, that is, there exists an online algorithm BinSorting[k] that matches this bound.

Lemma 8.

There exists an online algorithm for BinSorting[k] with absolute competitive ratio of n/log(k+1)/n/kO(k/logk).

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 m numbers has length (k+1)/2m1. Therefore each array contains at least log(k+1) numbers before a new array is opened. Consequently, 𝒜 uses at most n/log(k+1) arrays while OPT=n/k.

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 k, we consider the family k={Li}i of L-shapes with the following parameters:

x(Li)=1/2+1/2k,wx(Li)=1/2k,y(Li)=12i1,wy(Li)=2i1
(a)
(b)
(c)
Figure 5: Illustrations for 8. (a) While L1 may be placed to the right/above of L3, (b) L1 cannot be placed to the left/below of L3 as lx(L1)+lx(L3)>1 and ly(L3)+wy(L1)=1231+211>1, respectively. (c) A packing of L1,,Lkk for k=8 into one bin.

The key idea is that Li in L-BinPack mimics the natural number i for BinSorting. We start with the crucial property that each subset of k packed into a bin is sorted.

Lemma 9.

Each set Sk packs into one bin if and only if |S|k and the items are placed in descending order of their indices i.

Proof.

By construction up to k items of k fit into one bin in descending order of their indices: With respect to the x-coordinate, exactly k items can be packed next to each other. For the y-coordinate, we note the following. When Li is placed somewhere in the bin, the free space above is lower bounded by

y(Li)wy(Li)=(12i1)2i1=y(Li1)y(Lj) for j<i.

So when placed in descending order, there is space for k items. Figure 5(c) depicts an example for k=8. It remains to show that Li cannot be placed below/left of Lj when i<j. It cannot be placed entirely to the left of Lj, because lx(Li)+lx(Lj)=2(1/2+1/k)>1, and it cannot be placed below Lj because wy(Li)+y(Lj)=2i1+12j1>1.

We now show how an algorithm for L-BinPack yields an algorithm for BinSorting[k].

Lemma 10.

An online-algorithm for L-BinPack yields an algorithm for BinSorting[k] with the same (absolute/asymptotic) competitive ratio.

Proof.

Let 𝒜 be an α-competitive algorithm for L-BinPack and consider an instance IS of BinSorting [k] with n numbers. We describe an online algorithm 𝒜 for BinSorting[k] which uses 𝒜 as a subroutine. For each presented number i, 𝒜 presents Lik to 𝒜. By Lemma 9, at most k L-shapes of k fit into one bin. Let x denote the x-coordinate of the reference point of Li in the jth bin as assigned by 𝒜. Then 𝒜 places number i in the slot x2k+1 of the jth array. As x[0,1/21/2k], it holds that x2k+1[k]. We shortly argue that this position is valid. Firstly, because all L-shapes have width 1/2k, the assigned x-values differ by at least 1/2k and for any x and x with |xx|1/2k, we have |x2kx2k|1. 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 x-position of Li in the jth bin to a unique slot in the jth array. The number of used arrays equals the number of used bins. Moreover, the offline optimum is n/k in both problems. Hence, 𝒜 is α-competitive.

Together, Lemmas 7 and 10 show the following statement, which proves Theorem 2.

Corollary 11.

For each online algorithm 𝒜 for L-BinPack and each n, there exists a strategy to present n L-shapes from n (no duplicates) such that they can all be packed into one bin while 𝒜 uses at least n/log(n+1) 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 n L-shapes from n (without duplicates) with asymptotic competitive ratio α yields an algorithm 𝒜 for L-BinPack with asymptotic competitve ratio 2α.

Proof.

Let 𝒜 be an asymptotic α-competitive algorithm for L-StripPack and consider an instance of L-BinPack with n objects from n. We describe an online algorithm 𝒜 for L-BinPack which uses 𝒜 as a subroutine. For each each Ln, 𝒜 presents it to 𝒜 and observes its placement in the strip. The idea is to partition the strip into slots of widths 1/2n; each slot will correspond to a placement in a bin. For an illustration, see Figure 6. We show that objects of n consecutive slots can be packed into one bin. If the reference point of L is placed at (x,y) in the strip, then 𝒜 places it as follows. Let m,r such that x2n=mn+r and r<n. Then 𝒜 places L in the (m+1)st bin such that its reference point is at (x,y):=(r/2n,1y(L)).

Figure 6: Illustration for the proof of Lemma 12.

We now argue that this yields a valid bin packing. Let Li and Lj be two L-shapes in a same bin and denote their x-coordinates in the strip by xi and xj, and in the bin by xi and xj, respectively. We assume that xi<xj. By construction, we have that |xixj|1/2. The placement xi<xj implies that wy(Li)+y(Lj)1 and hence ij, i.e., in each bin the L-shapes are non-increasing. Moreover, due to the equal width of 1/2n, no two L-shapes intersect in the x-direction. Without duplicates, no intersections in the y-direction follow from the definition of n. Lastly, if xjxin1/2n then xj+x(Li)(n1/2n+xi)+1/2+1/2kxi+1. Therefore, the y-span of the L-shapes is at most 1.

It remains to check the number of bins. Let OPTS and OPTB denote the offline optimum values for L-StripPack and L-BinPack, respectively. Clearly, we have OPTSOPTB=1; recall that all objects pack into one bin by Lemma 9. As 𝒜 is asymptotically α-competitive, there is a constant β>0 such that the width of the strip packing is at most αOPTS+β. The number of bins is 2n(αOPTS+β)/n2αOPTB+2β+2, so 𝒜 is asymptotically 2α-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 n.

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.

Algorithm 1 Strategy to generate a sequence of Z-skeletons for a given algorithm 𝒜.
Lemma 13.

For every online algorithm 𝒜 of Z-Skel-BinPack, Algorithm 1 generates a sequence of n Z-skeletons such that 𝒜 uses n bins.

Proof Sketch.

For any Z-skeleton Zi packed by 𝒜, Algorithm 1 ensures that all future Zj it presents cannot be placed into the bin of Zi. In particular, if 𝒜 places Zi far to the left, all Zj,j>i, have a longer upper arm than Zi, but are too wide to fit under Zi, as in 7(a). Similarly, if 𝒜 places a Z-skeleton far to the right, then all Zj,j>i, have a shorter upper arm than Zi, but are too wide to fit above Zi, as in 7(b).

Refer to caption
(a)
Refer to caption
(b)
Figure 7: Illustration for the proof of Lemma 13.

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 Z1,,Zn be Z-skeletons generated by some execution of Algorithm 1. Then, Z1,,Zn can be packed into one bin, such that all horizontal gaps between the Z-skeletons and the bin boundary have width at least 1/n2n3.

Proof Sketch.

First, we show that we may partition the generated Z-skeletons into two subsets W and W, where the parameter wk grows or shrinks, respectively, as the parameter bk grows. By induction on k, we show that, given any ε>0, the shapes of W can be packed into the L-shape with parameters ε+wk,ε,1,bk, depicted in 8(a), such that all horizontal gaps have size ε/k.

Refer to caption
(a)
Refer to caption
(b)
Refer to caption
(c)
Refer to caption
(d)
Figure 8: Illustration for Lemma 14.

Similarly, W can be packed into a rotated L-shape with parameters ε+wk,ε,1,ak, 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 1/n2n3. 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 n, 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 n, 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 n/logn for general L-shapes and n 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 O(logm)-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 (5/3+ε)-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 O(loglogm)-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.