Sphere packing in a cuboid algorithm

1.7k Views Asked by At

Given a (3D) cuboid and an integer N, how can I position N spheres that fit inside without touching such that the radius of the spheres is maximised?

Is there some group theory that I need to know, or are there "jiggling" algorithms that can calculate an answer?

Actually, only the centres of the spheres need to be inside. If I was concerned with a cube I think I could get away with scaling the solution after it was found, however I'm not sure if that's possible.

Put another way, I would like to find the N points inside a given cuboid that maximises the minimum distance between any two.

What algorithm does this use? Can this be adapted? http://www.randomwalk.de/sphere/incube/spheresincube.html

This link to wikipedia is infuriating... http://en.wikipedia.org/wiki/Packing_problem#Spheres_in_a_cuboid

If an algorithm or general method that finds the optimal solution is not known or does not exist, is there one that will find a approximate or "good enough" solution?