start with researching circle packing and known algorithms for it.
If you are lucky there will be a good implementation in R or python , or some other language that you can learn to use, if not you may have to take a similar enough approach, and modify it for your needs.