# Packing Icons Onto A screen

You are trying to pack icons onto a screen that is divided into n horizontal rows of uniformly varying size. The rows narrow by a fixed ratio as one goes up the screen from the bottom. Since the icons get smaller to match the row size, the capacity of each row gets proportionately larger as its height gets smaller.

The height and width of the screen are assumed to be 1 unit. The capacity of each row is c = [1/h], where h is the height of the row and [] is the round-off operator ( 0 < h < 1).

The height of the ith row from the bottom is h = P*r^i, where r a constant (0 < r <= 1) and P is a value which assures that the sum of row heights equals 1 (P=sum r^i, i=0 to n). So the capacity of each row is also [1/P*r^i] and overall capacity of the screen is something like the sum of a geometricy series.

So, with a given T = total icons desired, the first goal is to find all those n and r such that the total capacity of the screen exactly equals T (this can always be done for n=2 but I don't know about n > 2 ).

The second, overall, goal is to find a "best" packing. This "best" packing is, roughly speaking one in the number of rows grows with the number of items while 1/r, the capacity of the first row, stays relatively large and the total capacity of the screen equals T. The condition could be minimize r such that n > T*c or Maximize n given that r < c, where c in both cases is a constant less than 1. You could also propose a different constraint in a similar spirit that gives a tractable solution. The constraint that capacity be exactly equal could also be relaxed.

-
Is there more information you'd like to give us, such as what your own efforts/experiments have revealed, or what existing literature you're aware of? – Yemon Choi Sep 17 '10 at 23:38
I'm ignorant of any literature. It's fairly trivial with just two rows or with r=1. In general, you can reduce the results to an n-order polynomial by transforming the sum of a geometric series. But that didn't seem terribly enlightening. – Joseph Soulbringer Sep 17 '10 at 23:43