It is trivial to solve your discrete ball-packing problem optimally, IF we subject ourselves to the constraint that the solution be a LATTICE. (Get computer to try every lattice. Lattice if D dimensions defined by D basis vectors, the lattice is their integer linear combinations.) In 3 and 4 and 8 dimensions the best ball packing lattices in fact have integer coordinates (if suitably scaled & rotated). In 2 dimensions this is also true if we cheat by using integer coordinates in 3-space, and agree to stay on the plane x+y+z=0. In 2D one way to get a very close approximation to the perfect beehive packing is to use lattice defined by basis vectors (0, 2A) and (B, A) where B/A is a good rational approximation to sqrt(3), got from the continued fraction expansion of sqrt(3)...