Minimum square side length to enclose n circles of radius r
This is known as circle packing in a square.  The Wikipedia article I link to has a citation to this webpage, which lists the best packings known for $n \le 10000$, and also has many references to papers that study this problem.  I suggest studying them to see what methods they have used.