  We present a model that explains the origin and predicts the statistical
properties of columnar quasi-hexagonal crack patterns, as observed in the
columnar jointing of basaltic lava flows. Irregular fractures appear at the
surface of the material, induced by temperature gradients during cooling. At
later times fractures penetrate into the material, and tend to form polygonal
patterns. We show that this ordering can be described as a tendency to minimize
an energy functional. Atomistic simulations confirm this interpretation.
Numerical simulations based on a phenomenological implementation of this
principle generate patterns that have remarkably good statistical agreement
with real ones.
