Online Packing to Minimize Area or Perimeter

Authors Mikkel Abrahamsen , Lorenzo Beretta

Thumbnail PDF


  • Filesize: 1 MB
  • 15 pages

Document Identifiers

Author Details

Mikkel Abrahamsen
  • BARC, University of Copenhagen, Denmark
Lorenzo Beretta
  • BARC, University of Copenhagen, Denmark

Cite AsGet BibTex

Mikkel Abrahamsen and Lorenzo Beretta. Online Packing to Minimize Area or Perimeter. In 37th International Symposium on Computational Geometry (SoCG 2021). Leibniz International Proceedings in Informatics (LIPIcs), Volume 189, pp. 6:1-6:15, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2021)


We consider online packing problems where we get a stream of axis-parallel rectangles. The rectangles have to be placed in the plane without overlapping, and each rectangle must be placed without knowing the subsequent rectangles. The goal is to minimize the perimeter or the area of the axis-parallel bounding box of the rectangles. We either allow rotations by 90^∘ or translations only. For the perimeter version we give algorithms with an absolute competitive ratio slightly less than 4 when only translations are allowed and when rotations are also allowed. We then turn our attention to minimizing the area and show that the competitive ratio of any algorithm is at least Ω(√n), where n is the number of rectangles in the stream, and this holds with and without rotations. We then present algorithms that match this bound in both cases and the competitive ratio is thus optimal to within a constant factor. We also show that the competitive ratio cannot be bounded as a function of Opt. We then consider two special cases. The first is when all the given rectangles have aspect ratios bounded by some constant. The particular variant where all the rectangles are squares and we want to minimize the area of the bounding square has been studied before and an algorithm with a competitive ratio of 8 has been given [Fekete and Hoffmann, Algorithmica, 2017]. We improve the analysis of the algorithm and show that the ratio is at most 6, which is tight. The second special case is when all edges have length at least 1. Here, the Ω(√n) lower bound still holds, and we turn our attention to lower bounds depending on Opt. We show that any algorithm for the translational case has a competitive ratio of at least Ω(√{Opt}). If rotations are allowed, we show a lower bound of Ω(∜{Opt}). For both versions, we give algorithms that match the respective lower bounds: With translations only, this is just the algorithm from the general case with competitive ratio O(√n) = O(√{Opt}). If rotations are allowed, we give an algorithm with competitive ratio O(min{√n,∜{Opt}}), thus matching both lower bounds simultaneously.

Subject Classification

ACM Subject Classification
  • Theory of computation → Computational geometry
  • Theory of computation → Packing and covering problems
  • Theory of computation → Online algorithms
  • Packing
  • online algorithms


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. Hee-Kap Ahn and Otfried Cheong. Aligning two convex figures to minimize area or perimeter. Algorithmica, 62(1-2):464-479, 2012. Google Scholar
  2. Helmut Alt. Computational aspects of packing problems. Bulletin of the EATCS, 118, 2016. Google Scholar
  3. 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. Google Scholar
  4. Helmut Alt, Mark de Berg, and Christian Knauer. Approximating minimum-area rectangular and convex containers for packing convex polygons. In 23rd Annual European Symposium on Algorithms (ESA 2015), pages 25-34, 2015. Google Scholar
  5. Helmut Alt and Ferran Hurtado. Packing convex polygons into rectangular boxes. In 18th Japanese Conference on Discrete and Computational Geometry (JCDCGG 2000), pages 67-80, 2000. Google Scholar
  6. Brenda S. Baker and Jerald S. Schwarz. Shelf algorithms for two-dimensional packing problems. SIAM Journal on Computing, 12(3):508-525, 1983. Google Scholar
  7. Allan Borodin and Ran El-Yaniv. Online computation and competitive analysis. Cambridge University Press, 2005. Google Scholar
  8. Brian Brubach. Improved bound for online square-into-square packing. In 12th International Workshop on Approximation and Online Algorithms (WAOA 2014), pages 47-58, 2014. URL:
  9. 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. URL:
  10. Fan Chung and Ron Graham. Efficient packings of unit squares in a large square. Discrete & Computational Geometry, 2019. Google Scholar
  11. 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. URL:
  12. Paul Erdős and Ron Graham. On packing squares with equal squares. Journal of Combinatorial Theory, Series A, 19(1):119-123, 1975. Google Scholar
  13. Sándor P. Fekete and Hella-Franziska Hoffmann. Online square-into-square packing. Algorithmica, 77(3):867-901, 2017. URL:
  14. Amos Fiat and Gerhard J. Woeginger. Competitive analysis of algorithms. In Amos Fiat and Gerhard J. Woeginger, editors, Online Algorithms: The State of the Art, pages 1-12. Springer, 1998. URL:
  15. Janusz Januszewski and Marek Lassak. On-line packing sequences of cubes in the unit cube. Geometriae Dedicata, 67(3):285-293, 1997. Google Scholar
  16. Marek Lassak. On-line potato-sack algorithm efficient for packing into small boxes. Periodica Mathematica Hungarica, 34(1-2):105-110, 1997. Google Scholar
  17. Hyun-Chan Lee and Tony C. Woo. Determining in linear time the minimum area convex hull of two polygons. IIE Transactions, 20(4):338-345, 1988. URL:
  18. Boris D. Lubachevsky and Ronald L. Graham. Dense packings of congruent circles in rectangles with a variable aspect ratio. In Boris Aronov, Saugata Basu, János Pach, and Micha Sharir, editors, Discrete and Computational Geometry: The Goodman-Pollack Festschrift, pages 633-650. Springer, 2003. Google Scholar
  19. Boris D. Lubachevsky and Ronald L. Graham. Minimum perimeter rectangles that enclose congruent non-overlapping circles. Discrete Mathematics, 309(8):1947-1962, 2009. URL:
  20. Victor J. Milenkovic. Translational polygon containment and minimal enclosure using linear programming based restriction. In Proceedings of the twenty-eighth annual ACM symposium on Theory of Computing (STOC 1996), pages 109-118, 1996. Google Scholar
  21. Victor J. Milenkovic. Rotational polygon containment and minimum enclosure using only robust 2D constructions. Computational Geometry, 13(1):3-19, 1999. URL:
  22. Victor J. Milenkovic and Karen Daniels. Translational polygon containment and minimal enclosure using mathematical programming. International Transactions in Operational Research, 6(5):525-554, 1999. URL:
  23. Dongwoo Park, Sang Won Bae, Helmut Alt, and Hee-Kap Ahn. Bundling three convex polygons to minimize area or perimeter. Computational Geometry, 51:1-14, 2016. URL:
  24. E. Specht. High density packings of equal circles in rectangles with variable aspect ratio. Computers & Operations Research, 40(1):58-69, 2013. URL:
  25. Rob van Stee. SIGACT news online algorithms column 20: the power of harmony. SIGACT News, 43(2):127-136, 2012. URL:
  26. Rob van Stee. SIGACT news online algorithms column 26: Bin packing in multiple dimensions. SIGACT News, 46(2):105-112, 2015. URL: