I apologize for writing such a long answer. My approach is to start with a theoretical maximum and a guaranteed minimum. When you approach a problem, you can use these values ββto determine how good any algorithm you use is. If you can come up with a better minimum, you can use this instead.
We can define the upper limit for the task simply by using the area of ββthe circle
Upper Limit = floor( (PI * (r pow 2)) / (L * L) )
Where L is the width or height of the squares you are packing, and r is the radius of the circle in which you are packing the squares. We are sure that this is the upper limit, because: a) we must have a discrete number of boxes and b) we cannot occupy more space than the area of ββa circle. (The formal proof will work somewhere along the lines, assuming that we have one more box than this, then the sum of the boxes will be larger than the circle area).
So, having an upper limit in our hands, we can now make any decision that exists for all circles, and call it the minimum solution.
So, consider the solution that exists for all circles, looking at the largest square that we can place inside the circle.
The largest square that you can put inside the circle has 4 points on the perimeter and has the width and length sqrt(2) * radius
(using the Pythagorean theorem and using the radius for the length of the shorter edges)
So, the first thing we note is that if sqrt(2) * radius
less than the dimension of your squares, then you cannot put any squares in a circle, because after that it is the largest square you can put.
Now we can do a simple calculation to divide this large square into a regular grid of squares using the L you specify, which will give us at least one solution to the problem. So you have a grid of sqaures inside this maximum square. The number of squares you can put on one line of this grid,
floor((sqrt(2) * radius)/ L)
And so this minimal solution claims that you can have at least
Lower Limit = floor((sqrt(2) * radius)/ L) pow 2
the number of squares inside the circle.
So, if you get lost, all I did was take the largest area that I could fit in a circle, and then collect as many squares as possible into a regular grid inside to give me at least one solution.
If you get an answer of 0 for this stage, you cannot fit in the squares inside the circle.
Now, armed with a theoretical maximum and an absolute minimum, you can start using any heuristic algorithm that you like for packing squares. A simple algorithm would be to simply divide the circle into lines and place as many squares as you can on each line. You can then take this minimum as a guideline to make sure you come up with a better solution. If you want to spend more computing power to find a better solution, you use a theoretical justification of how close you are to theoretical.
And if you're interested, you can decide what maximum and minimum theoretical percent coverage of the minimum algorithm I idenfied gives you. The largest area always covers a fixed ratio (pi / 4 or about 78.5% of the inner area of ββthe circle, which I think). Thus, the maximum theoretical minimum is 78.5%. And the minimum non-trivial (i.e. Non-Zero) theoretical minimum is when you can only put 1 square in the largest square, which happens when the squares you are packing are 1 more than half the width and height of the largest square, you can fit in a circle. Mostly you occupy just over 25% of the internal area with 1 packed square, which means that you get an approximate cover of about 20%