2D Knapsack: Packing Squares

  • Min Chen
  • György Dósa
  • Xin Han
  • Chenyang Zhou
  • Attila Benko
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6681)


In this paper, we study a two-dimensional knapsack problem: packing squares as many as possible into a unit square. Our results are the following:

  1. (i)

    first, we propose an algorithm called IHS(Increasing Height Shelf), and prove that the packing is optimal if there are at most 5 squares packed in an optimal packing, and this upper bound 5 is sharp;

  2. (ii)

    secondly, if all the items have size(side length) at most \(\frac{1}{k}\), where k ≥ 1 is a constant number, we propose a simple algorithm with an approximation ratio \(\frac{k^2+3k+2}{k^2}\) in time O(n logn).

  3. (iii)

    finally, we give a PTAS for the general case, and our algorithm is much simpler than the previous approach[16].



Approximation Algorithm Side Length Approximation Ratio Knapsack Problem Optimal Packing 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Babat, L.G.: Linear functions on the N-dimensional unit cube. Dokl. Akad. Nauk SSSR 222, 761–762 (1975) (Russian)MathSciNetMATHGoogle Scholar
  2. 2.
    Caprara, A., Monaci, M.: On the two-dimensional knapsack problem. Operations Research Letters 32, 5–14 (2004)MathSciNetCrossRefMATHGoogle Scholar
  3. 3.
    Csirik, J., Frenk, J.B.G., Labbé, M., Zhang, S.: Heuristics for the 0-1 Min-Knapsack problem. Acta Cybernetica 10(1-2), 15–20 (1991)MathSciNetMATHGoogle Scholar
  4. 4.
    Fishkin, A.V., Gerber, O., Jansen, K., Solis-Oba, R.: Packing Weighted Rectangles into a Square. In: Jedrzejowicz, J., Szepietowski, A. (eds.) MFCS 2005. LNCS, vol. 3618, pp. 352–363. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  5. 5.
    Güntzer, M.M., Jungnickel, D.: Approximate minimization algorithms for the 0/1 knapsack and subset-sum problem. Operations Research Letters 26, 55–66 (2000)MathSciNetCrossRefMATHGoogle Scholar
  6. 6.
    Gene, G., Levner, E.: Complexity of approximation algorithms for combinatorial problems: a survey. ACM SIGACT News 12(3), 52–65 (1980)CrossRefGoogle Scholar
  7. 7.
    Han, X., Iwama, K., Zhang, G.: Online Removable Square Packing. Theory Computing Systems 43(1), 38–55 (2008)MathSciNetCrossRefMATHGoogle Scholar
  8. 8.
    Han, X., Makino, K.: Online minimization knapsack problem. In: Bampis, E., Jansen, K. (eds.) WAOA 2009. LNCS, vol. 5893, pp. 182–193. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  9. 9.
    Han, X., Makino, K.: Online removable knapsack with limited cuts. In: Dong, Y., Du, D.-Z., Ibarra, O. (eds.) ISAAC 2009. LNCS, vol. 5878, pp. 341–351. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  10. 10.
    Harren, R.: Approximation algorithms for orthogonal packing problems for hypercubes. Theoretical Computer Science 410(44), 4504–4532 (2009)MathSciNetCrossRefMATHGoogle Scholar
  11. 11.
    Horiyama, T., Iwama, K., Kawahara, J.: Finite-State Online Algorithms and Their Automated Competitive Analysis. In: Asano, T. (ed.) ISAAC 2006. LNCS, vol. 4288, pp. 71–80. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  12. 12.
    Ibarra, O.H., Kim, C.E.: Fast approximation algorithms for the knapsack and sum of subset problems. Journal of the ACM 22, 463–468 (1975)MathSciNetCrossRefMATHGoogle Scholar
  13. 13.
    Iwama, K., Taketomi, S.: Removable online knapsack problems. In: Widmayer, P., Triguero, F., Morales, R., Hennessy, M., Eidenbenz, S., Conejo, R. (eds.) ICALP 2002. LNCS, vol. 2380, pp. 293–305. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  14. 14.
    Iwama, K., Zhang, G.: Optimal resource augmentations for online knapsack. In: Charikar, M., Jansen, K., Reingold, O., Rolim, J.D.P. (eds.) RANDOM 2007 and APPROX 2007. LNCS, vol. 4627, pp. 180–188. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  15. 15.
    Jansen, K., Zhang, G.: Maximizing the Total Profit of Rectangles Packed into a Rectangle. Algorithmica 47(3), 323–342 (2007)MathSciNetCrossRefMATHGoogle Scholar
  16. 16.
    Jansen, K., Solis-Oba, R.: A Polynomial Time Approximation Scheme for the Square Packing Problem. In: Lodi, A., Panconesi, A., Rinaldi, G. (eds.) IPCO 2008. LNCS, vol. 5035, pp. 184–198. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  17. 17.
    Kellerer, H., Pferschy, U., Pisinger, D.: Knapsack Problems. Springer, Heidelberg (2004)CrossRefMATHGoogle Scholar
  18. 18.
    Lueker, G.S.: Average-case analysis of off-line and on-line knapsack problems. In: Proc. Sixth Annual ACM-SIAM SODA, pp. 179–188 (1995)Google Scholar
  19. 19.
    Marchetti-Spaccamela, A., Vercellis, C.: Stochastic on-line knapsack problems. Math. Programming 68(1, Ser. A), 73–104 (1995)MathSciNetMATHGoogle Scholar
  20. 20.
    Noga, J., Sarbua, V.: An online partially fractional knapsack problem. In: ISPAN 2005, pp. 108–112 (2005)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Min Chen
    • 1
  • György Dósa
    • 2
  • Xin Han
    • 1
  • Chenyang Zhou
    • 1
  • Attila Benko
    • 2
  1. 1.School of Software of DalianUniversity of TechnologyChina
  2. 2.Department of MathematicsUniversity of PannoniaVeszprémHungary

Personalised recommendations