I need a packing algorithm that fits a set of circles of varying radii, if the circles fit, in a rectangle. I've seen various pages on Wikipedia and other sites, but the implementation itself is either too complicated or simply a mathematical theorem, neither of which I have the experience or knowledge to utilize.
Someone asked this question, which is sort of the inverse--I need circles in rectangles not vice versa, and I would prefer Java, not MATLAB, though I suppose if necessary I could port it.
Thanks!
EDIT:
I don't need to find the smallest rectangle in which the circles would fit, I just need to know if the circles would fit within a given rectangle with specified dimensions.