arXiv:2609.10101cs.CGSep 2026

Manuscript Offprint

arXiv:2609.10101

A 2.37332-Competitive Algorithm for Online Square Packing with Gravity

Nichlas Langhoff Rasmussen

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

We consider online packing of axis-parallel squares into a unit-width strip under the Tetris and gravity constraints: An incoming square must be lowered from above along a monotonic downwards path until it reaches support from below. Fekete, Kamphans, and Schweer [Algorithmica, 2014] gave an algorithm with asymptotic competitive ratio 34/13≈2.615434/13 \approx 2.6154 in this model. We present ASYMMETRICSLOTS, a recursive algorithm based on splitting each slot into a wide and narrow subslot. The proof uses a local charging argument: squares that are large relative to its associated slot pay for the height they create with their own area, while smaller squares are balanced between the two subslots and may use a bounded temporary credit. For a suitable split parameter p∗p^*, we prove

ASYMMETRICSLOTSp∗(σ)≤2.37332 OPT(σ)+O(1)\text{ASYMMETRICSLOTS}_{p^*}(\sigma) \leq 2.37332 \text{ OPT}(\sigma) + O \tag{1}

for every input sequence σ\sigma. Additionally, we show that the same framework gives an algorithm with asymptotic competitive ratio O(κ)O(\kappa) for rectangles of aspect ratio at most κ\kappa, and a matching Ω(κ)\Omega(\kappa) lower bound shows that the dependence on κ\kappa is asymptotically optimal. For the square algorithm, we give a lower bound of 2 on its asymptotic competitive ratio.

1 Introduction

In online strip packing, items arrive one at a time without knowledge of future items and must be placed irrevocably in a strip of fixed width and unbounded height. In the model considered here, feasibility depends not only on the final geometry of the packing but also on how each item reaches its position: an arriving square must enter from above along a collision-free, monotonic downwards (never moving upwards) path and must come to rest on the strip bottom or on previously placed squares. Thus a geometrically empty section of the strip may be unusable because it is unreachable or lacks support.

The square version of this Tetris-and-gravity model was studied by Fekete, Kamphans, and Schweer [10]. They prove that the classic BOTTOMLEFT algorithm has asymptotic competitive ratio 3.5 and introduced SLOTALGORITHM, which recursively partitions the strip into dyadic slots, rounds each square to determine candidate slots, and places it in the lowest candidate slot. They show that SLOTALGORITHM has asymptotic competitive ratio 34/13≈2.615434/13 \approx 2.6154, and establish a general lower bound of 3/23/2 for deterministic online algorithms. They also show instances giving a lower bound of 2 for SLOTALGORITHM itself. To the best of our knowledge, the 34/13 guarantee remain the best known upper bound for this square-packing model. Our main result improves this upper bound to 2.373318506....

Our approach. ASYMMETRICSLOTS replaces the dyadic hierarchy of SLOTALGORITHM by an asymmetric recursive decomposition. Every slot of width ww is split into a wide child of width pwpw and a narrow child of width qwqw, where p∈(1/2,1)p \in (1/2, 1) and q=1−pq = 1 - p. At each slot, a square that does not fit the wide child is assigned to the current slot; a square that fits only the wide child is forced there; and a square that fits both children is routed to the less loaded child. Routing decisions are therefore local and are made while descending the hierarchy. See Table 1 a classification of these rules.

A similar analysis to the SLOTALGORITHM for our new decomposition scheme does not yield an improve upper bound, instead we use a local charging argument and exploit the asymmetry. The asymmetric hierarchy separates placements into two useful types. Squares that are large relative to the current slot are forced, and their area can be used directly to account for the height they create. Smaller squares retain routing flexibility, allowing the algorithm to balance the two children locally. We capture the interaction between these two types of placements using a phase-based accounting argument. The key point is that the loss associated with flexible placements can be bounded locally and does not accumulate with the depth of the recursive hierarchy.

For an optimized split parameter p∗p^*, the phase analysis gives

ASYMMETRICSLOTSp∗(σ)≤2.373318506…A(σ)+O(1)≤2.373318506…OPT(σ)+O(1),\text{ASYMMETRICSLOTS}_{p^*}(\sigma) \leq 2.373318506 \dots A(\sigma) + O(1) \leq 2.373318506 \dots \text{OPT}(\sigma) + O(1),

