# 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)

## Abstract

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].

## Keywords

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.

## References

1. 1.
Babat, L.G.: Linear functions on the N-dimensional unit cube. Dokl. Akad. Nauk SSSR 222, 761–762 (1975) (Russian)
2. 2.
Caprara, A., Monaci, M.: On the two-dimensional knapsack problem. Operations Research Letters 32, 5–14 (2004)
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)
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)
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)
6. 6.
Gene, G., Levner, E.: Complexity of approximation algorithms for combinatorial problems: a survey. ACM SIGACT News 12(3), 52–65 (1980)
7. 7.
Han, X., Iwama, K., Zhang, G.: Online Removable Square Packing. Theory Computing Systems 43(1), 38–55 (2008)
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)
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)
10. 10.
Harren, R.: Approximation algorithms for orthogonal packing problems for hypercubes. Theoretical Computer Science 410(44), 4504–4532 (2009)
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)
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)
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)
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)
15. 15.
Jansen, K., Zhang, G.: Maximizing the Total Profit of Rectangles Packed into a Rectangle. Algorithmica 47(3), 323–342 (2007)
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)
17. 17.
Kellerer, H., Pferschy, U., Pisinger, D.: Knapsack Problems. Springer, Heidelberg (2004)
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)
20. 20.
Noga, J., Sarbua, V.: An online partially fractional knapsack problem. In: ISPAN 2005, pp. 108–112 (2005)Google Scholar

## 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