# Find, inside a large circle, the maximum number of small circles placed 60 degrees to each other and

... starts with a small circle in the center of the large circle. The above picture shows a program I wrote to actually draw the circles out. But you can see that this method does not yield maximum number of blue circles. There are still spaces around the red circle.

The method i used is to draw blue circle "rings" starting from the center outwards. i.e move out in the blue arrow direction for one circle diameter, then go around in the red arrow direction, then repeat next ring in the blue arrow direction.

Anyone can share a smarter method? Thank you all. I need only to calculate the number, but if there is a systematic way to draw will be better.

• How about you just fill a grid of circles and compute an algorithm that removes the wrong ones? – Patrick Da Silva Nov 3 '11 at 3:46
• Some interesting picures are at www2.stetson.edu/~efriedma/cirincir and at hydra.nat.uni-magdeburg.de/packing/cci Close packing is not always optimal – Ross Millikan Nov 3 '11 at 4:00
• @Patrick because when there is large difference in big and small circle diameter, it is not that efficient counting one by one. I was hoping to just have a formula/theory to calculate the max, but I end up drawing (and counting) one by one because it appeared easier to begin solving. – Jake Nov 3 '11 at 4:11
• @Ross I saw those links before I posted. The application for the small circles is to house heating elements. So the packing has to be uniform. – Jake Nov 3 '11 at 4:13
• @Jake: then I think Carl's solution is a good one. The worry would be that there will be slop between the small circles and the big one that might allow them to shift. – Ross Millikan Nov 3 '11 at 4:40

## 2 Answers

If your goal is to make a program, then considering you already have that done, it seems like the easiest strategy would just be to: 1. Add on more rings until you know that every circle in a new ring will be outside the main circle. 2. Iterate through the small circles, removing all of the circles who's centers are further than R-r from the main circle, where R and r are the radii of the large and small circles respectively.

That however assumes that you can't fit more circles in by translating your entire set of small circles to the side a bit more. If you want to make sure you have the maximum, you might have to do some more fudging.

• if the radius between the large and small circle is big, I have to draw a lot more rings since the blue hexagon will have sides further to the red circumference. Using (2), I don't know when to stop drawing rings. A method to calculate the perdicular distance from center to edge of blue hexagon could help, but i don't think it will be conclusive. And imho (1) does not work because rings closer to circumference will not be complete rings, cut at the blue hexagon corners. – Jake Nov 3 '11 at 3:55
• in any case, main objective is to calculate the max. The drawing is just to visually verify. – Jake Nov 3 '11 at 3:56
• I will try you suggestion later today. Thanks. – Jake Nov 3 '11 at 5:19
• I figured how the perpendicular distance from center to the side of hexagon and used your suggestion to cull the blue circles that extends outside of the red circumference. So the drawing works now! Thanks. But I still wonder if there is a direct formula to calcualate this. – Jake Nov 3 '11 at 6:01

I found a method to calculate the number of small cirles in the illustrated layout given a specific small circle and big circle diameter.

First, consider the layout as concentric layers of 6-sided polygon (hexagon) made up of small circles. Second, observe that the corners of the hexagon reaches the furthest extent of the circle, hence defining the limiting the big circle's radius.

Next, for each layer, the hexagon has 6 x n small circles in the nth layer. Hence total number of circles in N layers is 6 x summation(1 to n) and we add 1 more for the center circle.

Next is find the number of layers possible given a big circle, and that is simply diving the big radius by the small radium and find the qoutient.