*Alpha Energy ApS. nichlas.rasmussen@gmail.com.

where A(σ)A(\sigma) is the total area of the input squares and OPT(σ)\mathrm{OPT}(\sigma) is the height of an optimal offline packing. Thus ASYMMETRICSLOTSp∗\mathrm{ASYMMETRICSLOTS}_p^* has asymptotic competitive ratio at most 2.373318506…2.373318506\ldots. The exact optimizing parameter and additive constant are derived in Section 4; the nearby rational split p:q=11:8p:q=11:8 gives the explicit ratio 19/8=2.37519/8=2.375.

The conference version of Fekete et al. listed rectangles as a direction for future work, noting that they might require a different analysis [9]. We pursue this direction when only allowing translation of rectangles of bounded aspect ratio. If every rectangle has aspect ratio at most κ\kappa, routing according to width and accounting for the rectangle height yield an asymptotic competitive ratio of O(κ)O(\kappa). Conversely, an alternating construction gives an Ω(κ)\Omega(\kappa) lower bound for every online algorithm in the present Tetris-and-gravity model. Thus the optimal dependence on the aspect-ratio bound is Θ(κ)\Theta(\kappa); see Section 5. For the square algorithm itself, a repeated-square construction shows

CR(ASYMMETRICSLOTSp)≥2for12<p<5−12,\mathrm{CR}(\mathrm{ASYMMETRICSLOTS}_{p})\geq2\qquad\text{for}\qquad\frac{1}{2}<p<\frac{\sqrt{5}-1}{2},

a range containing both p∗p^* and 11/19. This lower bound is algorithm-specific, just as the value 2 is for SLOTALGORITHM; the best-known general lower bound remains 3/2 [10]. Consequently,

2≤CR(ASYMMETRICSLOTSp∗)≤2.373318506…,2\leq\mathrm{CR}(\mathrm{ASYMMETRICSLOTS}_{p^{*}})\leq2.373318506\ldots,

while the deterministic online problem in general currently lies between 3/2 and 2.373318506....

Related work. Strip packing is a classical problem in combinatorial optimization; see the surveys [4,20,23]. It is strongly NP-hard via bin packing [12], and a standard reduction from PARTITION gives the 3/2 barrier for polynomial-time absolute approximation unless P = NP [13]. Representative milestones include Sleator's 2.5-approximation [21], Steinberg's absolute approximation ratio 2 [22], and the asymptotic fully polynomial-time approximation scheme of Kenyon and Rémila [19]. The current best-known general absolute approximation ratio is 5/3 + ε [15]. Allowing pseudo-polynomial running time, Jansen and Rau obtained a (5/4 + ε)-approximation [18], while Gálvez et al. obtained a tight (3/2 + ε)-approximation for skewed instances [11]. More recently, Hougardy and Zondervan obtained a 13/6 approximation using a suitable ordering for Bottom-Left [17]. These results concern the geometry of a final packing and do not impose the reachability and support restrictions considered here.

Ordinary online strip packing was studied by Brown, Baker, and Katseff [3], with subsequent work on shelf algorithms and connections to bin packing [2,5,14,24]. Related square-specific models include online packing of squares and cubes into fixed-size bins [6,7] and online square-into-square packing [8]. Azar and Epstein [1] introduced a Tetris-type reachability constraint for online rectangle packing without requiring support from below; they obtained a constant competitive ratio when rotations are allowed, while unrestricted nonrotatable rectangles admit no constant competitive ratio. For BOTTOMLEFT in the square setting, Hougardy and Zondervan [16] gave a 10/3 – ε lower bound for a worst ordering, and their construction also applies to the online Tetris-and-gravity version, nearly matching the 3.5 upper bound of Fekete et al. This result is specific to BOTTOMLEFT and is separate from the general upper-bound question addressed here.

Organization. Section 2 formalizes the online Tetris-and-gravity model and introduces the notation used throughout the paper. Section 3 presents ASYMMETRICSLOTS, including the asymmetric slot hierarchy, the local routing rule, and the proof that its placements are physically feasible. Section 4 develops the local phase invariant, derives the global competitive bound, optimizes the split parameter, and gives a lower bound for the square-packing algorithm. Finally, Section 5 extends the method to rectangles of bounded aspect ratio and proves matching upper and lower bounds on the dependence on the aspect ratio.

References (24)