# How many circles of a given radius can be packed into a given rectangular box?

I've just came back from my Mathematics of Packing and Shipping lecture, and I've run into a problem I've been trying to figure out.

Let's say I have a rectangle of length $l$ and width $w$.

Is there a simple equation that can be used to show me how many circles of radius $r$ can be packed into the rectangle, in the optimal way? So that no circles overlap. ($r$ is less than both $l$ and $w$)

I'm rather in the dark as to what the optimum method of packing circles together in the least amount of space is, for a given shape.

An equation with a non-integer output is useful to me as long as the truncated (rounded down) value is the true answer.

(I'm not that interested in how the circles would be packed, as I am going to go into business and only want to know how much I can demand from the packers I hire to pack my product)

-
I had an answer before, but I looked into it a bit more and my answer was incorrect so I removed it. This link may be of help: en.wikipedia.org/wiki/Circle_packing_in_a_square – Cam Jul 26 '10 at 6:30
@Cam: Looks like there's no optimal solution yet. Maybe you could just put this comment as an answer. – kennytm Jul 26 '10 at 6:34
Might be a good question to work out how to answer problems which actually aren't solved yet in advanced maths. (if there is not an optimal solution yet) – Justin L. Jul 26 '10 at 7:01
@KennyTM: Sure. – Cam Jul 26 '10 at 12:31
@NeilRoy That is an upper bound but it assumes that the circles pack basically perfectly in the rectangle, which is obviously asymptotically false as there must be space between the circles. – Solomonoff's Secret Jan 5 at 18:29

I had an answer before, but I looked into it a bit more and my answer was incorrect so I removed it. This link may be of interest: Circle Packing in a Square (wikipedia)

It was suggested by KennyTM that there may not be an optimal solution yet to this problem in general. Further digging into this has shown me that this is probably correct. Check out this page: Circle Packing - Best Known Packings. As you can see, solutions up to only 30 circles have been found and proven optimal. (Other higher numbers of circles have been proven optimal, but 31 hasn't)

Note that although problem defined on the wikipedia page and the other link is superficially different than the question asked here, the same fundamental question is being asked, which is "what is the most efficient way to pack circles in a square/rectangle container?".

...And it seems the answer is "we don't really know" :)

-

This is a set of equations that i came up with to find out how many circles will fit in a rectangle if they are staggered. I hope this is of help to you.

A= whole number #1 B= remainder #1 C= extra space between each circle D= diameter of circles E= staggered height of new layers F= inverse % of new circle vs. old G= whole number #2 H= height of rectangle I= remainder #2 J= whole number #3 K= remainder #3 L= total number of rows M= whole number #4 N= remainder #4 O= total circles in big rows P= total circles in small rows Q= total number of circles R= radius of circles W= width of rectangle

1. (W/D) = A,B

2. [B/(A-1)] = C

3. [(D)^2-(1/2C+R)^2] = E^2

4. (D/E) = F

5. [(H-D)/D] = G,I

6. (F*G) = J,K

7. (J+1) = L

8. (L/2) = M,N

9. [(M+N)*A] = O

10. [M*(A-1)] = P

11. (O+P) = Q

-