illustration of the close-packing of equal spheres in both hcp (left) and fcc (right) lattices
in geometry, close-packing of equal spheres is a dense arrangement of congruent spheres in an infinite, regular arrangement (or lattice). carl friedrich gauss proved that the highest average density – that is, the greatest fraction of space occupied by spheres – that can be achieved by a lattice packing is
the same packing density can also be achieved by alternate stackings of the same close-packed planes of spheres, including structures that are aperiodic in the stacking direction. the kepler conjecture states that this is the highest density that can be achieved by any arrangement of spheres, either regular or irregular. this conjecture was proven by t. c. hales. highest density is known only in case of 1, 2, 3, 8 and 24 dimensions.
many crystal structures are based on a close-packing of a single kind of atom, or a close-packing of large ions with smaller ions filling the spaces between them. the cubic and hexagonal arrangements are very close to one another in energy, and it may be difficult to predict which form will be preferred from first principles.