Sixteen space-filling curves and traversals for d-dimensional cubes and simplices
This article describes sixteen different ways to traverse d-dimensional space recursively in a way that is well-defined for any number of dimensions. Each of these traversals has distinct properties that may be beneficial for certain applications. Some of the traversals are novel, some have been known in principle but had not been described adequately for any number of dimensions, some of the traversals have been known. This article is the first to present them all in a consistent notation system. Furthermore, with this article, tools are provided to enumerate points in a regular grid in the order in which they are visited by each traversal. In particular, we cover: five discontinuous traversals based on subdividing cubes into 2^d subcubes: Z-traversal (Morton indexing), U-traversal, Gray-code traversal, Double-Gray-code traversal, and Inside-out traversal; two discontinuous traversals based on subdividing simplices into 2^d subsimplices: the Hill-Z traversal and the Maehara-reflected traversal; five continuous traversals based on subdividing cubes into 2^d subcubes: the Base-camp Hilbert curve, the Harmonious Hilbert curve, the Alfa Hilbert curve, the Beta Hilbert curve, and the Butz-Hilbert curve; four continuous traversals based on subdividing cubes into 3^d subcubes: the Peano curve, the Coil curve, the Half-coil curve, and the Meurthe curve. All of these traversals are self-similar in the sense that the traversal in each of the subcubes or subsimplices of a cube or simplex, on any level of recursive subdivision, can be obtained by scaling, translating, rotating, reflecting and/or reversing the traversal of the complete unit cube or simplex.