How many three-dimensional Hilbert curves are there?
HHow many three-dimensional Hilbert curves are there?
Herman HaverkortEindhoven University of Technology1 October 2016
Abstract
Hilbert’s two-dimensional space-filling curve is appreciated for its good locality-preserving prop-erties and easy implementation for many applications. However, Hilbert did not describe how togeneralize his construction to higher dimensions. In fact, the number of ways in which this may bedone ranges from zero to infinite, depending on what properties of the Hilbert curve one considersto be essential.In this work we take the point of view that a Hilbert curve should at least be self-similar andtraverse cubes octant by octant. We organize and explore the space of possible three-dimensionalHilbert curves and the potentially useful properties which they may have. We discuss a notationsystem that allows us to distinguish the curves from one another and enumerate them. This systemhas been implemented in a software prototype, available from the author’s website. Several examplesof possible three-dimensional Hilbert curves are presented, including a curve that visits the pointson most sides of the unit cube in the order of the two-dimensional Hilbert curve; curves of which notonly the eight octants are similar to each other, but also the four quarters; a curve with excellentlocality-preserving properties and endpoints that are not vertices of the cube; a curve in which allbut two octants are each other’s images with respect to reflections in axis-parallel planes; and curvesthat can be sketched on a grid without using vertical line segments. In addition, we discuss severalfour-dimensional Hilbert curves.
A space-filling curve in d dimensions is a continuous, surjective mapping from R to R d . In the late19th century Peano [36] was the first to present such a mapping. It can be described as a recursiveconstruction that maps the unit interval [0 ,
1] to the unit square [0 , . The unit square is divided intoa grid of 3 × (a) (b) (c) (d) Figure 1: (a–c) A sketch of Peano’s space-filling curve. (d) A sketch of Hilbert’s space-filling curve.1 a r X i v : . [ c s . C G ] N ov an be extended to a mapping from R to R by inverting the recursion, recursively considering the unitinterval and the unit square as a subinterval and a cell of a larger interval and a larger square.In response to Peano’s publication, Hilbert [20] sketched a space-filling curve based on subdividing asquare into only four squares (Figure 1d). Since then, quite a number of space-filling curves have appearedin the literature [18, 39], and space-filling curves have been applied in diverse areas such as indexing ofmultidimensional points [3, 23, 25, 27], load balancing in parallel computing [7, 14], improving cacheutilization in computations on large matrices [5] or in image rendering [41], finite element methods [4],image compression [1], and combinatorial optimization [37]—to give only a few examples of applicationsand references. The function of the space-filling curve typically lies in providing a way to traverse pointsor cells of a square or a higher-dimensional space in such a way that consecutive elements in the traversaltend to lie very close to each other, and elements that lie very close to each other tend to be close toeach other in the traversal order. In other words, the space-filling curve preserves locality : this effect iscaptured by various metrics which we will discuss in Section 3.3.For many applications, Hilbert’s curve, rather than Peano’s, appears to be the curve of choice,sometimes for its better locality-preserving properties (points close to each other along the curve tendto be close to each other in the plane) [41], but more commonly for the fact that Hilbert’s curve is basedon subdividing squares into only four subsquares. The latter property does not only make the Hilbertcurve well suitable for the traversal of quadtrees and of grids whose width is a power of two, but it alsomatches very well with binary representations of coordinates of points. In particular, the cell in whicha given point p lies can be determined by inspecting the binary representations of the coordinates of p bit by bit, and as a consequence, the order in which two points p and q appear along the curve can bedetermined without relatively time-consuming arithmetic such as divisions.Peano’s two-dimensional curve, based on a subdivision of a square into nine squares, generalizes ina natural way to a three-dimensional curve, based on a subdivision of a cube into 27 cubes (Peano alsodescribed this), or even a d -dimensional curve, based on a subdivision of a hypercube into 3 d hypercubes.However, generalization of the Hilbert curve to higher dimensions is not as straightforward—Hilbert’spublication does not discuss it. Naturally, a generalization to three dimensions would be based onsubdividing cubes into eight cells. The tricky part is how to choose the traversals within the cells, sothat each cell’s first subcell touches the previous cell’s last subcell and continuity of the mapping isensured.Butz’s solution to this problem [8] is fairly well-known, but many other solutions are possible. Docu-mentation of existing applications or implementations of three-dimensional Hilbert curves is not alwaysexplicit about the fact that a particular, possibly arbitrary, curve was chosen out of many possible three-dimensional Hilbert curves. However, different curves have different properties: which three-dimensionalHilbert curve would constitute the best choice depends on what properties of a Hilbert curve are deemedessential and what qualities of the space-filling curve one would like to optimize for a given application.This gave rise to efforts to set up frameworks to describe such curves [2] and to analyse differences intheir properties so that one can identify optimal curves for different applications [9, 13, 34], includingrecent efforts by my co-authors and myself [6, 19]. However, the scope of these studies has been fairlylimited, each of them considering only a subset of possible Hilbert curves and focusing on one particularquality to optimize. Contents of this article
In this work we dive into the question what defines a Hilbert curve. Differentanswers may unlock different worlds of three-dimensional space-filling curves. Is each of them as goodas any other? What do the different curves have in common and what are their differences? Can weenumerate them within reasonable time to analyse their properties? Can we also answer these questionsfor higher-dimensional Hilbert curves?The goal of this work is to explore and organize the space of possible three-dimensional Hilbert curvesand the properties which they may have, to find interesting three-dimensional space-filling curves, andto generate ideas for further generalization to four or more dimensions. Among the newly discoveredcurves in the present article are: • the three-dimensional harmonious Hilbert curve (sketched in Figure 2 and Figure 15a), which hasunique the property that the points on five of the six two-dimensional facets of the unit cubeare visited in the order of the two-dimensional Hilbert curve (in four dimensions we found suchproperties to be relevant to R-tree construction [19]);2igure 2: The three-dimensional harmonious Hilbert curve . In the centre of the figure, there is a (ratherimpenetrable) sketch of the order in which the curve traverses points in a 8 × × × × × × • a curve (sketched in Figure 15d) of which not only the eight octants are similar to each other, butalso the four quarters and the two halves, and which minimizes the worst-case relative size of theboundary of any curve section (a quality measure relevant to load-balancing applications [21]); • a curve (sketched in Figure 3(centre) and Figure 19a) which, similar to the two-dimensional Hilbertcurve, is only rotated in the first and the last octant, whereas the curve within each of the remainingoctants is obtained from the complete curve by a combination of only scaling, translation, reversaland/or reflection in axis-parallel planes; • curves along which consecutive subcubes are never directly on top of each other (Figures 10, 19cand 19d): if one sketches the curve by connecting the centre points of the cells in a regular grid inthe order in which they are traversed by the curve, then there are no vertical edges.Some more examples are shown in Figures 3, 15, 16, 19, 20, and 24.Furthermore, this article sets up a notation and naming system that is compact, yet sufficientlypowerful to distinguish between 10 694 807 different three-dimensional Hilbert curves (modulo rotation,reflection, translation, scaling and reversal), assigning a unique name to each such curve. The systemcomes with a prototype of a software tool that can enumerate the curves, or determine the name ofa curve from the order in which it traverses the cubes in a grid. This may facilitate the automaticidentification, verification and comparison of curves implemented in existing code, whose documentationdoes not always explicitly specify exactly what three-dimensional Hilbert curve is used, out of the manypossible curves.This article is structured as follows. 4n Section 2, I describe a notation system that allows us to describe Hilbert curves and discusstheir properties. We discuss the characteristic properties of the two-dimensional Hilbert curve andtheir possible generalizations to higher dimensions in Section 3. From the (generalized) properties ofthe two-dimensional Hilbert curve, we select some as defining properties for Hilbert curves in arbitrarydimensions. In support of this selection and as a warming-up for what follows, we prove that in twodimensions, the known Hilbert curve is the unique curve that has all of the defining properties (Section 4).At the heart of our proof is a case distinction by different possible locations of the end points of thecurve. We find that in two dimensions, the only combination of end points that can be realized by acurve that has all of the selected properties consists of two vertices on the same edge of the square.We then turn to exploring the space of three-dimensional Hilbert curves. A straightforward encodingof Hilbert curve descriptions in the notation presented in Section 2 does not allow us to enumerate suchcurves efficiently. To overcome this problem, we set up a framework for a more compact naming schemefor three-dimensional curves in Section 5, which will also make symmetries in curves easier to recognize.In Section 6 we fill in the details, again making a case distinction by different possible locations ofthe end points of the curve. We prove that only a limited number of end points are possible, explainhow to enumerate the names of the possible curves for each possible combination of end points, andshow examples. Next we see how we can establish or verify the presence or absence of combinations ofcertain properties in curves in Section 7, and I report on the locality-preserving properties of the curves.Section 8 briefly describes a prototype of a software tool to enumerate, identify, analyse and sketch thecurves.Having established a way to explore and structure the space of three-dimensional Hilbert curves, wecan now try to answer the title question of this article in Section 9: how many three-dimensional Hilbertcurves are there? We discuss four-dimensional curves in Section 10, and conclude with a discussion ofthe implications of our findings and questions raised by them in Section 11.Illustrated examples of curves appear throughout this article. Appendix A gives the definitions andlists properties of all of these curves.This article extends, improves and replaces most of my brief preliminary manuscript “An inventoryof three-dimensional Hilbert space-filling curves” [16] . We can define a self-similar traversal of points in a d -dimensional cube as follows. We consider the unitcube C to be subdivided into 2 d subcubes of equal size. We specify a base pattern : an order in which thetraversal visits these subcubes. Let C , ..., C d be the subcubes indexed by the order in which they arevisited. Moreover, we specify, for each subcube C i , a transformation σ i that maps the traversal of thecube as a whole to the traversal of C i . More precisely, each σ i can be thought of as a triple ( γ i , ρ i , χ i ),where γ i : C → C is one of the 2 d d ! symmetries of the unit cube, ρ i : C → C i translates the unitcube and scales it down to map it to C i , and χ i : [0 , → [0 ,
1] is a function that specifies whether ornot to reverse the direction of the traversal: it is defined by χ i ( t ) = t for a forward traversal, and by χ i ( t ) = 1 − t for a reversed traversal.When d = 2 or d = 3, it is feasible to give such a specification in a graphical form, as follows.We draw a cube, and indicate, by a thick arrow along the vertices of the cube, the order in which itsvertices, and hence its 2 d first-level subcubes C , ..., C d , are visited by the traversal. This is the first-order approximating curve (see Figure 4a). In fact, we can omit the unit cube from the drawing, as it isimplied by the arrow. Inside the cube, we draw the second-order approximating curve : a polygonal curvethat connects the centres of the 4 d second-level subcubes of the unit cube in the order in which they arevisited by the traversal (Figure 4b). Finally, we mark, with an open dot, the vertex that represents C ,and the vertices that represent the corresponding second-level subcubes within their respective first-levelsubcubes. The arrow head on the first-order approximating curve is now redundant and can be removed(Figure 4c). However, the present article does not cover the previous manuscript entirely. The previous manuscript [16] focuses moreon certain metrics of locality-preserving properties and includes some results on non-self-similar, “poly-Hilbert” curves thatare not covered here. a) (b) (c) Figure 4: Example of a graphical definition of a three-dimensional Hilbert curve. (a) First stage: thefirst-order approximating curve. (b) Second stage: the second-order approximating curve. (c) Thirdstage: marking the vertex representing the first first-level subcube and the vertices representing thecorresponding second-level subcubes.(a)(b) (c) (d)Figure 5: (a,b) Two subtly different definitions of three-dimensional Hilbert curves: the only differenceis the location of the open dot in the last octant. (c,d) The corresponding third-order approximatingcurves, which differ in the last octant.Note how the open dots specify the direction functions χ i : if, within a given subcube C i , the markedvertex is the first one visited by the second-order approximating curve, then χ i ( t ) = t ; if the markedvertex is the last one visited by the second-order approximating curve, then χ i ( t ) = 1 − t . Given χ i , thetransformations γ i and ρ i are implied by the shapes of the first- and second-order approximating curves:these curves show how the base pattern (and hence, the whole traversal) is rotated and/or reflected ineach octant. If the first-order approximating curve is asymmetric (as in Figures 16efh and 19e), thefunctions χ i are implied by the drawing of the second-order curve even without the dots, but we drawthe dots nevertheless for clarity. If the second-order approximating curve is symmetric (as in Figures15abdefh and 16abcdg), the whole traversal is symmetric, and the dots are without effect—in this casewe omit the dots to emphasize the symmetry. If the first-order approximating curve is symmetric but thesecond-order approximating curve is not (as in Figures 15cg, 19abcd, 20 and 24) the dots are necessaryfor the unambiguous definition of a self-similar traversal: Figure 5 illustrates how moving a dot on thesecond-order approximating curve leads to differences in the third-order approximating curve. As illustrated in Figure 1, we can think of a traversal as mapping segments of the unit interval tosubcubes of the unit cube C . For a given level of refinement k , consider the unit interval subdividedinto 2 kd segments of equal length, and the unit cube subdivided into 2 kd subcubes of equal size. Let6 2 3 v , ..., v = (cid:16) (cid:17) (cid:16) (cid:17) (cid:16) − (cid:17) (cid:16) (cid:17) (cid:16) (cid:17) (cid:16) − (cid:17) (cid:16) − (cid:17) V , ..., V = { } { } {− } { } { } {− } {− } v , ..., v = (cid:16) (cid:17) (cid:16) (cid:17) (cid:16) − (cid:17) (cid:16) − (cid:17) (cid:16) (cid:17) (cid:16) (cid:17) (cid:16) − (cid:17) V , ..., V = { } { } {− } {− , } { } { } {− } (a)(b)Figure 6: Two examples of a base pattern, the corresponding vectors v , ..., v and “moves” V , ..., V . s ( i, k ) be the i -th segment of the unit interval, that is, the interval [( i − · − kd , i · − kd ]. Let c ( i, k )be the i -th subcube in the traversal. We can determine c ( i, k ) from the transformations γ, ρ and χ asfollows. If k = 0, then i must be 1 and c ( i, k ) = C . Otherwise, let z = 2 d ( k − be the number of subcubeswithin a first-level subcube, let b = (cid:100) i/z (cid:101) be the index of the first-level subcube that contains c ( i, k ),and let j be the index of c ( i, k ) within C b . More precisely, if χ b indicates a forward traversal of C b ,then j = i − ( b − z , and if χ b indicates a reverse traversal of C b then j = bz − i + 1. Then we have c ( i, k ) = ρ b ( γ b ( c ( j, k − s ( i, k ) to the cube c ( i, k ).As k goes to infinity, the segments s ( i, k ) and the cubes c ( i, k ) shrink to points, and the traversaldefines a mapping from points on the unit interval to points in the unit cube. By construction, themapping is surjective. However, it may be ambiguous, as some points in the unit interval lie on theboundary between segments for any large enough k . We may break the ambiguity towards the leftor towards the right, by considering segments to be relatively open on the left or on the right side,respectively. In the first case, for a given k , we consider a point t on the unit interval to be part ofthe i -th interval with i = (cid:100) kd t (cid:101) , and we define a mapping τ − : (0 , → C to points in the unit cubeby τ − ( t ) = lim k →∞ c ( (cid:100) kd t (cid:101) , k ). In the second case, we consider t to be part of the i -th interval with i = (cid:98) kd t (cid:99) + 1, and we define a mapping τ + : [0 , → C by τ + ( t ) = lim k →∞ c ( (cid:98) kd t (cid:99) + 1 , k ). To define the mappings τ − and τ + , all we need to do is to specify, for each i ∈ { , ..., d } , the transfor-mation γ i , the location of C i (or, to the same effect, ρ i ), and the orientation function χ i . This can bedone in a graphical way, as explained above, but this approach is not suitable for automatic processing oftraversals in software (or for four- and higher-dimensional traversals, for that matter). For that purpose,we need a numeric notation system. The numeric systems used in this article is based on ideas fromBos as incorporated in our work on hyperorthogonal well-folded Hilbert curves [6], adapted to suit thebroader class of curves discussed in the present article. I will now explain this notation system.We specify the base pattern by indicating, for each of the subcubes C i with 1 < i ≤ d , where it liesrelative to the previous subcube C i − . Let c i be the centre point of C i ; the position of C i relative to C i − can then be expressed by the vector v i = c i − c i − . We use square brackets to index the elementsof a vector, so v i is a column vector with elements v i [1] , v i [2] , ...v i [ d ]. However, in our notation system,we specify v i in a more compact way, namely by a set of numbers V i ⊂ {− , ..., − d } ∪ { , ..., d } such that v i [ j ] < − j ∈ V i ; v i [ j ] > j ∈ V i ; and v i [ j ] = 0 if and only if j, − j / ∈ V i .For an example, see Figure 6. Note how V i = { j } can be interpreted as: move forward along the j -thcoordinate axis to get from C i − to C i , while V i = {− j } means: move back along the j -th coordinateaxis, and V i = { j , j } indicates a diagonal move, simultaneously moving forward in coordinates j and j . Assume the unit cube is centered at the origin. Each transformation γ i : C → C is a symmetry ofthe unit cube and can be interpreted as a matrix M i such that γ i ( x ) = M i x , where x is a point givenas a column vector of its coordinates. Each row and each column of M i contains exactly one non-zeroentry, which is either 1 or −
1. We specify such a matrix by a signed permutation of row indices, thatis, a sequence of numbers Π i = π i [1] , ..., π i [ d ] whose absolute values are a permutation of { , ..., d } and7hich corresponds to the matrix in the following way: the non-zero entry of column j is in row | π i [ j ] | and has the sign of π i [ j ]. We write the sequence π i [1] , ..., π i [ d ] between [ and } to specify a forwardtraversal ( χ i ( t ) = t ), whereas we write the sequence π i [1] , ..., π i [ d ] between { and ] to specify a reversetraversal ( χ i ( t ) = 1 − t ). For example, the traversal from Figure 5ac has the following permutations, inorder from C to C :[3 , , } , [3 , , } , { , , − , [ − , − , } , {− , − , − , [ − , , − } , {− , , , { , − , . Note how our notation facilitates mapping the base pattern to the order in which the suboctants of C i are visited. For example, if j is positive, a move { j } , forward along the j -th coordinates axis, translatesto a move { π i [ j ] } within C i . If we define π i [ − j ] = − π i [ j ], then the translation also works for negativevalues of j .A complete self-similar traversal order is now specified by listing the signed and directed permutationsΠ , ..., Π d , with, between each pair of consecutive permutations Π i − and Π i , the set V i that gives thelocation of C i relative to C i − . Depending on lay-out requirements, we may omit commas and/or wemay write the numbers of a set V i or a signed permutation Π i below each other instead of from left toright; we will also omit braces around V i . Thus we get the following description of the traversal fromFigure 5ac: (cid:104) (cid:111) (cid:104) (cid:111) (cid:104) - (cid:111) - (cid:104) - - (cid:111) (cid:110) - - - (cid:105) (cid:110) - - (cid:105) - (cid:110) - (cid:105) - (cid:110) - (cid:105) . Note that we do not specify the location of C explicitly, but it can be derived from the sets V , ..., V d : C is on the low side with respect to coordinate j if and only if j appears in any set V i before − j does,that is, if there is a set V i such that − j / ∈ V , ..., V i and j ∈ V i . If a traversal has the property that consecutive segments of the unit interval are always matched tosubcubes that touch each other, then, as k increases, the up to two subcubes corresponding to thesegments that share a point t ∈ [0 ,
1] must shrink to the same point p ∈ C . For t ∈ (0 , τ − ( t ) = τ + ( t ). Moreover, the functions τ − and τ + are continuous. The traversal thus follows a space-filling curve τ : [0 , → [0 , d given by τ (0) = τ + (0), τ ( t ) = τ − ( t ) = τ + ( t ) for 0 < t <
1, and τ (1) = τ − (1). By construction, this curve is self-similar: for each i ∈ { , ..., d } and t ∈ [0 ,
1] we have τ (( i − t ) · − d ) = ρ i ( γ i ( τ ( χ i ( t )))). Moreover, the mapping is measure-preserving: for any set of points S ⊂ [0 ,
1] with one-dimensional Lebesgue measure z , the image (cid:83) x ∈ S τ ( x ) of S has two-dimensionalLebesgue measure z .Recall that in our graphical notation, we used the first-order and the second-order approximatingcurve. In general, we define the k -th-order approximating curve A k of a space-filling curve τ as thepolygonal curve that connects the centre points of the 2 kd subcubes in a regular grid in the order inwhich they appear along τ . In fact, the space-filling curve τ is equal to the limit of A k as k goes toinfinity. The first-order approximating curve A is easy to draw, given a description of the curve inour numerical notation: the sets V i explicitly specify the directions of the successive edges of A (seeFigure 6). The 2 d − A within any octant C i are also easy to draw, as their directions areobtained by applying the signed permutation Π i to the sets V , ..., V d . Note, however, that in A , theedges between the octants do not necessarily have the same directions as in A . For example, axis-paralleledges may become diagonal, as in Figure 4b. Therefore one cannot obtain the edges of A by takingthe sequence of alternating permutations and edges of A that define the curve and merely substitutingtransformations of A for the permutations. This is in contrast to the properties of approximating curvesin our work on hyperorthogonal well-folded curves [6], where the specific properties of the curves understudy ensured that edges keep their orientation from one approximating curve to the next. Traversals can also be defined based on other shapes than squares or cubes, or based on subdivision intofewer or more than 2 d parts. Examples in two dimensions include the triangle-based Sierpi´nski curve [39],the fractal-based Gosper flowsnake curve [12], and the nine-part Peano curve [36]. Such traversals arebeyond the scope of this article, although our notation system is powerful enough to describe some ofthem (see Figure 7 for some examples). 8a) [ } { - ] [ - } { - - ] (b) (cid:104) (cid:111) (cid:110) - - - (cid:105) (cid:104) - - (cid:111) - (cid:110) - (cid:105) (cid:104) - (cid:111) (cid:104) (cid:111) (cid:110) - (cid:105) - (cid:104) - - (cid:111) Figure 7: (a) Definition of the Sierpi´nski curve, which fills an isosceles right triangle. Note how theapproximating curves visit vertices multiple times, since each visit corresponds to filling only half of thecorresponding square in the underlying grid. In numeric notation, staying at a vertex for a second visitis indicated by an empty move between two signed permutations. (b) Definition of a novel curve thatfills the extrusion of an isosceles right triangle. It is the only eight parts’ self-similar face-continuous(see Section 3.2.1) curve that fills this shape. Here, too, the approximating curves visit vertices multipletimes. The diagram on the right, included for completeness, is explained in Section 6.Non-self-similar traversals may be constructed from a set of multiple traversals in which each subcubeis traversed by a scaled-down, rotated, reflected and/or reversed copy of a traversal from the given set;examples in two dimensions include Wierum’s β - and Ω-curves [42] and the AR W -curve [3], which isconstructed from a set of four curves [17, 18]. Non-self-similar traversals may also be constructed byconcatenating rotated, reflected and/or reversed copies of a self-similar traversal: an example is Moore’scyclic variation of the Hilbert curve [32]. The graphical and numerical notation systems described abovesuffice for self-similar traversals, but would have to be extended or adapted to be able to describe non-self-similar traversals. For the graphical notation, I describe such extensions in other work [16, 17, 18];I omit such extensions here, because in the next section, we will restrict the scope of this article toself-similar curves. Within this publication, we restrict the discussion to traversals τ that are: • octant-based : each of the 2 d subcubes of the unit cube is the image under τ of a consecutive intervalwithin [0 , • self-similar : the traversal τ restricted to any of the 2 d subcubes can be obtained by a lineartransformation from the complete traversal τ , as described in the previous section; • continuous : this implies that if we consider a regular grid of 2 kd subcubes of the unit cube in theorder which they are traversed by τ , for any integer k , then consecutive subcubes in the traversalalways touch each other.In Section 4 we will see that in two dimensions, these three properties constitute a minimal set ofproperties that uniquely defines the two-dimensional Hilbert curve. Therefore, one could say that anythree-dimensional curve that fulfills these properties must be a three-dimensional Hilbert curve. Thisis indeed the approach which we will take in this article: we will call the properties of being octant-based, self-similar and continuous the three essential properties of Hilbert curves, and henceforth, wewill consider a traversal to be a Hilbert curve if and only if it has these three properties. This choice isjustified in more detail in Section 3.4.The two-dimensional Hilbert curve also has other interesting, non-defining properties, which we mightwant to see in three-dimensional curves as well, for example to meet requirements of applications, to9acilitate generalizations to even more dimensions, or simply to avoid confusion. Unfortunately, we canalways think of a combination of properties of the two-dimensional curve that cannot be realized in threedimensions. Without the context of a particular application, we cannot decide a priori which propertiesto prefer at the expense of others. Therefore, in this article, I will regard all additional properties to beoptional. In Section 3.2 below we discuss a number of such properties and how to generalize them tothree or more dimensions.
Below is a list of non-defining properties of the two-dimensional Hilbert curve, stated in a dimension-independent way. The listed properties may be useful in higher dimensions as well. In Sections 6 and 7we discuss what three-dimensional Hilbert curves have some of these properties.
We say a space-filling curve is face-continuous if, for any section of the curve, theinterior of the region filled by that section is connected. In other words, for any 0 ≤ a < b ≤
1, theinterior of the set (cid:83) bt = a τ ( t ) must be connected. Concretely, for the case of d -dimensional Hilbert curves,this means that, at any level of recursion, cubes that are consecutive along the curve must share a ( d − A , A , ... , asdefined in Section 2, are axis-parallel. Face-continuity thus generalizes the property of two-dimensionalHilbert curves that consecutive squares always share an edge.Face-continuity may be considered instrumental in achieving good locality-preserving properties—seeSection 3.3. However, requiring face-continuity also severely restricts the combinatorial possibilities forassembling a cube-filling curve from similar curves in each of eight octants. Under certain circumstances,better properties might be achieved by trading face-continuity for combinatorial flexibility. Hyperorthogonality.
Recall that a d -dimensional Hilbert curve can be described by a series of ap-proximating polygonal curves A k , whose edges connect the centres of consecutive cubes along the curvein a grid of 2 dk subcubes of the unit cube. We can identify the unsigned orientation of an edge or a line e by an unordered pair of antipodal points on the unit sphere, such that e is parallel to the line throughthese points. We say that a d -dimensional Hilbert curve is hyperorthogonal if and only if, for all positiveintegers k and for all n ∈ { , ..., d − } , the unsigned orientations of each sequence of 2 n consecutiveedges of A k are those of exactly n + 1 different axes of the Cartesian coordinate system [6].Hyperorthogonality can be understood as a stronger (more restrictive) generalization of the two-dimensional Hilbert curve’s property that consecutive squares always share an edge. This propertyof the two-dimensional curve can also be phrased as: each edge between the centres of consecutivesquares must be parallel to an axis of the coordinate system. This is exactly what hyperorthogonalityrequires in the case n = 0, and this case is what hyperorthogonality boils down to if d = 2. In threedimensions, hyperorthogonality requires the same (and thus, face-continuity), and adds the case n = 1:any pair of consecutive edges of an approximating curve must be orthogonal to each other. As wewill see in Section 7.3, hyperorthogonal three-dimensional Hilbert curves have good locality-preservingproperties, and Bos and I found that, for a certain metric of locality-preservation, this generalizes tohigher dimensions [6]. Symmetry.
A traversal order τ is symmetric if there is an isometric transformation γ such that τ + ( t ) = γ ( τ − (1 − t )) for all t ∈ [0 , τ − ( t ) = γ ( τ + (1 − t )) for all t ∈ (0 , τ ( t ) = γ ( τ (1 − t )) for all t ∈ [0 , τ ( t ) = γ ( τ (1 − t )) = γ ( γ ( τ ( t )).Thus, the curve τ is equal to its own reverse under the transformation γ , which must, in general, bea rotary reflection that is its own inverse. Symmetry can have advantages for the implementation ofefficient algorithms operating on the curve, since it allows the algorithm designer to choose betweengeometric transformations or reversing the direction, whatever is easiest to implement. Bader [4] uses the term face-connected . I prefer face-continuous because I find face-connected easy to confuse with mydefinition of facet-gated (see Section 3.2.2). etasymmetry. We say a traversal is metasymmetric if there is a (not necessarily symmetric) lineartransformation that maps the first half of the curve to the second half, and each half is metasymmetricitself. The property of being metasymmetric can be understood as a stronger (more restrictive) gen-eralization of the two-dimensional Hilbert curve’s symmetry and self-similarity: symmetry implies thatsections of the curve of length 1 / / d are similar to each other; metasymmetry requires for all positive integers n that sections of thecurve of length 1 / n are similar to each other. Note, however, that, in deviation from the definition ofplain symmetry, we do not require the similarities to be captured by symmetric transformations, that is,transformations that are their own inverse. Neither the two-dimensional Hilbert curve, nor any three-dimensional Hilbert curve, would fulfill a stronger definition of metasymmetry that requires each half ofthe curve to be fully symmetric in itself, that is, consisting of two quarters that can be mapped ontoeach other by a transformation that is its own inverse. Palindromy.
Consider an octant-wise traversal of the cube, and an interior facet , that is, a facet F between two octants C i and C j , where i < j . For any k ≥
1, define K = 4 k − and consider F subdividedinto a regular grid of K squares. Let F i, , ..., F i,K be these squares in the order in which the traversalvisits the adjacent subcubes of C i , and let F j, , ..., F j,K be the same squares in the order in which thetraversal visits the adjacent subcubes of C j . We say a traversal is facet-palindromic if, for each interiorfacet F between two octants C i and C j (note that there are twelve such facets), and for each level k ,we have F i,t = F j,K +1 − t . In other words, for any interior facet F , the order in which F is traversedthe second time around (during the traversal of C j ) is exactly the opposite of the order in which F istraversed the first time around (during the traversal of C i ).Palindromy is a property that allows simple and elegant implementations of finite element methodsthat use only stacks for storage of intermediate results—the so-called stack-and-stream method [4]. Thetwo-dimensional Hilbert curve is facet-palindromic (with respect to the four edges between the quad-rants). A three-dimensional facet-palindromic octant-wise continuous traversal is not known. Whenwe consider the second-order approximating curves of the Hilbert curves in Figure 8, these curves ap-pear to be facet-palindromic. Unfortunately, the third-order approximating curves show violations ofpalindromy. Thus these curves demonstrate that Bader’s arguments ([4], p229) for the non-existence of palindromic three-dimensional Hilbert curves are inconclusive with respect to the definition of palindromy used here.
Ca00.cT7
Imposter
Ca00.cT9 Ca00.cT9
Figure 8: Two curves, which we will later learn to identify as
Ca00.cT7 and
Ca00.cT9 , that seempalindromic at first sight. For example, consider the interior facet shared by the second and the thirdoctant, as indicated in the figures. We see that the second time, the order in which we visit the foursubsquares of this facet (dashed arrow) is exactly the opposite of the order in which we visit thosesubsquares the first time around (solid arrow). The reader may verify that also on the other eleveninterior facets between the octants, the four quadrants are visited in the exact opposite order the secondtime around. However, if we expand the recursion and consider the subdivision of facets into sixteensquares, we find that the traversal orders from below and from above do not match on the facet betweenthe first and the fourth octant. The right figure illustrates this for
Ca00.cT9 ; for the other curve,
Ca00.cT7 , the situation is similar. 11 a00.cT7
Imposter
Figure 9: This figure shows the second-order approximating curve of the three-dimensional Hilbert curvewhich we will later learn to identify as
Ca00.cT7 . The curve seems to harmonize with the two-dimensionalHilbert curve on five sides: all but the top facet. However, the fourth quadrant of the left facet is an imageof the broken top facet, and thus, the third-order approximating curve of the left facet will not matchthe two-dimensional Hilbert curve. Similarly, in the third-order approximating curve, the harmony withthe right facet is broken, and in the fourth-order approximating curve, the front and bottom facets willnot match the two-dimensional Hilbert curve anymore either. Only on the back facet of the cube, this“Imposter” curve will actually harmonize with the two-dimensional Hilbert curve.
Maximum facet-harmony.
We say a d -dimensional traversal τ harmonizes with an n -dimensionaltraversal τ (cid:48) on a given n -dimensional subset F of the unit cube, if τ restricted to the points of F con-stitutes an isometric copy of τ (cid:48) . On all one-dimensional faces (edges) of the square, the two-dimensionalHilbert curve harmonizes with the unique and trivial one-dimensional Hilbert curve: the one-dimensionalHilbert curve traverses a line segment from one end to the other, and the two-dimensional curve visitsthe points on each edge of the square in order from one vertex to the other. Unfortunately, no three-dimensional Hilbert curve can harmonize with the two-dimensional Hilbert curve on each side of thecube (for a proof, see Appendix B), but it is possible to get five sides (and all edges) right, as we seein Figure 2. Therefore we say that a three-dimensional Hilbert curve has maximum facet-harmony if itharmonizes with the two-dimensional Hilbert curve on five sides.Note that harmony cannot be verified by only looking at the order in which the second-level subcubesare traversed and this may sometimes be misleading: one needs to make sure that the ( d − Full interior-diagonal harmony. A d -dimensional Hilbert curve has full interior-diagonal harmonyif it harmonizes with the trivial one-dimensional Hilbert curve on all 2 d − interior diagonals. Specifically,a three-dimensional Hilbert curve τ has full interior-diagonal harmony if, for each of the four interiordiagonals, τ visits the points on the diagonal in order from one end to the other. Well-foldedness.
Let G ( d ) denote the d -dimensional well-folded approximating curve, defined as fol-lows: G (0) is a single vertex, and G ( d ), for d >
0, is the concatenation of G ( d − d -th coordinate axis, and the reverse of G ( d − G (3) is the curve shownin Figure 6a. A Hilbert curve is well-folded [6] if its first-order approximating curve is G ( d ) (modulorotation, reflection and/or reversal). Note that the successive orientations of the edges in G ( d ) indicateexactly which bits change when proceeding from one number to the next in the d bits’ binary reflectedGray code.The regular structure of G ( d ) provides a good basis for defining a family of Hilbert curves for anynumber of dimensions. Moreover, it can be instrumental in efficient computations with the curve.One way to exploit well-foldedness is in the computation of an inverse of τ , as demonstrated beforeby Bos and myself [6]. An inverse of τ is a mapping τ − : [0 , d → [0 ,
1] such that τ ( τ − ( x )) = x ).Such a mapping can be used to order points along the curve. To compute the order, one can maintainan interval T for any point p such that τ − ( p ) ∈ T . Initially, one sets T equal to [0 , T in steps: each step inspects only one bit of one coordinate of p andthen halves the size of T . To determine the order in which different points appear along the curve, onenarrows down their corresponding intervals just enough so that they become disjoint and their order canbe determined.Another way to exploit well-foldedness is demonstrated by Lawder’s algorithm [24] to compute τ ( t )for a given t and vice versa, when τ is Butz’s d -dimensional Hilbert curve. Lawder’s algorithm exploitsthe properties of the binary reflected Gray code when using bitwise exclusive-or operations to translatebetween one-dimensional and d -dimensional coordinates in binary representation. For a traversal τ , we call τ + (0) and τ − (1) the entrance gate and the exit gate ofthe traversal. A gate is a vertex gate , an edge gate , or a facet gate , respectively, if, among all faces of theunit cube, the lowest-dimensional face that contains the gate is a vertex, an edge, or a ( d − vertex-gated : both of its gates are vertex gates. An edge-gated variant has appeared in the literature and was found to have better locality-preserving propertiesaccording to some metrics, but that curve is not self-similar [18, 21, 42, 45]. In three dimensions, wemay consider the possibilities of vertex-gated, edge-gated, and facet-gated curves (where both gates arevertex gates, edge gates, or facet gates, respectively), and vertex-edge-gated, vertex-facet-gated, and edge-facet-gated curves (where the two gates have the two different types mentioned). I am not aware of anyadvantages of disadvantages of specific gate types for any practical purpose, but, as we will see later,case distinctions by gate type will be very useful in analysing what three-dimensional Hilbert curves existand what other properties they have. Being edge-crossing.
We say a traversal is edge-, facet-, or cube-crossing , respectively, if, amongall faces of the unit cube, the lowest-dimensional face that contains both gates is an edge, a ( d − Being centred.
We say a curve τ is centred if τ (1 / d -dimensional cube. We say a self-similar traversal is order-preserving if it can be defined withoutreversals, that is, χ i ( t ) = t for all i ∈ { , ..., d } .Order-preserving curves are arguably less complicated to understand and use (but not necessarilymore efficient) than curves that contain reversals. Existing literature on space-filling curves tends to allow(use) or disallow reversal without discussing it. Alber and Niedermeier only considered order-preservingcurves in their work on higher-dimensional Hilbert curves [2]. Asano et al. [3] and Wierum [42] implicitlyused reversal in the description of their (non-self-similar) two-dimensional quadrant-based curves.Note that if a traversal is symmetric, the reversed curve cannot be distinguished from a suitablyrotated and/or reflected, non-reversed copy. Therefore one can choose to define the transformations in13he octants with only the symmetries of the cube and no reversals. Thus, symmetric traversals are alwaysorder-preserving. Isotropy.
We say a face-continuous Hilbert curve, that is, a Hilbert curve whose approximating curves A k have only axis-parallel edges, is edge-isotropic if, in the limit as k goes to infinity, there is an equalnumber of edges of A k parallel to each axis [22]. We say a, not necessarily face-continuous, traversal is pattern-isotropic if, in the limit as k goes to infinity, each transformation of the base pattern, moduloreversal, occurs equally often among the transformations in the 2 kd subcubes of the unit cube. (Clearly,for face-continuous curves, pattern-isotropy implies edge-isotropy.)Note that we do not take the direction in which the pattern is traversed into account. For edge-isotropy, this would not make a difference: as k goes to infinity, the net amount of travel in the directionof each axis, relative to the total length of A k , approaches zero; therefore, parallel to each axis, theremust be an equal number of edges in each direction. For pattern-isotropy, if we would take the directioninto account, the two-dimensional Hilbert curve would not qualify. For example, the two-dimensionalHilbert curve traverses some squares from the bottom left to the top left corner, but never from the topleft corner to the bottom left corner.Isotropy, like fairness [29], may be instrumental in ensuring that the performance of applications thatorder objects along a space-filling curve does not depend on the orientation of patterns in the data,since an isotropic or fair space-filling curve does not favour any particular orientation. Moon et al. [30]proved that the two-dimensional Hilbert curve, along with certain generalizations to higher dimensions,is edge-isotropic.Note that we have not defined edge-isotropy for non-face-continuous curves. This would requiredealing with a number of subtleties and it is not a priori clear what it is the most meaningful way todo so. Shifting coordinates.
We call a signed permutation Π i that encodes a transformation γ i a shift if thepermutation, without the signs, is either the identity permutation or a rotation in the permutation-senseof the word. In other words, P i is a shift if and only if, for all j ∈ { , ..., d } , we have | π i [ j ] | = | π i [ d ] | + j (mod d ). We say a self-similar traversal is coordinate-shifting if it can be defined in such a way that, forall i ∈ { , ..., d } , the signed permutation Π i that defines γ i is a shift.Implementations of higher-dimensional Hilbert curves, such as Butz’s [8, 24, 31], often exploit thisproperty to avoid having to code for arbitrary permutations of the coordinates. Standing
We say a self-similar traversal is standing if it can be defined in such a way that, for fixed m, n ∈ { , ..., d } and for all i ∈ { , ..., d } , the signed permutation that encodes the transformations γ i ,without the signs, is either the identity permutation or swaps only the m -th and the n -th coordinate.Note that in two dimensions, any traversal is, trivially, both coordinate-shifting and standing, but inthree or more dimensions, these two properties are mutually exclusive.Similar to coordinate-shifting traversals, standing traversals may be easier to employ efficiently be-cause an implementation does not need to be capable of handling all d ! possible permutations of thecoordinate axes. The term “standing” derives from the fact that such curves can be drawn in a way thatkeeps the third coordinate vertical. The space-filling curves discussed in this article are, by construction, measure-preserving : the d -dimensionalvolume of the image of an interval [ a, b ] under a traversal τ is equal to the length of the interval, that is, In general, edges in approximating curves can have 13 different (unsigned) orientations: 3 orientations parallel to thecoordinate axes; 6 orientations parallel to facet diagonals; and 4 orientations parallel to interior diagonals. What conditionswould we impose on the relations between the frequency of edges in each orientation? One solution could be to considerthe three groups of edges separately, depending on whether edges are parallel to edges, facet diagonals or interior diagonalsof the unit cube. Taking the direction of the traversal into account can now make a difference. Furthermore, as observedin Section 2.4, edges may change orientation from one level or refinement to the next. Thus, in the approximating curves, similarities between sections remain recognizable if edges in the horizontal mn -planeare drawn in a different style as compared to edges that travel in the third dimension, for example, gangways versus stairs,as in Figure 10. Cd00.ct.7h ) with the edges of the third-order approximating curve drawn as gangways and stairs. Left:view from the outside. Right: view inside. Colour pictures and more examples are available from theauthor’s website at http://spacefillingcurves.net/. b − a . Such space-filling curves tend to have locality-preserving properties: points that are close to eachother along the traversal, that is, in the domain of τ , tend to be close to each other in d -dimensionalspace, that is, in the image of τ , and vice versa. Many authors have worked on quantifying the locality-preserving properties of space-filling curves in general, and the Hilbert curve and its generalizations tohigher dimensions in particular.More specifically, some authors have studied bounds on the (worst-case or average) distance betweentwo points in d -dimensional space as a function of their distance along the curve [9, 10, 13, 34, 35]. Thesestudies have been motivated by, among others, applications to load balancing in parallel computing.Other metrics consider the shapes of curve sections: I and other researchers have tried to calculatebounds on the (worst-case or average) perimeter, diameter, or bounding-box size of sections of the curveas a function of the volume of the curve section [18, 21, 42], again motivated by applications to loadbalancing or to the organization of spatial data in external memory.To define such metrics more precisely, we need the following definitions. Given two points p and q in the unit cube, let δ i ( p, q ) be the L i -distance between p and q . Given a Hilbert curve τ and twopoints a and b in the unit interval, let C ( a, b ) = (cid:83) bt = a τ ( t ) be the set of points that appear on the curvebetween τ ( a ) and τ ( b ). Given a set S of d -dimensional points, let vol( S ), diam i ( S ), bbox( S ), bball i ( S ),and surface( S ) be the volume, L i -diameter, the minimum axis-parallel bounding box, the minimumbounding L i -ball, and the ( d − S , respectively. Wecan now define the following quality measures of a d -dimensional space-filling curve, where in each case,the maximum is taken over all pairs a, b ∈ [0 ,
1] with a ≤ b : • L i -dilation or WL i (for i ∈ { , , ∞} ): the maximum of δ i ( τ ( a ) , τ ( b )) d / ( b − a ); • L i -diameter ratio or WD i (for i ∈ { , , ∞} ): the maximum of diam i ( C ( a, b )) d / ( b − a ); • L i -bounding ball ratio or WBB i (for i ∈ { , , ∞} ): the maximum of vol(bball i ( C ( a, b ))) / ( b − a ); • surface ratio or WS: the maximum of (surface( C ( a, b )) / d ) d/ ( d − / ( b − a ); • bounding-box volume ratio or WBV: the maximum of vol(bbox( C ( a, b ))) / ( b − a ); • bounding-box surface ratio or WBS: the maximum of (surface(bbox( C ( a, b ))) / d ) d/ ( d − / ( b − a ).In fact, the L i -dilation and the L i -diameter ratio of a space-filling curve are equal for any i , and the L ∞ -diameter ratio and the L ∞ -bounding ball ratio are always equal as well (for proofs, see Appendix C).15 conjecture that the same holds for the L -diameter ratio and the L -bounding ball ratio, but I canprove this only for two-dimensional space-filling curves (see Appendix C) and I have not found a prooffor three-dimensional space-filling curves.In a previous publication on two-dimensional space-filling curves we described algorithms to computebounds on WL i , WBV, and WBS for any given curve [18]. We have also implemented higher-dimensionalversions of these algorithms, including an algorithm to compute WS [40], and used these algorithms toanalyse the curves discussed in the next sections of this article. I will present the results in Section 7.3.Note, however, that it is not really clear how meaningful differences between curves on metrics of locality-preservation are, as the metrics tend to be the result of formalizing a much simplified account of whatmay be relevant for applications. Moreover, in practice, metrics that consider averages rather than worstcases may be more relevant, but average-case metrics are non-trivial to define [18] and tend to be muchmore difficult to compute efficiently and accurately for large numbers of curves [40]. Nevertheless, if wecan establish that a possible three-dimensional Hilbert curve is particularly good (or bad) according tosome metric of locality-preservation, then, it is, of course, an interesting curve to study: we may want toinspect such curves to see what qualitative properties of their structure cause it to perform so well (orbadly) according to these metrics.Other types of locality-preservation metrics studied in the literature include bounds on the averagedistance between points along the curve as a function of their distance in d -dimensional space [11, 28,43, 45]. However, non-trivial worst-case bounds are not possible in this case: there will always be pairsof points that are very close to each other in d -dimensional space but very far apart along the curve [13].Mokbel et al. define metrics that capture to what extent a traversal differs from sorting points in ascendingorder by one coordinate, and how these differences are distributed over the d coordinates [29]. One mayalso consider the number of contiguous sections of the curve that are needed to adequately cover any givenquery window in the unit cube [3, 17, 30, 44]. As I established through Observation 3 and Theorem 9in my previous work on this topic [17], if the query window is a cube, seven or eight sections of anythree-dimensional Hilbert curve are sufficient and in the worst-case necessary for an approximate cover.An exact cover requires an unbounded number of curve sections in the worst case, unless one assumesthe query range to be aligned with the grid of 2 kd subcubes at a particular depth k [30, 44]. Either way,it is questionable whether these worst-case metrics of cover quality capture the differences between thecurves within the scope of this article well. Attempts at average-case analysis [17, 30, 44] suggest thatwhat really matters are the orientations of the edges of the approximating curves: axis-parallel edges,modelling face-continuous curves, are good; curves with diagonal edges may be less good. In this section I will further justify the choice of octant-based self-similarity as the property that distin-guishes three-dimensional Hilbert curves from other space-filling curves. In other words, this section isabout why I use the label “Hilbert curve” in the way I do. The reader who is convinced already thatthe octant-based self-similar space-filling curves are a category of space-filling curves worth studying andwho does not care too much about what to call them, may prefer to skip this section.I considered three ways of generalizing the definition of Hilbert’s space-filling curve to three dimen-sions: (i) face-continuous octant-based space-filling curves; (ii) vertex-gated, face-continuous, octant-based space-filling curves; (iii) self-similar octant-based space-filling curves. (i) Face-continuous octant-based space-filling curves
In the article in which Hilbert presents hiscontinuous traversal of a square, Hilbert describes it as following a recursive subdivision into quadrants,and writes that each square along the curve should share an edge with the previous square . Face-continuity is a possible generalization of the latter condition to higher dimensions. However, note thatit is not enough to unambiguously define the two-dimensional Hilbert curve as we know it. If all werequire is that the curve be face-continuous and quadrant-based, then, in every refinement step, we canchoose any of the subsquares of the starting square from the previous level as our new starting square.Wierum’s β Ω-curve [42] would qualify as a Hilbert curve, along with an infinite number of other curves,in two-dimensional space already. “die Reihenfolge der Quadrate [ist] so zu w¨ahlen [], dass jedes folgende Quadrat sich mit einer Seite an das vorhergehendeanlehnt.” [20] ii) Vertex-gated, face-continuous, octant-based space-filling curves To disambiguate the def-inition of Hilbert’s two-dimensional curve, we could add the condition that the curve be vertex-gated.Thus, the two-dimensional Hilbert curve is uniquely defined (see Theorem 2 in Section 4). As we willdiscuss in Section 9, in three dimensions, infinitely many curves would qualify. (iii) Self-similar octant-based space-filling curves
Another way to disambiguate the definition ofHilbert’s two-dimensional curve is to require that the curve be self-similar. This condition, together withthe requirement that the traversal is quadrant-based and that each square touches the previous square inat least a vertex , is enough to uniquely determine the two-dimensional Hilbert curve (see Theorem 1 inSection 4). The main message of Peano’s and Hilbert’s publications was that, surprisingly at the time,there are continuous surjective mappings from one- to higher-dimensional space. Assuming that Hilbertindeed intended to define a self-similar traversal that visits the square quadrant by quadrant, Hilberthad to include a condition that would narrow the scope to the only continuous traversal of this type.For that purpose, in the two-dimensional setting, it did not matter whether he required that each squareshare at least a vertex with the previous one, or an edge: there is only one solution. However, in threedimensions it makes a difference. Given the context, we may understand the shared-edges conditionmerely as Hilbert’s instruction to ensure continuity at all, not specifically face-continuity, and thereforewe generalize it to higher dimensions by requiring that consecutive cubes always share at least one vertex.Given these three options, in this article we choose the third one: we define a three-dimensionalHilbert curve as a self-similar, continuous, octant-by-octant traversal. The restriction to self-similarcurves ensures compact descriptions that allow for efficient analysis of the curves and effective use insoftware. By avoiding the other options’ restrictions to face-continuous (and possibly vertex-gated)curves, we can discover interesting curves that we would have missed otherwise.
The one-dimensional Hilbert curve
With the essential properties as we define them, the one-dimensional Hilbert curve is also well-defined as the only self-similar, continuous, half-by-half traversal(modulo reversal): it is simply the curve τ : [0 , → [0 ,
1] defined by τ ( t ) = t , traversing the unit linesegment from one end to the other. In this section we prove that the two-dimensional Hilbert curve is a) the only quadrant-wise self-similarspace-filling curve, and b) the only quadrant-wise face-continuous vertex-gated space-filling curve.
Theorem 1
The quadrant-wise self-similar square-filling curve is unique.
Proof: To prove the theorem, we consider all combinations of gates τ (0) and τ (1) that could be considered:(i) vertex gates at opposite ends of the same edge;(ii) vertex gates at opposite ends of a diagonal;(iii) one edge gate and one vertex gate at the end of the same edge;(iv) one edge gate and one vertex gate that does not lie on the same edge;(v) two edge gates on adjacent edges;(vi) two edge gates on opposite edges.We analyze these cases one by one. In all cases, we try to follow the curve through the four quadrants,assuming, without loss of generality, that we start in the lower left quadrant. The various cases areillustrated in Figure 11. 17 i) (ii) (iii) (iv) (v) OK! (vi)
Figure 11: This figure shows, for each of the six possible combinations of gate types for a square-filling curve, what sequences of gates between the quadrants we could realize assuming that the curve isquadrantwise self-similar. Solid arrows indicate a feasible sequence. Dashed arrows indicate dead endsleading to a point where we cannot connect to the next quadrant (either because the point is not incidenton any other quadrant, or because it is only incident on the quadrant that must be the last to be visitedbut other unvisited quadrants remain). Hollow arrows lead to an exit gate of the fourth quadrant thatis not consistent with the exit gate of the complete curve, under the assumptions of the case.(i)
Vertex gates at opposite ends of the same edge.
Without loss of generality, assume the gates are located in the lower left and the lower rightquadrant, so the lower left quadrant is the first to be traversed, and the lower right quadrant isthe last to be traversed. We enter the lower left quadrant in the lower left corner, so we must leaveit either through its lower right corner (in the middle of the bottom edge of the unit square) orthrough its upper left corner (in the middle of the left edge of the unit square). In the first casewe would immediately enter the lower right quadrant, but this contradicts the assumption thatthis is the last quadrant to be traversed. So the only eligible case is the second case: we leave thelower left quadrant through its upper left corner in the middle of the left edge of the unit square.There we enter the upper left quadrant, which we must then leave through its lower right corner(the centre point of the unit square) in order to be able to connect to the third quadrant. Thismust then be the upper right quadrant (since the lower right quadrant must be the last), which weleave in its lower right corner in the middle of the right edge of the unit square, where we connectto the lower right quadrant. Thus, the locations of the entrance and exit gates of all quadrants areunambiguously determined by the locations of the entrance and the exit gate of the unit square. Byinduction, it follows that the complete curve is uniquely determined by the choice of the edge thatcontains the gates—leading to four curves that are all equal modulo isometric transformations.(ii)
Vertex gates at opposite ends of a diagonal.
We enter the lower left quadrant in the lower left corner, and leave it at its upper right corner,which is the centre of the unit square. Now, no matter which quadrant we traverse next, we mustenter it at the centre of the unit square and leave it at a corner of the unit square. But there, thereis no third quadrant to enter. Hence, with vertex gates at opposite ends of a diagonal, we cannotconstruct a self-similar curve.(iii)
One vertex gate and one edge gate on an incident edge.
We enter the lower left quadrant in the lower left corner. Then we must leave it in the interior ofeither its bottom or its left edge. But there is no second quadrant to enter there. Hence, with thiscombination of gates, we cannot construct a self-similar curve.(iv)
One vertex gate and one edge gate on a non-incident edge.
We enter the lower left quadrant in the lower left corner. Without loss of generality, assume weleave it through its top edge. Then the second quadrant must be the upper left quadrant, which weenter at its bottom edge, and leave at its top left or top right corner. At the top left corner, thereis no third quadrant to connect to, so we must leave the second quadrant at its top right corner,and enter the upper right quadrant there. We leave through the bottom edge, entering the lowerright and last quadrant, which we must then leave either at its bottom left or its bottom rightvertex. But those points lie on an edge of the unit square that is incident to the entrance gate inthe lower left corner, which contradicts the conditions of this case. Hence, with this combinationof gates, we cannot construct a self-similar curve.(v)
Two edge gates on adjacent edges.
If the gates lie on adjacent, that is, orthogonal edges, then the orientations of the edges containing18 a) (b) C i, C i +1 , C i +1 C i (c) C i, C i +1 , C i +1 C i Figure 12: (a) The base pattern of any quadrant-by-quadrant, face-continuous curve. (b,c) The courseof A k within a ( k − C i is uniquely determined by the k -level square C i, where thecurve enters C i , and the location of the next ( k − C i +1 . The shaded squares are X and Y , that is, the subsquares of C i that are adjacent to C i +1 .the gates must alternate as we follow the curve from the entrance gate of the first octant to theexit gate of the last octant. But then the exit gate of the last octant lies on an edge of the sameorientation as the entrance gate of the first octant, which contradicts the assumption that the gatesof the unit cube lie on edges of different orientations. Hence, with this combination of gates, wecannot construct a self-similar curve.(vi) Two edge gates on opposite edges.
If the gates lie on opposite, that is, parallel edges, no curve can cross both the horizontal and thevertical centre line of the cube to reach the top right quadrant. Hence, with this combination ofgates, we cannot construct a self-similar curve.Thus, the only case that works out, is case (i), and it does so in a unique way. (cid:117)(cid:116)
The conditions of Theorem 1 constitute a minimal set that uniquely defines the Hilbert curve. Ifwe drop any of the conditions, there are other traversals that fulfill the remaining conditions: Peano’scurve [36] is a self-similar square-filling curve that is not quadrant-based; Wierum’s β Ω-curve [42] isa quadrant-based square-filling curve that is not self-similar; the Z-order traversal [33] constitutes aquadrant-wise self-similar square-filling traversal that is not a curve (it is discontinuous) . Theorem 2
The quadrant-based face-continuous vertex-gated space-filling curve is unique.
Proof: A face-continuous quadrant-wise space-filling curve must traverse the squares of any grid of 2 k times 2 k squares one by one, such that each square (except the first) shares an edge with the previoussquare. Otherwise the curve would contain a section that fills two squares that are consecutive along thecurve but do not share an edge: such a section would have a disconnected interior, and thus the curvewould not be face-continuous. In particular, this means that A must have the familiar Π-shape (seeFigure 12a), modulo reflection and rotation.Furthermore, given the order in which the squares of a 2 k − by 2 k − grid are traversed, for k ≥
2, the k -th order approximating curve A k is uniquely determined as follows. Let C , ..., C k − be the squaresof the 2 k − by 2 k − grid, in the order in which they are visited. The first subsquare of C must be theone in the corner of the unit cube. Now let, for any i , the first subsquare of C i be given as C i, , and letthe two subsquares of C i that touch C i +1 be labelled X and Y . If C i, is X or Y , then we must put theΠ-pattern inside C i such that it starts at C i, and ends at Y or X , respectively, to be able to make theconnection to C i +1 (see Figure 12b). Otherwise, we must put the Π-pattern in C i such that it starts at C i, and ends at the unique square out of X and Y that shares an edge with C i, (Figure 12c). The firstsubsquare of C i +1 must now be the one that shares an edge with the last subsquare of C i . Thus, thecourse of A k through C , ..., C k − − follows by induction. The rotation or reflection of the Π-patterninside C k − follows from the requirement that we end in the corner of the unit cube. This is alwayspossible, since we enter C k − in another subsquare, which, by a simple parity argument, can be shownto be adjacent to the corner subsquare. (cid:117)(cid:116) Alternatively, the Z-order traversal can be modelled as a curve by including straight line segments to bridge thediscontinuities, as in Lebesgue’s space-filling curve [26]. However, then it does not comply with our framework of quadrant-based traversals as described in Section 2. In other words, we can model Z-order as a curve but then it is not measure-preserving and not strictly quadrant-by-quadrant, or we can model Z-order as a measure-preserving quadrant-by-quadranttraversal, but then it is discontinuous. W -curve [3]is a quadrant-based vertex-gated space-filling curve that is not face-continuous; and Wierum’s β Ω-curve[42] is a quadrant-based face-continuous space-filling curve that is not vertex-gated.
A three-dimensional self-similar, octant-based traversal is defined by the order in which the octants arevisited, together with the transformations in each of the octants. As we saw in Section 2.3, each suchtraversal is defined by a string of at most 45 numbers from { , − , , − , , − } , 8 opening brackets(rectangular or curly) and 8 complementary brackets (rectangular or curly). Thus, there can be only afinite number of such traversals. However, enumerating them by simply trying all possible permutationsof the octants, together with all possible combinations of reflections, rotations and reversals in the octants(note that there are 2 d · d ! · partition , that is, which octants lie inthe first half of the traversal and which octants lie in the second half. On the next level, we specify the base pattern , that is, in which order the octants in each half are visited. On the third level, we specify thelocations of the entrance and exit gates of the curve. On the fourth level, we specify the gate sequence ,that is, the locations of the entrance gates (first points visited) and exit gates (last points visited) of alloctants. On the fifth level, we specify the remaining details of the transformations of the curve withinthe octants. This generalizes the approach taken by Alber and Niedermeier [2], who effectively considerthe second, fourth and fifth level of detail. However, they encoded only the 920 face-continuous, vertex-gated, order-preserving curves , whereas we will encode 10,694,807 different curves, as we will see later.We need to make the descriptions of each level much more powerful than in their work to allow us todescribe curves that are not face-continuous, not vertex-gated and/or not order-preserving effectively.Recall that we consider curves that can be transformed into each other by rotation, reflection, trans-lation, scaling or reversal to be equivalent. We will set up our naming scheme such that we give a uniquename to exactly one curve of each equivalence class.Our five-stage approach allows us to enumerate curves by generating them with increasing amount ofdetail. We will see that when we get to the third level, there are only a limited number (a few hundred)possibilities. For each choice for a third-level specification, we can generate all feasible gate sequences,making sure that every triple of an octant with its entrance gate and its exit gate can be obtained byat least one transformation of the unit cube with its entrance and exit gates, and each octant’s entrancegate matches the previous octant’s exit gate. Then, for each possible gate sequence, we can enumerateall options for filling in the remaining details of the curve: these options consist in all combinations ofindependent choices for which transformation to use in which octant, out of all transformations that mapthe gates of the unit cube to the gates of the octants. In general, our curve names follow the pattern
P cmn.gh.st.op.qr . In this pattern, P is a uppercaseletter specifying the partition, m and n are hexadecimal digits specifying the order of octants withineach half; c is a lowercase letter specifying how the two halves fit together, and thus, P cmn encodes thebase pattern. Next are two letters g and h , specifying the location of the gates τ (0) and τ (1), and twohexadecimal digits s and t , specifying the locations of the gates between the octants. Thus, P cmn.gh.st encodes a gate sequence. The remaining digits, op.qr , specify the transformations within the octants. Alber and Niedermeier counted 1 536 curves with these properties, since they counted some curves twice which weconsider to be equivalent: see Footnote 13 in Section 9 for details. I T X
12 1100 L C J
13 1101 Z h P
10 1010
14 1110 b E
11 1011 d
15 1111 Table 2: Possible combinations of octants visited by the first half of a traversalsymbol octants (w.l.o.g.) symbol octants (w.l.o.g.) C (cid:16) − − − (cid:17) (cid:16) +1 − − (cid:17) (cid:16) +1+1 − (cid:17) (cid:16) − − (cid:17) S (cid:16) − − − (cid:17) (cid:16) +1 − − (cid:17) (cid:16) +1+1 − (cid:17) (cid:16) +1+1+1 (cid:17) L (cid:16) − − − (cid:17) (cid:16) +1 − − (cid:17) (cid:16) − (cid:17) (cid:16) +1+1 − (cid:17) X (cid:16) − − − (cid:17) (cid:16) +1+1 − (cid:17) (cid:16) − (cid:17) (cid:16) +1 − (cid:17) N (cid:16) − − − (cid:17) (cid:16) +1 − − (cid:17) (cid:16) +1+1+1 (cid:17) (cid:16) − (cid:17) Y (cid:16) − − − (cid:17) (cid:16) +1 − − (cid:17) (cid:16) +1+1 − (cid:17) (cid:16) +1 − (cid:17) Many curves have shorter names: depending on the gate sequence, the number of digits actually used tospecify the transformations within the octants can be zero, two or four.The first symbol in each pair ( m, g, s, o, q ) concerns the first half in the curve; the second symbol ineach pair ( n, h, t, p, r ) concerns the second half. This is implemented such that a name that follows thepattern
P cmm.gg.ss.oo.qq describes a curve of which the first and the second half are the same, moduloa transformation which is effectively encoded by c . As we will see later, the second-last pair of digits, oo , is redundant for such curves and therefore, for a symmetric curve, we may use a condensed form ofthe name that follows the pattern P cmm.gsq .Hexadecimal digits (represented by s, t, o, p, q and r in the aforementioned patterns) are used tospecify gates or transformations within one half of the curve. Typically these hexadecimal digits arisefrom encoding one bit of information per octant, which results in a number that is actually better read asa binary number rather than a hexadecimal number. Therefore, for hexadecimal digits we use symbolsthat are reminiscent of their binary equivalents, as displayed in Table 1. The four bits of a hexadecimaldigit, in order from most significant to least significant (first encoded octant to last encoded octant) arerepresented by the absence (0) or the presence (1) of, respectively, a vertical stroke on the right, a highhorizontal stroke, a horizontal stroke in the centre, and a low horizontal stroke. If the first bit is zero,there is a vertical stroke on the left. In practice, we approximate the shapes thus composed by standardletters and digits as shown in Table 1.In the following sections, we will describe the details of our curve naming scheme level by level. A base pattern is identified by a string of four symbols
P cmn . I will first describe what values thesesymbols can have and how to interpret them. After that, we will discuss how each possible base patternhas a unique name.
Decoding a base pattern identifier
The first symbol P is one of { C , L , N , S , X , Y } and indicates whichfour octants are traversed by the first half of the curve. The six possibilities are described in Figure 13(first row) and Table 2. In the table, a vector (cid:16) xyz (cid:17) represents the octant that includes the unit cubevertex ( x/ , y/ , z/ c is a lower-case letter that specifies a rotary reflection that is a symmetry of theunit cube and maps the set of octants in the first half of the traversal to the set of octants in the secondhalf of the traversal. Thus, we also get a standard order for the traversal of the octants in the secondhalf of the curve. The possible values for c and the corresponding symmetries are listed in Table 3: each21 L N S X YCa Cd Ce Ck Cl Co CuCa00 Ca01 Ca02 Ca11 Ca12 Ca22
Figure 13: Encoding of base patterns. First row: the six options for the set of octants in the first half ofthe traversal. Second row: the standard order in which these octants are traversed. Third row: the sevenways in which a standard order for the second half of a C-pattern can be obtained by a transformationof the first half. Fourth row: six examples of how the final octant order is obtained by permuting thetraversal order in the first and the second half, and finally reversing the second half.Table 3: Encoding of the symmetries of the unit cubesymbol symmetry a [ 1, 2,-3] reflection in plane orthogonal to 3rd coordinate axis b [ 1,-2, 3] reflection in plane orthogonal to 2nd coordinate axis c [-1, 2, 3] reflection in plane orthogonal to 1st coordinate axis d [ 1,-2,-3] 180 degrees’ rotation around line parallel to 1st coordinate axis e [-1, 2,-3] 180 degrees’ rotation around line parallel to 2nd coordinate axis g [-1, 3, 2] 180 degrees’ rotation around line through edge midpoints (0 , − , −
1) and (0 , , h [-1,-3,-2] 180 degrees’ rotation around line through edge midpoints (0 , − ,
1) and (0 , , − i [ 3,-2, 1] 180 degrees’ rotation around line through edge midpoints ( − , , −
1) and (1 , , j [-3,-2,-1] 180 degrees’ rotation around line through edge midpoints ( − , ,
1) and (1 , , − k [ 2, 1,-3] 180 degrees’ rotation around line through edge midpoints ( − , − ,
0) and (1 , , l [-2,-1,-3] 180 degrees’ rotation around line through edge midpoints ( − , ,
0) and (1 , − , o [-1,-2,-3] point reflection with respect to the centre of the cube q [ 1, 3,-2] 90 degrees’ rotation around line parallel to 1st coordinate axis r [ 3, 2,-1] 90 degrees’ rotation around line parallel to 2nd coordinate axis s [ 2,-1, 3] 90 degrees’ rotation around line parallel to 3rd coordinate axis u [ 2,-1,-3] a combined with sw [-3,-1,-2] reflection combined with 120 degrees’ rotation around interior diagonal x [ 3,-1, 2] reflection combined with 120 degrees’ rotation around interior diagonal y [-3, 1, 2] reflection combined with 120 degrees’ rotation around interior diagonal z [ 3, 1,-2] reflection combined with 120 degrees’ rotation around interior diagonal22able 4: Encoding of permutations of octants in one half of a traversalsymbol traversal order symbol traversal order symbol traversal order c d e a b m , in the name of a base pattern indicates the permutation of the octants withinthe first half of the pattern. The default is that the first four octants, as encoded by the first symbol, arevisited in the order indicated in the last column of Table 2 and the second row of Figure 2. Other ordersare indicated by a pentadecimal number according to Table 4. For example, if a name of a base patternstarts with Se9 , then the first four octants are the 2nd, 3rd, 4th, and 1st from those listed with S in Ta-ble 2, so, the first four octants, in order, are those with vertex coordinates (+1 , − , − (+1 , +1 , − (+1 , +1 , +1), and ( − , − , − P , applying the transformation specified by c , followed by thepermutation specified by n , and finally reversing the order.The fourth row of Figure 13 shows several examples. Note that the approximating curve of basepattern Ca00 is the curve G (3) (see Section 3.2), and thus, Ca00 identifies the base pattern of well-foldedcurves.
Selecting a unique name for each base pattern
The previous discussion of how to decode a basepattern name may raise two questions. First, for some base patterns there may be multiple ways toencode them: how do we select a unique name for a pattern, so that patterns that are equivalent moduloreflections, rotations and/or reversal get the same name? Second, can we give a name to each possiblebase pattern in this way?To deal with the first question, we restrict the names of base patterns to those that are implicitlylisted in Table 5. A base pattern name is valid if it meets the following three conditions: • the transformation c should be listed in the second column in the row for partition P ; • the permutations m and n should be listed in the third column in the row for partition P ; • if c is lexicographically smaller than ’ p ’, then m ≤ n .To understand why this gives us a unique name for each equivalence class of base patterns, thefollowing observations are helpful.First, up to rotation and reflection, there are indeed exactly six possibilities for how octants can bedivided between the first half and the second half of the traversal, as listed in Table 2. The possibilitiescan easily be analysed by distinguishing between three cases: (i) there is a plane that separates the firsthalf from the other (type C ); (ii) there is a plane that separates three octants in the first half from thefourth (types L , S , and Y ); (iii) any axis-parallel plane through the centre of the cube has two octantsfrom each half on each side (types N and X ). Henceforth, we assume any base pattern or traversal isrotated and/or reflected such that the first four octants have the coordinates as indicated in the table,where coordinates (cid:16) xyz (cid:17) indicate the octant that includes the unit cube vertex ( x/ , y/ , z/ Cu or Yz .partition transformations permutations number of patternssymmetric asymmetric C adeklou 012
18 27
L al 012345678cde
24 132
N ae 012345
12 30
S ei 0123456789ab
24 132
X abcghijkloqrswxyz 0
10 7
Y hikoz 0236
16 40total 104 368Second, each of the sets identified by C , L , N , S , X and Y has certain symmetries in itself. This limits thenumber of permutations we need to encode with the third symbol of the base pattern name. For example,for S -patterns, we only need to encode permutations that start with the first or the second octant in theset—if we would want to start with the third or the fourth octant, we would instead apply the rotaryreflection [ − , − , −
1] to the whole pattern, so that we swap the first and the second octant with thefourth and the third octant, respectively. Thus, for S -patterns, the third symbol can be restricted to therange { , ..., b } . By a similar argument, the values of the fourth symbol are restricted in the same way:any permutation outside the given range can always be obtained by combining a permutation within thegiven range with a rotary reflection of the second half of the pattern—in effect changing the choice of thetransformation encoded by the second symbol. As indicated in Table 2, the required set of permutationsis different for each partition, because it depends on the geometric arrangement of the octants withinone half.Third, if the transformation specified by the second symbol c is symmetric (that is, equal to itsown inverse), then applying it to the base pattern P cmn and reversing the order results in the basepattern
P cnm . Thus, if n (cid:54) = m , then these are two different names for the same equivalence class of basepatterns. In that case we choose the lexicographically smallest name. Hence the third condition on basepattern names—note that among the transformations listed in Table 3, the symmetric transformationsare exactly those with a symbol lexicographically smaller than ’ p ’.Fourth, with the second symbol we only need to be able to specify a limited subset of the 48 symmetriesof the unit cube. This is because many symmetries of the unit cube do not map any of the sets C , L , N , S , X or Y to their complement, or they are redundant, because we could use another transformation todescribe a reversed and/or reflected version of the same base pattern. This is why only seven, not eightdifferent transformations are applied to partition C .Table 5 also lists the numbers of symmetric base patterns and the numbers of asymmetric basepatterns per row. Note that a pattern is symmetric if and only if the transformation that maps thefirst half to the second half is symmetric (that is, c ∈ { a , ..., o } ), and the first and the second half arepermuted in the same way (that is, m = n ).Appendix D explains an automated approach to verifying that the table is correct and complete,providing exactly one name for each equivalence class of base patterns. Figure 26 in Appendix E showsall base patterns that we found to be realizable by three-dimensional Hilbert curves. In our naming scheme, the encoding of the base pattern is followed by two symbols that encode theentrance and the exit gate, respectively. These symbols are given in Table 6. Note that the interpretationof the exit gate symbol is subject to the transformation that maps the octants in the first half of theorder to the octants in the second half (see Figure 14 for an example).Observe that we only encode the topological location of the gates, but not where exactly the edge and24able 6: Gate symbolssymbol intuition gate location c corner at vertex r radial on interior of edge parallel to 1st coordinate axis v vertical on interior of edge parallel to 2nd coordinate axis t transverse on interior of edge parallel to 3rd coordinate axis f front on face orthogonal to 1st coordinate axis g ground on face orthogonal to 2nd coordinate axis s side on face orthogonal to 3rd coordinate axis cr v tfgs c rv tf gs Figure 14: Encoding of possible gate locations for the entrance gate (open dots) and the exit gate (closeddots) of a curve with base pattern
Yz00 .facet gates are located on the respective edges and facets. In the following section, we will find that therealizable combinations of entrance and exit gates for the unit cube are actually fairly limited, enoughso that the topological location of the gates is sufficient to determine their exact location: • edge and facet gates in vertex-edge or vertex-facet gated curves are located at the midpoint of theedge or facet, respectively (Theorems 4 and 5); • edge gates in edge-gated curves are located at distance 1/3 from the closest endpoint of the edge(Lemma 1); • facet gates in facet-gated curves are located at distance 1/3 from two adjacent edges of the facet(Corollary 1); • edge-facet-gated curves do not exist (Theorem 7).If a curve is symmetric in the base pattern but not in the locations of the gates, then we encode thecurve in the direction that results in the name that comes first in lexicographical order. For example,we use Ca00.gs , not
Ca00.sg . To set up the fourth and fifth levels of our naming scheme, we need to distinguish a number of casesdepending on the locations of the entrance and exit gates, similar to the proof of Theorem 1. In thenext subsections we will discuss vertex-gated, vertex-edge-gated, vertex-facet-gated, edge-gated, edge-facet-gated, and facet-gated curves, respectively. In each subsection we will establish where exactly theentrance and exit gates must be located relative to each other, so that we can enumerate the correspondinggate sequences and the curves that implement them efficiently, and define an appropriate encoding.25 esults
In Section 6.1 we find that there are 178 gate sequences for vertex-gated curves. The symmetricplacement of the gates makes it possible to reflect and/or reverse the subcurves within the eight octantsindependently from each other. Thus, each gate sequence is realized by up to (2 · = 65 536 curves,some of which are equivalent, leading to a total of 10,691,008 different vertex-gated curves. These includeall face-continuous curves save one, all order-preserving curves, all symmetric curves, and many well-folded curves. The vast possibilities in shaping the octants allow us to construct a hyperorthogonalcurve, a maximally facet-harmonious curve, and many coordinate-shifting curves. However, none of thevertex-gated curves are centred or standing.The vertex-edge-gated curves, discussed in Section 6.2, are much more flexible with respect to theplacement of the connecting gates between the octants. They allow 2 758 gate sequences, but the positionsof the gates completely determine the transformations within the octants, so there is only one curve pergate sequence. Among them we find centred curves, well-folded curves, and standing curves. However,none of the vertex-edge-gated curves are face-continuous, order-preserving, symmetric, or coordinate-shifting.There is only one facet-gated curve (Section 6.6). It is face-continuous, well-folded, hyperorthogonal,and pattern-isotropic. It is of particular interest because it can be generalized to higher dimensions [6],and was found to have excellent locality-preserving properties (Section 7.3). One could view the curve asa three-dimensional version of the two-dimensional facet-gated (but non-self-similar) β Ω-curve [42], whichwas shown to have slightly better locality-preserving properties than the original Hilbert curve [18, 42,43, 45]. However, in three and more dimensions the construction is actually simpler, namely self-similar,using only generalized β -shapes and no Ω-shapes.The vertex-facet-gated curves are few (Section 6.3: 1,024 curves from 4 gate sequences), the edge-gated curves even fewer (Section 6.4: 16 curves), and I have not been able to identify any particularlyinteresting curves among them. Edge-facet-gated curves cannot be realized (Section 6.5).In total, we find that there are 10,694,807 different three-dimensional Hilbert curves. Terminology and notation
With each combination of entrance and exit gates, the fourth level, thegate sequence, is encoded with two hexadecimal digits after the third level. The first digit is for the firsthalf of the curve; the second digit is for the second half of the curve as seen from the other end—that is,the second digit is for the first half of the reversed curve under the inverse of the transformation encodedby the second symbol of the base pattern name. In each case the two halves will be encoded in the sameway. Therefore, in the following subsections, we will only describe how to encode the gates in the firsthalf of the curve as a four digits’ binary number, which is then written as a single hexadecimal digit.Typically, but not always, we use one bit per octant, in order of decreasing significance as we traversethe octants starting from the entrance gate. So the two hexadecimal digits, if written as eight binarydigits, from left to right, encode the first, second, third, fourth, eighth, seventh, sixth and fifth octant,in that order.In the cases in which the fifth level, concrete curves, needs one or two further pairs of digits, the sameprinciples apply: the first digit is for the first half of the curve, and we use one bit per octant, startingwith the most significant bit for the octant at the entrance or exit gate.The following subsections include a number of figures that sketch three-dimensional Hilbert curves.For each curve there are two diagrams (see, for example, Figure 15). The drawing on the left is anannotated drawing of the second-order approximating curve and defines the space-filling curve in theway described in Section 2.1. The drawing on the right is an exploded view of the eight octants thatclarifies the gate sequence. In the exploded views, bold solid lines connect the exit gate of an octant withthe entrance gate of the next octant—note that in the unexploded reality, these points coincide. Dashedlines connect the entrance gate of an octant with the exit gate of the same octant. For asymmetriccurves, open dots mark the octant gates that correspond to the entrance gate of the entire curve: anopen dot thus marks the exit or the entrance gate of an octant, depending on whether the transformationthat maps the entire curve to the curve within the octant involves reversal or not.Note that the curves are not always drawn with the same orientation of the coordinate system: someof the curves are rotated and/or reflected for a better view. For example, Figures 16d and 19c showcurves with the same base pattern
Cd00 , but one is rotated and reflected with respect to the other. Toclarify this, each figure includes a drawing that indicates the positive direction of each coordinate axis.Throughout the following subsections, given a traversal τ , we use g i to denote τ ( i/ i -th octant and the entrance gate of the ( i + 1)-st octant. Theorem 3
The gates of vertex-gated three-dimensional Hilbert curves are located at opposite ends ofeither an edge or a facet-diagonal of the cube.
Proof: The theorem only excludes the possibility of gates at opposite ends of an interior diagonal. Theproof that this is not possible is completely analogous to case (ii) in the proof of Theorem 1. (cid:117)(cid:116)
In other words, vertex-gated curves are either edge-crossing or facet-crossing, but not cube-crossing.Whether the curve is edge-crossing or facet-crossing, depends on whether the first and the last octant ofthe base pattern lie along the same edge of the unit cube, or only on the same facet.
With vertex-gated, edge-crossing curves, the locations of the gates are restricted bythe fact that they have to lie relative close to each other: subsequent gates must lie at opposite ends ofan octant edge. In particular, g is at a corner of the unit cube, g must be in the middle of the edgeof the unit cube that is shared by the first and the second octant, and g must be in the middle of thefacet of the unit cube that is shared by the second and third (and, necessarily, also the first) octant. Forthe first half of the curve, this leaves only g and g to be specified. The gate g must lie either in thecentre of the cube, or at the midpoint of the edge of the unit cube that is shared by the third and fourthoctant. The gate g must lie at the midpoint of a facet of the unit cube that is shared by the fourth andthe fifth octant.We keep the encoding of the first half of the traversal independent of the second half (which containsthe fifth octant), and choose the following solution for the first half: the first bit encodes g (0 if inthe centre; 1 if on an edge), the remaining three bits in order of decreasing significance give the threecoordinates of g in order of increasing index (for each coordinate: 0 if in the centre, 1 if not).For example, consider the gate sequence of the curve in Figure 15g, identified by P cmn.gh.st = Si00.cc.LT . First consider the first half of the curve. The gate g between the third and the fourthoctant is the centre of the cube, so the first bit is a zero. The gate g between fourth and the fifth octanthas coordinates (0 , , s = 0001 = L (see Table 1). Thegate g between the third-last (sixth) and the fourth-last (fifth) octant is also the centre of the cube,so the first bit of t is a zero. The gate g has coordinates (0 , , c = i = [3 , − ,
1] the coordinates are (1 , , t are 100. Thus t = 0100 = T .Gate sequences for vertex-gated, edge-crossing curves can easily be enumerated by exhaustive search:it turns out there are 29 such gate sequences, which realize 14 different base patterns. Among thesegate sequences are Ca00.cc.hh (Hil .A(b) from Alber and Niedermeier [2]), Ca00.cc.h4 (Hil .A(d)), Ca00.cc.TT (Hil .A(c)), Ca00.cc.44 (Hil .A(a)), and Si00.cc.LT (Hil .B(a), reversed, and Hil .B(b)).From the 29 gate sequences, 10 sequences are symmetric and 19 sequences are asymmetric. A full list isgiven in Appendix E, Table 11. Curves
To fully specify a vertex-gated curve, we need to specify how exactly the curve is transformedwithin each octant. For each octant C i , the locations of the gates are given by the gate sequence. Thisstill leaves two binary choices per octant. The first choice is whether to use a forward or a reverse copyof the curve, that is, whether to map the entrance gate of τ to g i − and the exit gate to g i , or the otherway around. The second choice is whether to use only rotation, scaling, translation and/or reversal tomap τ to τ [( i − / , i/ C i and contains both gates g i − and g i .We encode these choices by two pairs of hexadecimal digits following the name of the gate sequence.The general pattern of a curve name is then P cmn. cc .st.op.qr , where P cmn. cc .st identifies the gatesequence, o and p specify the reversals in the first and the second half of the curve, respectively, and q and r specify the reflections in the first and the second half, respectively. Reversals and reflections arespecified using one bit per octant. For the first half of the curve, 0 means non-reversed/non-reflected;27able 7: Interpretation of the reversal and reflection bits in the names of vertex-gated curves.reversal encoding reflection encoding0 1 0 1first half non-reversed reversed non-reflected reflectedsecond half, c maintains orientation reversed non-reversed non-reflected reflectedsecond half, c induces reflection reversed non-reversed reflected non-reflected1 means reversed/reflected. For the second half of the curve, the meaning of 0 and 1 is modified accordingto the transformation that is used in the base pattern encoding, see Table 7.For example, consider the curve Ca00.cc.44.hh.db in Figure 15c. The first reversal digit is ’ h ’, binary0010 (see Table 1), so among the first four octants, only the third octant is reversed—in correspondencewith the placement of the open dots in the figure. The second reversal digit is ’ h ’, binary 0010, but forthe second half of the curve, the meaning of 0 and 1 is flipped, as is the order of the bits. Thus, amongthe last four octants, the third- last octant is the only one that is not reversed. The digit ’ d ’, binary1011, tells us that that the curve is reflected in the first, third and fourth octant, but not in the secondoctant. The digit ’ b ’, binary 0011, should be interpreted with the meaning of 0 and 1 flipped (becausethe transformation a = [1 , , −
3] induces a reflection) and counting from the back, so the last and thesecond-last octant (corresponding to the zeros in 0011) are reflected, and the third-last and fourth-lastoctant (the ones in 0011) are not.Figure 15 shows several other examples of vertex-gated, edge-crossing curves. At first sight, most ofthe chosen examples may look very similar, but they each have unique properties that are not shared bythe other curves.
Assigning unique names to curves
If the gate sequence is symmetric then there is some redundancyin the encoding scheme that we just defined. Let
P cmm. cc .ss denote a symmetric gate sequence forvertex-gated, edge-crossing curves. To avoid an unnecessary case distinction, note that Table 11 inAppendix E tells us that c must denote the transformation a = [1 , , − x denote the bitwise complement of a hexadecimal digit x .First, observe that P a mm. cc .ss.op.qr and P a mm. cc .ss.po.rq now encode curves that are reversedand reflected copies of each other, and should therefore get the same name. In such cases we will onlyuse the lexicographically smallest name (interpreting digits by value, not by symbol).Second, note that for symmetric curves, the two binary choices per octant do not give us four, butonly two options per octant, because the curve equals its reversed reflection. Therefore we will not usereversal in the first half of the curve and not use non-reversal in the second half of the curve, and alwaysgive symmetric curves names of the form P a mm. cc .ss. II .qq (recall that I = 0000). Alternatively, wemay use the shorthand P a mm. c sq .It remains to filter out the names that employ reversal to encode a symmetric curve. Consider avertex-gated, edge-crossing curve that has a symmetric gate sequence and name P a mm. cc .ss.op.qr .Since transformation a induces a reflection, reversing the curve within an octant, that is, mapping τ (0) to g i and τ (1) to g i − , rather than the other way around, results in a reflection of the base pattern.Therefore, if we write xy to denote the digit that is obtained by applying the bitwise exclusive-or operationto the digits x and y in binary representation, then P a mm. cc .ss.op.qr and P a mm. cc .ss. II . oq pr are thesame with respect to the order in which the second-level subcubes are traversed. If oq = pr , then thatorder is symmetric, so the whole curve is symmetric, and P a mm. cc .ss. II . oq pq is its name. Conversely, P a mm. cc .ss.op.qr names an asymmetric curve if and only if P a mm. cc .ss.op.qr is lexicographicallysmaller than P a mm. cc .ss.po.rq and oq differs from pr . Counting the curves
As explained above, given the gate sequence, we need to make two binarychoices per octant, which makes 16 choices for the full curve. Thus we get 2 = 65 536 curves per gatesequence. However, if the gate sequence is symmetric, then the number of different curves is smaller.Symmetric curves have names ending in II followed by two identical digits: thus there are 16 suchcurves for each symmetric gate sequence. Asymmetric curves from symmetric gate sequences have 16choices for each of the digits, except that we need to exclude the choice for the last digit that results28a) Ca00.c4Z
Harmonious1 2 3 (b)
Ca00.c4I
Butz1 2 3 (c)
Ca00.cc.44.hh.db
Alfa1 2 3 (d)
Ca00.cT4
Sasburg1 2 3 (e)
Ca00.chI (f)
Ca00.cT7
Imposter1 2 3 (g)
Si00.cc.LT.I3.II (h)
Ca11.cTJ
Wind-folded1 2 3
Figure 15: Examples of vertex-gated, edge-crossing curves. (a) The Harmonious Hilbert curve, withmaximum facet-harmony. (b) Butz’s coordinate-shifting curve. (c) Alfa, the vertex-gated hyperorthogo-nal curve, which has excellent locality-preserving properties, in particular with respect to bounding boxesand L ∞ -dilation (see Section 7.3). (d) The Sasburg curve, a metasymmetric curve with optimal scoreon the worst-case surface ratio. (e) A realization of another symmetric gate sequence for face-continuouscurves. An asymmetric gate sequence Ca00.cc.h4 for face-continuous curves can be constructed bycombining the left half of the gate sequence in Figure e with the right half of the sequence in Figure b.(f) The Imposter curve, whose approximating curve A wrongfully suggests maximum facet-harmonyand palindromy. (g) A curve with full interior-diagonal harmony. (h) Another metasymmetric curve.in oq = pr , and we need to divide by two because we only keep the lexicographically smallest versionout of P a mm. cc .ss.op.qr and P a mm. cc .ss.po.rq . Thus there are 16 · · · / The entrance gate g must lie at a corner of the unit cube, so the coordinates of g sum up to (mod 1). By induction, one can now show that all gates g i for 0 ≤ i ≤ Se00.cT7
Pirouette32 1 (b)
Se66.cT3
Helix1 2 3 (c)
Cd11.cP4
21 3 (d)
Cd00.cPJ
21 3 (e)
Cu00.cc.4d.4d.Z7
Long-legs1 3 2 (f)
Ll36.cc.II.CC.J3
Big-cross32 1 (g)
Se33.c7T
Mosquito2 31 (h)
Ll36.cc.II.hT.33
Rough-edge32 1
Figure 16: Examples of vertex-gated, facet-crossing curves. (a,b,c,d) Metasymmetric curves with fullinterior-diagonal harmony. (e) An attempt to maximize the number of times four consecutive subcubes inthe 4 × × × × g i for 1 ≤ i ≤ g i , for 1 ≤ i ≤
7, must be the midpoint of a facet of the unit cube that is shared bythe i -th octant and the next.Note that none of the base patterns from Table 5 start with a pair of octants that only differ in thethird coordinate . Therefore, for g , there is never a choice between the midpoint of a facet orthogonalto the first coordinate axis and the midpoint of a facet orthogonal to the second coordinate axis: if thereis a choice, it is between the midpoint of a facet orthogonal to the third coordinate axis and the midpoint The first halves of the C , L , N , and X patterns do not even contain any pair of octants that only differ in the thirdcoordinate. In the first half of an S pattern, the third and fourth octant in the default order differ only in the thirdcoordinate, but no base pattern has a permutation of S that starts with those two octants. In the first half of a Y pattern,the second and fourth octant in the default order differ only in the third coordinate, but no base pattern has a permutationof Y that starts with those two octants.
30f a facet orthogonal to another coordinate axis. Therefore it suffices to encode whether g lies on afacet that is orthogonal to the third coordinate axis. We implement this by letting the first bit encodethe third coordinate of g (0 if zero, 1 if non-zero).For the remaining gates, note that g i must be one of the two unit cube facet midpoints that areincident on the i -th octant and differ from g i − . The three facet midpoints incident on the i -th octantcan be distinguished by their non-zero coordinate. Thus we encode the location of g i (for 2 ≤ i ≤
4) asfollows. If the third coordinate of g i − is zero, then the i -th bit encodes the third coordinate of g i (0if zero, 1 if non-zero) to distinguish between the midpoint of a facet orthogonal to the third coordinateaxis and the midpoint (not g i − ) of a facet orthogonal to another coordinate axis. If the third coordinateof g i − is non-zero, then the i -th bit encodes the second coordinate of g i , to distinguish between themidpoint of a facet orthogonal to the first coordinate axis and the midpoint of a facet orthogonal to thesecond coordinate axis.Gate sequences for vertex-gated, facet-crossing curves can easily be enumerated by exhaustive search:it turns out there are 149 such gate sequences, which realize 54 different base patterns. From the 149gate sequences, 18 sequences are symmetric and 131 sequences are asymmetric. A full list is given inAppendix E, Table 11. Curves
Given a gate sequence, vertex-gated, facet-crossing curves are specified in the same way asvertex-gated, edge-crossing curves. Note, however, that there is a subtle difference in the conditions forasymmetric curves from symmetric gate sequences. As one can see in Table 11, all symmetric, vertex-gated, facet-crossing gate sequences are symmetric by transformation d or e from Table 3, which is arotation without reflection. In this respect the facet-crossing gate sequences differ from the edge-crossinggate sequences, where reversal of a symmetric gate sequence induced reflection of the base pattern.Consequently, names of asymmetric curves are a bit easier to recognize. If P cmm. cc .ss is a symmetricgate sequence for vertex-gated, facet-crossing curves, then P cmm. cc .ss.op.qr names an asymmetric curveif and only if P cmm. cc .ss.op.qr is lexicographically smaller than P cmm. cc .ss.po.rq and the last twodigits are simply different.Some examples of vertex-gated, facet-crossing curves are shown in Figure 15. Counting the curves
The curves can be counted as with vertex-gated, edge-crossing gate sequences.We have 30 736 curves for each of 18 symmetric gate sequences and 65 536 different curves for each of131 asymmetric sequences: 9 138 464 different facet-crossing vertex-gated curves in total.
We first establish where the gates lie relative to each other:
Theorem 4
If one gate of a three-dimensional Hilbert curve is at a vertex and the other gate lies in theinterior of an edge, then the edge gate lies exactly in the middle of the edge. Moreover, the two gates lieon a common facet of the unit cube, but not on a common edge of the unit cube.
Proof: Assume the entrance gate is at a vertex and the exit gate is in the interior of an edge (the reverseconfiguration is analogous). This implies that the traversal must be reversed in every second octant tobe able to match the gates between the octants. Thus the traversal ends at a vertex of the eighth octantthat lies in the interior of an edge of the unit cube—thus it actually lies in the middle of that edge. Wecan now distinguish three possible locations for the exit gate.(i) The exit gate lies on one of the three edges incident on the entrance gate. This is impossible bythe same argument as for case (iii) in the proof of Theorem 1 (after traversing the first octant within acube, it would be impossible to connect to the second octant).(ii) The exit gate lies on one of the three edges that are not on any of the unit cube facets thatcontain the entrance gate. This implies that one can never enter and leave an octant across the sameaxis-parallel centre plane of the cube. We will call this the no-turns condition ; it is equivalent to thecondition that no pair of consecutive edges of A makes an acute angle. The reader may now verify that31 a00 Cd00 Cl00 Ll1c Na00 Si00Lacc Figure 17: Base patterns in which no octant is separated from its predecessor and its successor by asingle axis-parallel plane (
Lacc drawn upside down).(a) (b)Figure 18: (a) No cube-crossing vertex-edge-gated curve with base pattern
Cd00 could connect the lastoctant’s entrance gate to the full curve’s exit gate. (b) No cube-crossing vertex-edge-gated curve withbase pattern
Cl00 could connect the fifth octant’s entrance gate to the six octant’s entrance gate.the only base patterns that comply with the no-turns condition are
Ca00 , Cd00 , Cl00 , Lacc , Ll1c , Na00 ,and
Si00 , see Figure 17.Note that for any of these patterns to be realizable under the conditions of case (ii), the exit gatemust be a vertex of the last octant that lies in the middle of an edge of the unit cube that is not ona common unit cube facet with the the first octant. In other words, if the first octant is the lower leftfront octant, then the exit gate must lie in the middle of the top right edge, the top back edge, or theright back edge. With Ca00 , Lacc , Ll1c , Na00 and
Si00 , this is not possible, because the first and thelast octant are adjacent, and the last octant does not have any vertices on the top right, top back, orright back edge. With
Cd00 , the last octant has one such vertex (the middle of the top right edge),but it cannot be used as an exit gate since it lies on the octant facet that is shared by the second-lastand the last octant and which must therefore contain the last octant’s entrance gate (see Figure 18a).Finally, the reader may verify that the only feasible gate sequence for the beginning of
Cl00 would put g in the middle of the left back edge and g in the middle of the front face. But thus, g , the fifthoctants’ entrance gate, lies on the octant facet that is shared by the fifth and the sixth octant and must,therefore, also contain the fifth octants’ exit gate (see Figure 18b). Thus, none of the base patterns thatcomply with the no-turns condition can be realized under the conditions of case (ii).(iii) The exit gate lies on a common unit cube facet, but not on a common unit cube edge with theentrance gate. This is the only possibility that remains. (cid:117)(cid:116) Gate sequences
Theorem 4 leaves only one possibility for the positions of the entrance gate and theexit gate relative to each other. Given only the location of the entrance gate g i − of an octant C i , thereare up to six different transformations of the complete curve that could map it to the curve within theoctant, such that one of the gates g or g is mapped to g i − . Correspondingly, there are up to sixdifferent possibilities for the location of the exit gate g i of C i . However, the reader may verify that anyparticular facet of C i contains at most two of the possible locations for the exit gate g i , so at most twopossible locations for g i can be adjacent to the next octant. In fact, given the location of the entrancegate on an octant and the octant facet (if any) shared with the next octant, we only need to knowwhether the traversal within the octant is reflected to fully determine the location of the next gate.Therefore, gate sequences are encoded with one bit per octant that simply indicates whether thetraversal within the octant is reflected (1) or not (0). Note that thus, unfortunately, the encoding of Half base patterns that comply are C * *, L * *, L * c *, N * *, N * *, and S * *, but N * * cannot be extended to a completebase pattern that complies with the no-turns condition. g is located (on which edge), and it depends on the location of the fifth octant(to encode g ). Recall that reflections in the second half of the curve are subject to the transformationencoded by the second symbol of the base pattern name. Consider, for example, the curve La13.cv.II in Figure 19e: its reflections are encoded by II = 0000 0000, which means no reflections. However, thesecond half of the curve is still subject to the reflection a , so that all octants in the second half of thepattern do in fact contain a reflected copy of the curve.The combination of vertex and edge gates allows great flexibility in how to connect things up. Anexhaustive search brought up a wide variety of gate sequences, 2 758 in number, which realize 112 differentbase patterns. The gate sequences are listed in Appendix E, Tables 12 and 13: for each entry in the table,the first column gives a prefix (third-level description), and the second and third column give a numberof possibilities for the first and the second symbol, respectively, of the gate sequence specification. Eachcombination of a prefix, one symbol from the second column, and one symbol from the third column,constitutes a gate sequence name for a vertex-edge-gated curve. Curves
The location of the gates g , ..., g leaves no freedom with respect to the rotations, reflectionsand/or reversals of the traversals within the octants. Therefore, there is only one curve per gate sequence,and a gate sequence name suffices to identity a curve. Some examples are shown in Figure 19. Notethe examples of centred, standing curves: as we will prove in Section 7.2 (Corollary 2) and Appendix F(Theorem 19), these properties cannot be obtained with vertex-gated curves. Theorem 5
If one gate of a three-dimensional Hilbert curve is at a vertex and the other lies in theinterior of a facet, then the facet gate lies exactly in the middle of the facet. Moreover, the two gates donot lie on a common facet of the unit cube.
Proof: The proof is completely analogous to the beginning of proof Theorem 4 (replacing edges by facets)up to and including case (i), leaving only the option of a facet gate in the middle of a facet that doesnot contain the entrance gate. (cid:117)(cid:116)
Gate sequences
Note that Theorem 5 leaves only one possibility for the positions of the entranceand exit gates relative to each other. As with the hypothetical vertex-edge-gated curves in case (ii) inthe proof of Theorem 4, the no-turns condition applies. Therefore, only the base patterns
Ca00 , Cd00 , Cl00 , Lacc , Ll1c , Na00 , and
Si00 need to be considered, from which
Ca00 , Cd00 , Na00 , and
Si00 can beeliminated right away because the last octant would have to have the entrance and the exit gate on thesame octant facet. Traversing the octants one by one, starting from the vertex gate, forward and reversecopies of the curve must alternate so that they can connect at alternating vertex and facet gates. Thus,gates g , g , g , g and g will be at octant vertices and gates g , g , g and g will be in the centres of theoctant facets that are shared by the octants they connect. This rules out the base patterns Lacc and
Ll1c , because in these patterns, the seventh and the eight octant, who share g , do not share an octantfacet.This leaves only one possible base pattern, Cl00 . The reader may now verify that only four gatesequences are possible, with gates g , g , g and g fixed as explained above, and g in a fixed positionon an edge of the unit cube. Only for g and g there is a choice: each of them can be either in themiddle of an edge ( e ) or in the middle of a facet ( f ) of the unit cube. Thus we get the gate sequences Cl00.cf.ee , Cl00.cf.ef , Cl00.cf.fe , and
Cl00.cf.ff . Curves
For each octant C i , given the location of the gates g i − and g i , there is still freedom whetheror not to reflect the traversal in the diagonal plane that contains both gates. This is encoded with onebit per octant: 0 if the transformation of the whole curve to the curve within the octant can be obtainedwithout reflection; 1 if it requires a reflection. Thus, each gate sequence allows exactly 2 = 256 differentcurves, and there are 1024 vertex-facet-gated curves in total. An example is shown in Figure 20a.33a) Ca00.cv.4h
Base camp1 2 3 (b)
Si11.ct.P9
Rollercoaster3 1 2 (c)
Cd00.ct.4h
Indoor stroll1 3 2 (d)
Ce11.ct.P9
Outdoor stroll2 3 1 (e)
La13.cv.II
Perfect Fit1 2 3
Figure 19: Examples of vertex-edge-gated curves. (a) The centred, standing, well-folded curve that mayhave the most regular structure of any Hilbert curve. (b) A crazy curve with many diagonal connectionsthrough the centre. It exhibits full harmony on the interior diagonals. Its worst-case locality-preservingproperties are among the worst of all Hilbert curves. (c,d) Two standing curves that would make fora relatively leisurely stroll if built as a three-dimensional labyrinth: there are no vertical edges, and aminimal number of sloped edges (only one per octant). These properties remain true in recursion. (e)The only Hilbert curve that I found to be uniquely defined by its base pattern,
La13 : there is only oneway to fit the octants together in this pattern.
For completeness, I have to discuss the edge-gated curves. Unfortunately, whereas combining edge gateswith vertex gates unlocked a world of curves with interesting properties that could not be achieved withvertex gates alone, having edge gates at both ends seems to be a severe restriction. The analysis of thepossible locations of the gates in such configurations ultimately takes more space than the description ofthe curves themselves, which number only sixteen and in which I have not discovered any particularlyinteresting properties. The impatient reader is welcome to follow me to Section 6.6 on facet-gated curvesimmediately; the curious reader may consider consulting Section 8 to learn about the software tools thatcan be used to explore the sixteen ugly ducklings to see if there is a swan in there after all.We first determine where the gates lie on their respective edges in Lemma 1 below. After that wedetermine where the entrance and the exit gate lie relative to each other in Theorem 6.
Lemma 1
If both gates lie on the interiors of edges, then each gate lies at distance 1/3 to the closestvertex of the unit cube.
Proof: Let a > z > a , ..., a be the distance of g , ..., g , respectively, to the closestoctant vertex. If a (cid:54) = z , forward and reverse copies of the curve must alternate to match up, so we candistinguish two cases: (i) a , a , a , a , a = a/ a , a , a , a = z/
2, or (ii) a , a , a , a , a = z/ Cl00.cf.ff.dd (b)
Cd00.rv.3C
12 3
Figure 20: Examples of: (a) a standing vertex-facet-gated curve. (b) an edge-gated curve.and a , a , a , a = a/
2. If case (ii) applies, then case (i) applies to the reverse of the curve; if a = z ,case (i) also applies; so we may assume that case (i) applies without loss of generality. In particular, wehave a = a = a/ g and g cannot lie at a vertex of the first orlast octant, respectively, and therefore they cannot lie exactly in the middle of an edge of the unit cube.So we have a < / z < /
2. Now we can unambiguously define u and u as the vertices of theunit cube that are closest to g and g , respectively, and we define p , ..., p as the octant vertices closestto g , ..., g , respectively. Since a = a/ (cid:54) = a , the octant vertex p cannot be u but must be a midpointof an edge of the unit cube; therefore the coordinates of p sum up to 0, modulo 1. Between each pairof points p i − , p i , for i ∈ { , ..., } , some coordinates may change by 1/2 and others remain equal. Bythe self-similarity of the curve, the number of coordinates that change is always the same and it is eithereven or odd, so between each pair of points p i − , p i , the sum of the coordinates changes either by 0 orby 1/2, modulo 1. Thus, summed over eight pairs p i − , p i , for i ∈ { , ..., } , the coordinate sum changesby 0, modulo 1, and hence p , like p , must be a midpoint of an edge of the unit cube, not a vertex, thatis, not u .Now let | xy | denote the distance between the points x and y . We have | u p | = | u g | + | g p | ,so 1 / a + a = a + a/ a = 1 /
3. Similarly, we have | u p | = | u g | + | g p | , so1 / z + a = z + a/ z + 1 /
6, and therefore, z = 1 / a . (cid:117)(cid:116) Theorem 6
If both gates of a three-dimensional Hilbert curve lie on the interiors of edges, then theoctants that contain the gates lie on a common facet of the unit cube, but not on a common edge of theunit cube; one of the gates lies on that facet shared by the first and the last octant, whereas the othergate lies on an edge orthogonal to the shared facet. Each gate lies at distance 1/3 to the closest vertexof the unit cube.
Proof: First note that the entrance and the exit gates cannot lie on parallel edges, since then, byinduction, all gates g , ..., g would have to lie on parallel edges, and the traversal would never be able tocross the centre plane of the unit cube that is orthogonal to those edges. We now distinguish three casesfor the possible locations of the first and the last octant relative to each other: they may (i) share anedge of the unit cube, or (ii) only a facet, or (iii) they lie opposite of each other on an interior diagonal.Case (i): the first and last octant lie on the same edge of the unit cube. We distinguish two subcases:(a) the entrance or the exit gate lies on the shared edge of the unit cube, and (b) neither the entrancenor the exit gate lies on the shared edge. In case (a), suppose the entrance gate lies on the shared edge(the case of an exit gate on the shared edge is symmetric); see Figure 21a. The L ∞ -distance between g and g would then be at most 2/3, and thus, the L ∞ -distance between g and g would have to beat most 1/3. But the L ∞ -distance between g and the second octant is 1/2, so this is not possible. Incase (b), illustrated by Figure 21b, recall that the entrance and exit gate do not lie on parallel edges.A traversal within an octant that starts on an edge of the unit cube, at distance 1/3 from the corner ofthe unit cube, can now only end on an axis-parallel line through the centre of the unit cube at distance1/3 from the centre, and vice versa. Thus g , like g , must lie on an edge of the unit cube, where noconnection to the third octant is possible. So case (i) cannot occur.Case (ii): the first octant and the last octant lie on the same facet of the unit cube. Since theentrance and exit gates cannot lie on parallel edges, at most one of them lies on an edge orthogonal tothe unit cube facet shared by the first and the last octant. We distinguish two subcases: (a) both theentrance and the exit gate lie on the shared facet of the unit cube, and (b) only one of the gates lies on35 a) (b) (c) g g g g g g g g g g g g g g g g g g g u Figure 21: Impossible gate combinations for edge-gated curves. (a) Case (i)(a): if g lies on the unitcube edge shared by the first and the last octant, then g must lie at L ∞ -distance at most 1 / g ,that is, within the shaded box. But that box does not reach any octant other than the first and thelast. (b) Case (i)(b): showing the possible locations for g and g . None of the possible locations for g allows a connection to a third octant. (c) Case (ii)(a): showing the possible locations for g . None ofthe possible locations for g allows a connection to a second octant.the shared facet. In case (a), following the curve through the first octant, it follows that g lies on anedge of the unit cube, at distance 1/3 from u (see Figure 21c). So no connection to the second octantis possible, and case (a) cannot occur. Case (b) is entirely realizable, as we will see below and illustratein Figure 20b.Case (iii): the first and the last octant lie opposite of each other on an interior diagonal of the unitcube. In this case, consider the four layers of second-level subcubes, and without loss of generality,suppose the traversal starts in the bottom layer. With every traversal of an octant in the bottom half ofthe unit cube, one moves from the bottom layer to the second layer or vice versa, so after traversing alloctants in the bottom half (possibly visiting octants in the top half in between), one ends in the bottomlayer with no more octants to go to. However, the traversal must end in an octant that spans the toptwo layers, so this case is not realizable. (cid:117)(cid:116) Gate sequences
Theorem 6 leaves only one possibility for the positions of the gates g and g relativeto each other. Furthermore, by the same arguments as in the proof of Theorem 4, case (ii), the fact thatthe gates do not lie on a common facet restricts the possible base patterns to Ca00 , Cd00 , Cl00 , Lacc , Ll1c , Na00 , and
Si00 . From these, only
Cd00 has the first and the last octant on a common unit cubefacet, but no a common unit cube edge, as required by Theorem 6. So all edge-gated curves have basepattern
Cd00 . Moreover, by Theorem 6, one of the gates is on an edge orthogonal to the facet of theunit cube that is shared by the first and the last octant, so the names of all edge-gated curves start witheither
Cd00.rt or Cd00.rv .Given the location of the entrance gate of an octant and the octant facet (if any) that is sharedwith the next octant, we only need to know whether the traversal within the octant is reflected to fullydetermine the location of the next gate (Figure 22 illustrates this for
Cd00.rt -curves; the situation for
Cd00.rv -curves is similar). Therefore, gate sequences are encoded with one bit per octant that simplyindicates whether the traversal within the octant is reflected (1) or not (0).An exhaustive search brought up 16 gate sequences, as listed in Appendix E, Table 14.
Curves
The location of the gates g , ..., g leaves no freedom with respect to the rotations, reflectionsand/or reversals of the traversals within the octants. Therefore, there is only one curve per gate sequence,and a gate sequence name suffices to identity a curve. An example is shown in Figure 20b. Theorem 7
There is no three-dimensional Hilbert curve with one gate in the interior of an edge andone gate in the interior of a facet. a) (b) connectionto the front connection to above connection to the rightconnectionto the back not reversednot reflected not reversedreflectedreversedreflected reversednot reflected Figure 22: (a) The location of the entrance and exit gates of a
Cd00.rt -curve. (b) Example of howreflection in a given octant distinguishes between the two possible ways to reach the next octant. Assume(without loss of generality, modulo rotary reflections) that the entrance gate of the given octant is onthe bottom left edge at 1/3 of the way from the front vertex to the back vertex. Then there are fourpossible locations for the exit gate, as shown in the four figures. On each of the top facet, right facet,front facet and back facet of the octant, we find exactly two candidate locations for the exit gate: onethat is reached by a (possibly reversed) non-reflected traversal and one that is reached by a (possiblyreversed) reflected traversal.Proof: Suppose there would be a three-dimensional Hilbert curve with the entrance gate in the interiorof an edge and the exit gate in the interior of a facet. This implies that the traversal must be reversedin every second octant to be able to match the gates between the octants. Thus the traversal ends onan edge of the eighth octant that lies in the interior of a facet of the unit cube—thus the exit gate lieson an axis-parallel centreline of that facet, but not in the centre point of the facet. Call the facet thatcontains the exit gate the back face.Then the first and the second octant must be connected back to back and they must have the sametransformations, apart from a reflection in a plane parallel to their shared octant facet and possibly areflection in a plane containing the back face centreline with the connecting gate. Thus, g and g mustlie on parallel edges. Following the traversal through the subsequent octants, we find that g , g , g , g and g are all on parallel edges. Hence g , the entrance gate of the unit cube, is on an edge that isparallel with the facet that contains the exit gate.Now rotate the curve such that the edge with the entrance gate is vertical. We now find that allgates g , ..., g lie in the interior of vertical octant edges or facets. But then the curve cannot connectthe bottom half of the unit cube with the top half of the unit cube. Therefore it is impossible to realizea gate sequence with one gate in the interior of an edge and the other gate in the interior of a face. (cid:117)(cid:116) Theorem 8
There is only one facet-gated three-dimensional Hilbert curve.
Proof: In a previous manuscript [16], I gave a proof similar to that of Theorem 6, but considerably morecomplicated to take the seemingly greater number of degrees of freedom in the locations of the gatesinto account. In contrast, here I will give a mostly independent and much shorter proof, building on therecent results from my work with Bos [6].First observe that any facet-gated curve must be face-continuous, since consecutive subcubes in a gridmust always share a subcube facet for their exit and entrance gate to match up. This limits the possible37 A A Figure 23: Trying and failing to construct a facet-gated curve with base pattern
Si00 .base patterns to those whose approximating curves A only have axis-parallel edges: Ca00 , Cl00 , and
Si00 (see Figure 17).Moreover, the gates cannot be on parallel facets, otherwise, by induction, all of the gates g , g , ... must be on parallel octant facets and the traversal could never cross the centre planes of the unit cubethat are orthogonal to the facets that contain the gates. Hence, the gates are on non-parallel facets, andthus, no pair of consecutive edges in an approximating curve can be collinear. It follows that, in threedimensions, facet-gated curves are not only face-continuous, but even hyperorthogonal.We now consider the three possible base patterns one by one.For base pattern Ca00 , which identifies well-folded curves, there is exactly one facet-gated hyper-orthogonal curve, as proven by Bos and myself [6].Base pattern
Cl00 cannot be realized with face-continuous curves, by the same arguments as for case(iii) of the proof of Theorem 6.We investigate base pattern
Si00 by trying to draw the approximating curves A , A , A , A , eachextended with an entry edge and an exit edge orthogonal to the facets that contain the gates. Ap-proximating curve A , consisting of an entry edge, one vertex, and an exit edge, is trivial. There aretwo different ways (modulo rotation, reflection and/or reversal) to construct a matching approximatingcurve A , using base pattern Si00 , and without collinear edges, as shown in Figure 23. From these, wecan construct five different curves A while maintaining that the curve in each octant is similar to A .However, now one can see that we will not be able to construct matching curves A while maintainingcontinuity: if we replace the curve in each octant by a copy of A , then the edges drawn fat in Figure 23will break. Hence, there are no facet-gated curves with base pattern Si00 .If follows that the only facet-gated three-dimensional Hilbert curve is the facet-gated three-dimensionalhyperorthogonal well-folded curve which was described by Bos and myself [6]. Bos and I also calculatedthe locations of the gates and thus we get: (cid:117)(cid:116)
Corollary 1
If both gates lie on the interiors of facets, then each gate lies at distance 1/3 to the closesttwo edges of the facet of the unit cube that contains it.
The only facet-gated curve, as known from my work with Bos [6], is shown in Figure 24. Its name issimply
Ca00.gs . Since there is only one facet-gated curve, its name does not need to be more specificthan this: there is no need to set up an encoding for different gate sequences.As we will see in Section 7.3, the facet-gated hyperorthogonal curve has excellent locality-preservingproperties: it is the unique best three-dimensional Hilbert curve with respect to the worst-case bounding-box surface and L -dilation measures. On each of the other metrics calculated, the curve is within 4%from optimal. In this section I will present some observations on the properties of the three-dimensional Hilbert curvesthat we can generate by enumerating their names according to the principles laid out in the previoussections. In Sections 7.1 and 7.2, we will see a number of results that allow us, or our software tool (see38 a00.gs
Beta1 2 3
Figure 24: The facet-gated curve.Section 8), to automatically recognize face-continuous, hyperorthogonal, maximally facet-harmonious,fully interior-diagonal-harmonious, pattern-isotropic or edge-isotropic curves. In Section 7.3, I presentsome results of calculations of locality-preserving properties of the generated curves.Other striking observations about the generated curves include the following. No three-dimensionalHilbert curve follows partition X . All symmetric curves are vertex-gated curves whose names start with Ca , Cd , Ce , La , Ne or Se . All centred curves are vertex-edge-gated. In fact, for these observations, onecan give fairly compact proofs that do not depend on enumerating all curves and testing them. Theseproofs can be found in Appendix F, but they are without further consequence for the work presented inthis article. Violations of face-continuity, hyperorthogonality, harmony and palindromy are easy to recognize, butit may not be straightforward to verify that a curve is entirely free of violations and therefore has theaforementioned properties. In this subsection we will discuss easy solutions for these properties andexplain why the easy solutions suffice. At the end of this section, we discuss metasymmetry.
Theorem 9
The face-continuous three-dimensional Hilbert curves are those whose names start with
Ca00.cc , Ca00.gs , or
Si00.cc . Proof: A curve can only be face-continuous if each octant except the first shares an octant facet withthe previous octant. There are only three base patterns that satisfy this requirement:
Ca00 , Cl00 , and
Si00 (see Figure 17).With base patterns
Ca00 and
Si00 , the first and the last octant lie next to each other along an edgeof the unit cube. By the theorems from Section 6, traversals for which this is the case may only berealized as vertex-gated, as vertex-edge-gated, or as facet-gated curves. We consider these case one byone.Vertex-gated curves: note that if octants C i and C i +1 share an octant facet F and connect in avertex gate g i , then the suboctants of C i and C i +1 , respectively, that connect in g i must also share asuboctant facet, namely the appropriately sized subfacet of F in the corner at g i . Hence, by induction,all vertex-gated curves whose names start with Ca00.cc or Si00.cc are face-continuous.Vertex-edge-gated curves: consider the curve A that sketches the traversal of the second-level sub-cubes. Let v ijk be the vertex of A in the i -th layer, j -th row, k -th column, where i, j, k ∈ { , ..., } . Wedefine the parity of a vertex v ijk as the parity of i + j + k . Note that A has an odd number of edges, and,if the curve is face-continuous, each edge connects vertices of different parity. Thus, the first and thelast vertex of A must have different parity. From Theorem 4 we know that, without loss of generality,we may number layers, rows and columns such that A starts at v and ends at v or v . Giventhat the base pattern Ca00 or Si00 ends with on octant that lies next to the first octant along an edgeof the unit cube, A actually has to end at v , but v has the same parity as v . This contradictsthe conditions of a face-continuous traversal. Hence, no vertex-edge-gated curve is face-continuous.Facet-gated curves: these are necessarily face-continuous, because consecutive octants must alwaysshare the octant facet that contains the gate between them. In particular, the only facet-gated curve, Ca00.gs , is face-continuous.With base pattern
Cl00 , the first and the last octant are opposite of each other on an interior diagonalof the unit cube. By the theorems from Section 6, this can only be realized by vertex-facet-gated curves.39owever, starting from the vertex gate, we find that a face-continuous traversal is not possible by thesame argument as in case (iii) of the proof of Theorem 6. (cid:117)(cid:116)
Finding 1
The only hyperorthogonal three-dimensional Hilbert curves are
Ca00.cc.44.hh.db and
Ca00.gs . How found:
Ca00.cc.44.hh.db and
Ca00.gs were proven to be hyperorthogonal in earlier work [6]. Allother face-continuous three-dimensional Hilbert curves were found to have a pair of consecutive collinearedges in the third-order approximating curve A , thus violating the conditions of hyperorthogonality. (cid:117)(cid:116) Finding 2
The only three-dimensional Hilbert curve with maximum facet-harmony is
Ca00.c4Z . How found: One can easily verify by induction that
Ca00.c4Z (see Figure 15a) is consistent with thetwo-dimensional Hilbert curve on all facets except the back facet. The crucial observation to use is thefollowing: the transformations that map the curve as a whole to the curves within the octants are suchthat the back facet of the unit cube is mapped to octant facets that lie either in the interior of the unitcube, or on the back. Thus, the violations of two-dimensional Hilbert order that show up on the backfacets, do not show up on any of the other facets in recursion. I found that for all other three-dimensionalHilbert curves, inconsistency with the two-dimensional Hilbert curve can be established for at least twofacets by inspecting the approximating curve A . (In fact, for all curves other than the “Imposter” Ca00.cT7 , such violations are already visible in A ). (cid:117)(cid:116) The following lemma is straightforward to prove:
Lemma 2
A curve has full interior-diagonal harmony if and only if on each interior diagonal, thesecond-level subcubes are visited in order.
Finding 3
There is no palindromic three-dimensional Hilbert curve.
How found: All three-dimensional Hilbert curves were found to show violations of palindromic conditionsin A . (In fact, for all curves other than the “Imposter” Ca00.cT7 and
Ca00.cT9 , such violations arealready visible in A .) (cid:117)(cid:116) Let [ X ] denote any character from the string X . Finding 4
The only metasymmetric three-dimensional Hilbert curves are the curves
Ca00.cT [ bC47 ] , Ca11.cT [ IPJ3 ] , Cd00.cP [ IPJ3 ] , Cd11.cP [ bC47 ] , Se00.cT [ bPJ7 ] , and Se66.cT [ IC43 ] . Metasymmetry is an unpleasant property in the following sense. On the one hand, I do not have an easyconclusive argument, short enough to present here, why the 24 curves of Finding 4 are indeed the onlymetasymmetric curves. On the other hand, the amount of work involved in tediously verifying the findingby hand is still small enough that it does not warrant the effort involved in implementing an automaticcheck. For the reader who wishes to verify Finding 4 by hand, some hints are given in Appendix F.
Pattern-isotropy
To be able to analyse isotropy and other orientation properties of the curves, weintroduce the following notation.For a given three-dimensional Hilbert curve τ , let Γ k ( τ ) be the set of symmetries of the unit cube thatmap τ to the curve (or its reverse) within at least one k -th-level subcube (modulo scaling, translation,and reversal). So γ ∈ Γ ( τ ) if and only if there is a first-level octant C i with γ = γ i or γ = γ i ◦ σ , where,if applicable, σ is a transformation that maps a symmetric curve τ to its own reverse. Now, for anyinteger k ≥
2, we have γ ∈ Γ k ( τ ) if and only if there are α ∈ Γ ( τ ) and β ∈ Γ k − ( τ ) such that γ = α ◦ β . Lemma 3
A three-dimensional Hilbert curve τ is pattern-isotropic if and only if there is a k such that Γ k ( τ ) is the set of all 48 symmetries of the unit cube. Proof: For ease of explanation, first consider asymmetric curves τ .By definition, an asymmetric three-dimensional traversal is pattern-isotropic if and only if, in thelimit, we see each of the 48 possible transformations of the base pattern equally often. Let π , ..., π bethe symmetries of the unit cube, numbered such that π is the trivial symmetry (the identity transfor-mation). Let P be the 48 ×
48 matrix defined by P ij = z/ z out of the 8 first-level subcubes40ave the transformation β such that β ◦ π j = π i . Note that for each permutation β used in z first-levelsubcubes, we put an entry with value z/ i (namely at P ij , where π j = β − ◦ π i ) and in eachcolumn i (namely at P hi where π h = β ◦ π i ). Thus each row sums up to one and each column sums upto one. Let u be the 48 elements’ vector with u [1] = 1 and u [ i ] = 0 for all i >
1. Now, if we choose asubcube from level m at random, the probability that is has transformation π i is given by element i ofthe vector P m u .Suppose there is a k such that Γ k ( τ ) is complete, that is, it contains all 48 symmetries of the unitcube. Then all entries in the first column of P k are strictly positive. These entries indicate that anytransformation π i can be constructed from the identity transformation π by composing k transformationsfrom those from the eight octants with π . Then any permutation π i can actually be constructed fromany permutation π j in this way, and therefore all entries of P k are strictly positive. This implies that P is a regular doubly stochastic matrix, and as m goes to infinity, P m u converges to the vector of which allelements are 1/48. Conversely, if there is no k such that Γ k ( τ ) is complete, then, for any k , the vector P k u contains at least one zero, and thus, by definition, τ is not pattern-isotropic.If τ is symmetric, then the situation is slightly more subtle: because direction is irrelevant in thedefinition of pattern-isotropy, we should now consider 24 pairs of possible transformations such that thetransformations in each pair result in each other’s reverse; the traversal is pattern-isotropic if and onlyif, in the limit, 1/24 of the transformations of the base pattern comes from each pair. Therefore we puta non-zero entry in P ij when β ◦ π j = π i or β ◦ σ ◦ π j = π i , where σ is the symmetry transformation thatmaps τ to its own reverse. We now fill the matrix with multiples of 1/16 rather than multiples of 1/8.Otherwise, the proof goes through verbatim. (cid:117)(cid:116) In practice, Lemma 3 allows us to calculate efficiently whether a curve is pattern-isotropic: we simplycalculate Γ k ( τ ) for increasing values of k , until we find we have completed a cycle, that is, until we havefound two values a < b such that Γ a ( τ ) = Γ b ( τ ). Since the number of different values which Γ k ( τ ) canassume is finite, such a cycle must eventually be found—and in practice it is found fast. Then, we candecide whether τ is pattern-isotropic by checking if Γ a ( τ ) contains all 48 symmetries of the unit cube. Edge-isotropy
We now discuss how to recognize edge-isotropy, which turns out to be very simple:the edge-isotropic curves are exactly the face-continuous curves. To prove this, we first need to adaptour notation. Recall that a symmetry of the unit cube is given by a signed permutation Π, whichwe write as a square-bracketed sequence of three numbers whose absolute values are a permutationof { , , } . Let Γ k ∗ ( τ ) be the transformations in Γ k ( τ ) without the signs, so Γ k ∗ ( τ ) is a subset of U = { [1 , , , [1 , , , [2 , , , [2 , , , [3 , , , [3 , , } . We call the transformation [1 , ,
3] the identity transformation, the transformations [2 , ,
1] and [3 , ,
2] are shifts , and the transformations [1 , , , , , ,
1] are swaps . The following lemma is easy to verify by trying all combinations:
Lemma 4 If Γ ∗ ( τ ) contains...(i) ...at least both shifts and no swaps, then Γ k ∗ ( τ ) = { [1 , , , [2 , , , [3 , , } for all k ≥ ;(ii) ...at least one swap and one shift, or at least two swaps and identity, then Γ k ∗ ( τ ) is the completeset U for all k ≥ ;(iii) ...at least two swaps, no shifts and no identity, then Γ k ∗ ( τ ) = { [1 , , , [2 , , , [3 , , } for all even k ≥ , and Γ k ∗ ( τ ) = { [1 , , , [2 , , , [3 , , } for all odd k ≥ . Lemma 4 is very helpful in analyzing vertex-gated curves:
Lemma 5 If τ is a vertex-gated three-dimensional Hilbert curve, then case (i), (ii) or (iii) of Lemma 4applies. Proof: We distinguish two cases: edge-crossing and facet-crossing curves.Suppose τ is edge-crossing, and suppose the edge that connects the entrance and the exit gate isparallel to the third coordinate axis (the cases of the first and the second coordinate axis are similar).For each i ∈ { , , } , there must be an octant in which the edge that connects the octant’s entrance andexit gate is parallel to the i -th coordinate axis, otherwise the traversal cannot reach the opposite octanton the interior diagonal through the first octant. Therefore, Γ ∗ ( τ ) must contain at least one of [2 , , , , , ,
2] and [3 , , , ,
3] and [2 , , τ is facet-crossing. We call a facet a k -facet if it is orthogonal to the k -th coordinateaxis. Suppose the facet that contains the entrance and the exit gate is a 3-facet (the cases of 1- and2-facets are similar), the entrance gate is at ( − , − , − ) and the exit gate is at ( , , − ). We say anoctant is i -low if it is on the same i -facet of the unit cube as the entrance gate, and i -high otherwise. Foreach i ∈ { , } , there must be an i -low octant in which the facet that contains the octant’s entrance andexit gate is an i -facet, otherwise the i -th coordinates of the exit gates of the four i -low octants alternatebetween 0 and − , ending with − , and the remaining i -high octants, among which the octant thatcontains the exit gate of τ , cannot be reached. Therefore, Γ ∗ ( τ ) must contain at least one of [2 , ,
1] and[3 , ,
1] and at least one of [1 , ,
2] and [3 , , (cid:117)(cid:116) Theorem 10
All face-continuous three-dimensional Hilbert curves are edge-isotropic.
Proof: Let τ be a face-continuous three-dimensional Hilbert curve. By Theorem 9, τ must be vertex-gated, or it is Ca00.gs . In the latter case Γ ∗ ( τ ) = { [2 , , , [2 , , , [3 , , , [3 , , } , as can be seen inFigure 24, hence case (ii) of Lemma 4 applies. Otherwise τ is a vertex-gated curve, and case (i), (ii) or(iii) of Lemma 4 applies, by Lemma 5.By the same analysis as in the proof of Lemma 3, asymptotically, as k goes to infinity, for eachelement γ ∈ Γ k ∗ ( τ ) there is an equal number of k -th level subcubes C that are traversed according tothe image of τ under the transformation γ (modulo reflections, reversals, translation and scaling)—notethat this also applies in case (iii): one can simply do the analysis for odd and even k separately. Thus,by the composition of the sets Γ k ∗ ( τ ) as described by Lemma 4, for each edge of the approximating curveof the base pattern, its images within the k -th level subcubes are equally distributed among parallels ofthe first, the second, and the third coordinate axis. Thus τ is edge-isotropic. (cid:117)(cid:116) Note that Theorem 10 implies that the edge-isotropic curves are exactly the face-continuous curves,since for non-face-continuous curves, the concept of edge-isotropy is not defined.
Standing curves
In fact, Lemma 5 has another interesting consequence. By definition, a curve τ isstanding if Γ ∗ ( τ ) contains a single swap and/or identity, and nothing else. Thus, Lemma 5 immediatelyimplies: Corollary 2
No standing three-dimensional Hilbert curve is vertex-gated.
In fact, one can check the 17 edge- and facet-gated curves one by one and find that none of them arestanding. Thus we find:
Finding 5
All standing three-dimensional Hilbert curves are vertex-edge-gated or vertex-facet-gated.
Examples of standing curves of each type are shown in Figures 19acd and 20a, respectively.
Coordinate-shifting curves
In the proof of Lemma 5 we derived necessary conditions on Γ ∗ ( τ ) forvertex-gated curves. In fact, these conditions are almost sufficient for the realization of a given gatesequence. More precisely, The gate sequences for not only vertex-gated curves, but also for vertex-facet-gated curves, fix one axis in each octant, namely the axis of the edge that connects the gates (if the curveis edge-crossing), the axis orthogonal to the facet that contains the gates (if the curve is facet-crossing),or the axis orthogonal to the facet that contains the facet gate (if the curve is vertex-facet-gated).Otherwise, as discussed in Sections 6.1 and 6.3, for each octant, one is free to choose whether or notto reflect it in a diagonal plane that contains the gates—in other words, one can choose freely how topermute the two non-fixed axes. Thus, for each octant, one can choose between a swap and a non-swap(shift or identity). Choosing a shift or identity in each octant results in a coordinate-shifting curve andwe obtain: Theorem 11
Each gate sequence for a vertex-gated or vertex-facet-gated curve admits a coordinate-shifting curve.
On the other hand, one can examine the 17 edge- and facet-gated curves and find that none of themare coordinate-shifting; one can also verify by hand that it is not possible to assemble octants of vertex-edge-gated curves in such a way that they only differ by rotations of the coordinate axes (and reflections,traversals and translations). Thus we find: 42able 8: Worst-case locality metrics for selected curves, and analytical bounds for octant-by-octantcube-filling curves known from the literature. For the Butz curve (along with
Ca00.chI and
Ca00.cTI ),bounds on WD , WD and WD ∞ were also calculated by Niedermeier et al. [34]. The numbers reportedbelow improve on their bounds on WD and WD ∞ . name nickname WD / WD / WD / ∞ WS / WBV WBS / Ca00.c4I
Butz 4.62 2.97 2.89 1.48 3.11 3.14
Ca00.cc.44.hh.db
Alfa 4.64 2.84 2.32 1.48 3.11 2.69
Ca00.c4Z
Harmonious 4.63 3.07 3.04 1.48 3.50 3.46
Ca00.cT4
Sasburg 4.58 3.00 2.66 1.45 3.50 3.08
Ca00.cv.4h
Base camp 5.27 3.21 3.04 1.62 5.25 3.68
Ca00.gs
Beta 4.48 2.65 2.41 1.48 3.14 2.54
Cu00.cc.4d.4d.Z7
Long-legs 5.36 3.28 3.04 5.67 4.03
Ll36.cc.II.hT.33
Rough-edge 6.73 4.29 3.04 ≥ Se33.c7T
Mosquito 6.73 4.30 3.04 10.50 6.34
Si11.ct.P9
Rollercoaster 7.23 4.16 3.04 1.82 14.00 5.81symmetric face-continuous curves 4.49–4.82 2.97–3.10 2.65–3.04 1.45–1.50 3.11–3.73 2.99–3.46vertex-edge-gated curves 4.69–7.23 2.95–4.16 2.55–3.04 1.53–2.07 4.31–14.11 2.97–5.84all Hilbert curves 4.48–7.23 2.65–4.30 2.32–3.04 1.45– ≥ ≤ ≥ ≥ ≥ ≥ ≤ Finding 6
A gate sequence for a three-dimensional Hilbert curve can be realized by a coordinate-shiftingcurve if and only if it is vertex-gated or vertex-facet-gated.
Table 8 shows some results on metrics of locality-preserving properties as discussed in Section 3.3,computed with algorithms from Sasburg [40] based on our previous work [18]. With our current imple-mentation we cannot easily compute WS / with reasonable precision for all curves; the value for theRough-edge curve is a lower bound. The true value cannot be that much higher: 2.44 is a weak upperbound, as we show below (Theorem 12). Other results are with an error margin of, theoretically, up to2%.No curve is best on all metrics, but the two hyperorthogonal curves (Alfa and Beta) stand out.Beta, the facet-gated hyperorthogonal curve, is the unique best curve with respect to bounding-boxsurface and L -dilation. On each metric, the curve is within 4% from optimal. Alfa, the vertex-gatedhyperorthogonal curve is the unique best curve with respect to L ∞ -dilation, the unique second-best withrespect to bounding-box surface, and optimal with respect to bounding-box volume. On each metric, thecurve is within 7% from optimal. The Alfa curve confirms a result from “computer simulation” reportedby Gotsman and Lindenbaum [13] that WD / is at most 2.84 for some three-dimensional Hilbert curvethat was left unspecified.The symmetric face-continuous curves are always within 37% from optimal. Several examples arelisted in the above table, including the Butz curve, which is optimal with respect to bounding-box volume,and the best metasymmetric curve (the Sasburg curve), which is optimal with respect to curve sectionsurface.Crazy curves, such as Rough-edge, Mosquito and Rollercoaster, can score up to 350% worse thanoptimal on the bounding-box volume metric, but on the other metrics the differences between curves areless pronounced. Note that a curve with diagonal edges in the approximating curves is not automaticallyworse than a face-continuous curve. On the bounding-box surface, L ∞ -dilation, and L -dilation metrics,the best vertex-edge-gated curves actually score slightly better than the best symmetric face-continuouscurves—but still always worse than the two hyperorthogonal curves.43inally, here is the promised upper bound on WS / : Theorem 12
Any octant-wise traversal has WS / at most √ . Proof: For a given section s of the traversal, let a maximal k -level subcube be a k -level subcube Q that iscompletely contained in s while the ( k − Q is not completely contained in s . For any k , let n k be the number of maximal k -level subcubes. Note that the k -level subcubes countedby n k are distributed over at most two ( k − k -level subcubes of the same ( k − k − Q . Together these octants have 36 facets: 24 exterior facets on the boundary of Q , and 12 interior facets inside Q ; the latter are each shared by twooctants. Suppose s (cid:48) is a curve section that consists of m octants of Q . Now consider any of the twelveinterior facets f together with the two exterior facets that coincide with f in a projection orthogonalto f . Observe that, from these three facets, at most two can lie on the outside of s (cid:48) . Hence s (cid:48) has asurface area of at most 24 octant facets, with a maximum of 6 m . Therefore, the n k k -level subcubes,distributed over at most two ( k − n k facets of area 1 / k each,with a maximum of 48 / k , the surface area of 8 k -level subcubes.Recall from Section 3.3 that WS / is the maximum of · surface( C ( a, b )) / ( b − a ) / . An upperbound on WS / for any octant-by-octant traversal is therefore the following:WS / = max a ∈ [0 , max b ∈ ( a, surface( C ( a, b )) / b − a ) / ≤ max n ,n ,n ,... ∈{ ,... } (cid:80) ∞ k =1 n k / k ( (cid:80) ∞ k =1 n k / k ) / . This expression is maximized with n k = 8 for all k , in which case it evaluates to √
49, which is slightlyless than 2.44. (cid:117)(cid:116)
Note that the bound of Theorem 12 is not tight: the calculation does not account for the fact thatif we have n k = 8 for all k , then there must be k -level subcubes with facets that are contained in facetsof ( k − / = √
49 cannot actually be realized.
From the author’s website at http://spacefillingcurves.net/, one may download the C++ sources of atool to search the curves. The purpose of this tool is to allow us to verify the contents of the presentarticle, to reverse-engineer the curve that underlies any existing, poorly documented implementation ofa three-dimensional Hilbert curve, and to facilitate the exploration of three-dimensional Hilbert curvesthat have given properties.The search tool takes as input a set of conditions which a curve should fulfill. These conditions couldtake the form of a prefix of a curve name, the order in which the subcubes in a grid of 8 k cubes are visited(for any natural number k ), a curve description in the numerical style of Section 2.3, and/or a subsetof the properties described in Section 3.2, with the exception of edge-isotropy, which is equivalent toface-continuity by Theorem 10. The tool then searches the space of 10,694,807 three-dimensional Hilbertcurves for matching curves, reports how many there are, and, depending on the user’s preferences,outputs details for one or all of these curves. Such details may include whatever could be given as input(the name of the curve, the order in which subcubes in a grid are visited etc.), as well a POV-Ray [38]file for an illustration of the curve in the style of, for example, Figure 5c, and additional information ifknown (nickname, references).The base pattern names (Table 5) and the names of metasymmetric and vertex-facet-gated curvesare hardcoded. Otherwise the tool computes gate sequences and computes or verifies curve propertieson the fly, using the same algorithms that were used to generate the tables in Appendix E.Conditions for the search can be given on the command line or in an input file which may containspecifications for many successive searches. Thus the search tool allows one to run, for example, the face-continuous, hyperorthogonal, symmetric, metasymmetric, maximally facet-harmonious, fully interior-diagonal-harmonious, well-folded, vertex-gated etc., edge-crossing etc., centred, order-preserving, pattern-isotropic, coordinate-shifting, standing. × × We will now try to answer the title question of this article.
There is 1 three-dimensional Hilbert curve
The curve
Ca00.c4Z (Figure 15a) is clearly the curvethat is the “most Hilbert” of all. The curve visits the points on each of five of the six faces of the cubein the order of a two-dimensional Hilbert curve. It is the only curve that does this (Finding 2) and alsohas the three essential properties of Hilbert curves. Moreover, just like Hilbert’s two-dimensional curve,it is also face-continuous, vertex-gated, edge-crossing, symmetric, well-folded, and pattern-isotropic. Itsconstruction generalizes to higher dimensions [15], which gives us a unique Hilbert curve for any numberof dimensions.
There is 1 three-dimensional Hilbert curve
The curve
Ca00.cv.4h (Figure 19a) is clearly thecurve that is the “most Hilbert” of all. It is the only curve that has the three essential properties ofHilbert curves and is also, just like Hilbert’s two-dimensional curve, well-folded, centred (the point in thecentre of the curve lies in the centre of the cube) and standing, where, just as in Hilbert’s two-dimensionalcurve, the permutations (ignoring the signs) that define the transformations in the octants are restrictedto swapping the first and the last axis in (and only in) the first and the last octant . There is 1 three-dimensional Hilbert curve
The curve
La13.cv.II (Figure 19e) is clearly thecurve that is the “most Hilbert” of all. It is the only curve that has the three essential properties ofHilbert curves and can be identified unambiguously by its base pattern, La13, eliminating any room forconfusion about exactly which curve is intended.
There are 2 three-dimensional Hilbert curves
The curves
Ca00.cc.44.hh.db (Figure 15c) and
Ca00.gs (Figure 24), described by Bos and Haverkort [6], are clearly the curves that are the “mostHilbert” of all. They are the only self-similar well-folded hyperorthogonal curves in three dimensions [6].Bos and Haverkort describe how to construct two such curves in any number of dimensions greater thantwo. They also show that, regardless of the number of dimensions, each section of such a curve has abounding box of volume at most four times the volume of the curve section itself. Just like Hilbert’stwo-dimensional curve, the curves from Bos and Haverkort are also face-continuous and pattern-isotropic.The three-dimensional curves have, in some ways, better locality-preserving properties than any othercurve that has the three essential properties of Hilbert curves (see Section 7.3).
There are 3 three-dimensional Hilbert curves
The curves
Ca00.chI (Figure 15e),
Ca00.cTI and
Ca00.c4I (Figure 15b), together singled out by Niedermeier et al. [34], are clearly the curves that arethe “most Hilbert” of all: they are the only curves that are, just like the two-dimensional Hilbert curve,face-continuous, vertex-gated, edge-crossing, symmetric, well-folded, and coordinate-shifting. This makesthe permutations easy to implement efficiently in software.
Ca00.c4I is the three-dimensional curve ofButz’s construction, which is well-defined for any number of dimensions [8]. The uniqueness of the curve is easy to verify: by Theorem 19, all centred curves are vertex-edge-gated; one can nowsimply check all the vertex-edge-gated curves of the well-folded pattern
Ca00 . here are 24 three-dimensional Hilbert curves Let [ X ] denote any character from the string X .The 24 curves Ca00.cT [ bC47 ], Ca11.cT [ IPJ3 ], Cd00.cP [ IPJ3 ], Cd11.cP [ bC47 ], Se00.cT [ bPJ7 ], and Se66.cT [ IC43 ] (see Figures 15dfh and 16abcd for examples) are clearly the curves that are the “mostHilbert” of all. These 24 curves are the only metasymmetric curves: they are the only curves that havethe same degree of symmetry as the two-dimensional Hilbert curve, being composed of two congruenthalves, four congruent quarters, and eight congruent octants.Note that there is no overlap between the answers given so far: these answers do, in fact, mention1 + 1 + 1 + 2 + 3 + 24 = 32 different curves.
There are 920 three-dimensional Hilbert curves
The 920 order-preserving curves whose namesstart with
Ca00.cc or Si00.cc (see Figures 15a–g for examples), described by Alber and Niedermeier [2],are clearly the curves that are the “most Hilbert” of all: they are the only curves that are, just like thetwo-dimensional Hilbert curve, face-continuous and order-preserving. Moreover, just like Hilbert’s two-dimensional curve, they are also vertex-gated and edge-crossing. There are 157,865 three-dimensional Hilbert curves
The 157,865 curves whose names start with
Ca00 (see Figures 15a–f, 19a and 24 for examples) are clearly the curves that are the “most Hilbert” ofall: they are the only curves that are, just like the two-dimensional Hilbert curve, well-folded. There are 10,694,807 three-dimensional Hilbert curves
These are all the curves that have thethree-dimensional equivalent of the properties that uniquely define the two-dimensional Hilbert curve:continuity, self-similarity, based on subdivision into 2 d subcubes. Clearly, each of these curves is at leastas much a Hilbert curve as any other. There are infinitely many three-dimensional Hilbert curves
Recall from Section 3.4 that wecould also have decided to select vertex-gatedness and face-continuity, instead of self-similarity, as defin-ing properties of the two-dimensional Hilbert curve. As we saw in Section 6.1, in three dimensions,there are multiple self-similar, face-continuous, vertex-gated, octant-by-octant traversals. Thanks to thevertex gates, you can assemble these into endless non-self-similar combinations . Therefore, in threedimensions, there are infinitely many octant-by-octant, vertex-gated, face-continuous space-filling curves.Clearly, each of them could be called a Hilbert curve.
10 How many Hilbert curves are there in four dimensions?
There are 4 four-dimensional Hilbert curves
I am aware of four generalizations of Hilbert curvesthat have been described in the literature for any number of dimensions: Butz’s generalization [8] (seeTable 9), and three of our own: the self-similar, well-folded, hyperorthogonal curves (one vertex-gated,one facet-gated) [6], and the harmonious Hilbert curve [15] (see Table 9). All of these curves are well-folded: they differ only in the transformations within the subcubes.
There are 7 four-dimensional Hilbert curves
In addition to the above, I have singled out, orhave seen singled out, three more curves: the curve
H4cdNew from my work on R-trees with VanWalderveen [19], an example from Alber and Niedermeier [2] (see Table 9), and a curve which we willcall the squared Hilbert curve . Alber and Niedermeier counted 1 536 curves with these properties, since they counted some curves twice which weconsider to be equivalent: they counted a forward and a reverse copy of each of the asymmetric curves whose names startwith
Ca00.cc.hh.I3 , Ca00.cc.TT.I3 , Ca00.cc.44.I3 (120 curves each) and
Si00.cc.LT.I3 (256 curves). Note that versions(a) and (b) of generator Hil . B in their work are congruent under rotation around a line through the midpoints of the lowerfront and the upper back edge, therefore both versions generate the same curves whose names start with
Si00.cc.LT.I3 . Ca00.cc.hh , Ca00.cc.TT and
Ca00.cc.44 ; 65,536 curves with gatesequence
Ca00.cc.h4 ; 56 with names starting with
Ca00.cr and 64 with names starting with
Ca00.cv (see Table 12 inAppendix E), and 1 curve
Ca00.gs . This is not the only way to construct non-self-similar, vertex-gated, face-continuous, octant-by-octant space-fillingcurves. One can also construct such curves using a combination of base patterns from
Ca00 , Cl00 , and
Si00 , even though
Cl00 does not support self-similar face-continuous curves by itself. , ..., d were numberedfrom d − (cid:20) (cid:27) (cid:20) (cid:27) (cid:20) (cid:27) - (cid:20) - - (cid:27) (cid:20) - - (cid:27) (cid:20) - - (cid:27) - (cid:20) - - (cid:27) - (cid:20) - - (cid:27) (cid:26) - - - (cid:21) (cid:26) - - - (cid:21) (cid:26) - - - (cid:21) - (cid:26) - - - (cid:21) - (cid:26) - - - (cid:21) (cid:26) - (cid:21) - (cid:26) - (cid:21) - (cid:26) - (cid:21) Harmonious (cid:20) (cid:27) (cid:20) (cid:27) (cid:20) (cid:27) - (cid:20) - - (cid:27) (cid:20) - - (cid:27) (cid:20) - - (cid:27) - (cid:20) - - (cid:27) - (cid:20) - - (cid:27) (cid:26) - - - (cid:21) (cid:26) - - - (cid:21) (cid:26) - - - (cid:21) - (cid:26) - - - (cid:21) - (cid:26) - - - (cid:21) (cid:26) - (cid:21) - (cid:26) - (cid:21) - (cid:26) - (cid:21) A&N (cid:20) (cid:27) (cid:20) (cid:27) (cid:20) (cid:27) - (cid:20) - - (cid:27) (cid:20) - - (cid:27) (cid:20) - - (cid:27) - (cid:20) - - (cid:27) - (cid:20) - - (cid:27) (cid:26) - - - (cid:21) (cid:26) - - - (cid:21) (cid:26) - - - (cid:21) - (cid:26) - - - (cid:21) - (cid:26) - - - (cid:21) (cid:26) - (cid:21) - (cid:26) - (cid:21) - (cid:26) - (cid:21) Squared H. (cid:20) (cid:27) (cid:20) (cid:27) (cid:20) (cid:27) - (cid:20) - - (cid:27) (cid:20) (cid:27) - (cid:20) - - (cid:27) (cid:20) - - (cid:27) (cid:20) - - (cid:27) (cid:26) - (cid:21) - (cid:26) - - - (cid:21) - (cid:26) - - - (cid:21) (cid:26) - (cid:21) - (cid:26) - - - (cid:21) (cid:26) - (cid:21) - (cid:26) - (cid:21) - (cid:26) - (cid:21) The last curve results from doubling the number of coordinates of the points on the two-dimensionalHilbert curve λ , by lifting each of those coordinates to two dimensions using the same Hilbert-curvemapping λ . We use subscripts 1 and 2 to identify the first and the second coordinate, respectively, of λ ( t ), that is, λ ( t ) = ( λ ( t ) , λ ( t )). The resulting four-dimensional curve is now described by the mapping τ : [0 , → [0 , where: τ ( t ) = (cid:16) λ (cid:0) λ ( t ) (cid:1) , λ (cid:0) λ ( t ) (cid:1) , λ (cid:0) λ ( t ) (cid:1) , λ (cid:0) λ ( t ) (cid:1)(cid:17) . It can be shown that the curve τ is a (non-well-folded) four-dimensional Hilbert curve ([15], Section 6.3);a description is given in Table 9. Moreover, due to the fact that the two-dimensional Hilbert curve λ visits the points on the diagonals in order of ascending second coordinate, the curve τ visits points ofthe type ( x, y, x, y ), that is, with the first two coordinates equal to the last two coordinates, in the sameorder in which the two-dimensional Hilbert curve λ visits the corresponding points ( x, y ). There are incredibly many four-dimensional Hilbert curves
The number of Hilbert curves inhigher dimensions is subject to a combinatorial explosion that depends on the requirements one imposeson higher-dimensional Hilbert curves. To get just a glimpse of how bad this explosion can get, considerthe example of vertex-gated, edge-crossing curves. When we fix the gate sequence, we have fixed, in eachsubcube, the axis of the edge that connects the gates. For the transformation that maps τ to the curvewithin the subcube we can choose freely from the six permutations of the remaining three axes, and wecan still choose whether or not to reverse the curve. That gives us 12 choices for each of 16 subcubes,making 12 = 184 , , , , ,
416 combinations per gate sequence in total. Then we have noteven considered the number of possible gate sequences yet.
11 Evaluation and outlook
In this explorative work we discussed the question how many Hilbert curves exist in three dimensions.This question is ill-defined and the answers are debatable. No three-dimensional Hilbert curve is perfect:one can always find a combination of properties of the two-dimensional Hilbert curve that cannot berealized in three dimensions. For example, we found that in three dimensions, no octant-by-octant,self-similar space-filling curve exists whose endpoints are vertices of the unit cube and whose midpointis the centre of the unit cube. Searching for a well-defined question and its answers unlocked a worldof 10,694,807 three-dimensional space-filling curves: a large set of curves, most of which are probablyugly, but the set is small enough to search for elegant curves with interesting properties. In particular, Iselected 24 curves that I found to be somehow interesting examples, and I sketched these in Figures 15,16, 19, 20 and 24. 47urely there are more interesting curves. The (prototype) software tool may help readers in search-ing the realm of three-dimensional Hilbert curves. Furthermore, unanswered questions about locality-preserving properties abound. How do the curves differ with respect to metrics based on the average(rather than worst-case) distance between points along the curve as a function of their distance in d -dimensional space, or vice versa? How do the curves differ with respect to the average (rather than worst-case) measures of the boundary or the bounding boxes of curve sections? We may also consider expandingour territory by dropping the requirement of self-similarity (possibly trading it for vertex-gatedness andface-continuity), and attempt to describe and explore the infinite number of three-dimensional space-filling curves that will then come within scope.However, the main contribution of this work may not be the exhaustive classification and the some-times goal-oriented, sometimes curiosity-driven exploration of a particular class of three-dimensionalspace-filling curves. From this work, we may also get new ideas for different ways of constructingHilbert-like space-filling curves in arbitrary numbers of dimensions. In two dimensions there is nothingto choose, and as such, the two-dimensional Hilbert curve by itself does not show us that much aboutwhat we could try to achieve in higher dimensions. In three dimensions, we can see more. We discovereda number of interesting space-filling curves, some of which have properties that, in prior work, wereestablished to be relevant to applications.In particular, in the past years we have succeeded in generalizing the hyperorthogonal Hilbert curvesto higher dimensions [6]. It is there, in four or more dimensions, that these curves show their strengths ascompared to the common generalization from Butz, achieving an exponential improvement on the worst-case bounding-box volume ratio metric. For the harmonious Hilbert curves, a generalization to higherdimensions has been identified as well . In fact, it is the potential applications of harmony propertiesof four- and six-dimensional curves [19] that led us to studying them. Generating all 10,694,807 possiblethree-dimensional Hilbert curves, we discovered the three-dimensional harmonious Hilbert curve. Thisput us on the right track for discovering a family of unique Hilbert curves that have the harmonyproperties required by our application for any number of dimensions [15].The world of three-dimensional Hilbert curves, unlocked in this article, may contain more treasuresthat signpost the way to interesting, novel generalizations of Hilbert’s curve into higher dimensions.For example, can the well-folded, centred, standing curve Ca00.cv.4h , or the Sasburg curve,
Ca00.cT4 ,be generalized to higher dimensions in a useful way? How does the world of metasymmetric curvesdevelop in higher dimensions? Can we narrow it down to a family of Hilbert curves, one for each numberof dimensions, that are in some sense the most symmetric Hilbert curves of all? We have seen howin two dimensions, facet-gated curves are only possible by giving up self-similarity [42], while in threedimensions, one self-similar facet-gated curve exists, which is not symmetric. How do the possibilitiesfor facet-gated curves develop in higher dimensions? Is there a symmetric, facet-gated Hilbert curve infour dimensions?
Acknowledgements
Freek van Walderveen was the first to find an efficient algorithm that generates the transformations foreach subcube of the d -dimensional harmonious Hilbert curve, for any d . All calculations of metrics oflocality-preservation were made possible by Simon Sasburg, who developed the algorithm for the surfaceratio metric, and who extended and improved our previous algorithms for the dilation and bounding-box metrics to be able to handle three- and higher-dimensional curves. The numerical notation systemintroduced in Section 2.3 is based on a notation technique from Arie Bos, adapted to suit the needs ofthe present article. References [1] D. J. Abel and D. M. Mark. A comparative analysis of some two-dimensional orderings.
Int. J.Geographic Information Systems , 4(1):21–31 (1990)[2] J. Alber and R. Niedermeier. On multidimensional curves with Hilbert property.
Theory of Com-puting Systems , 33(4):295–312 (2000) Van Walderveen was the first to find an algorithm to construct a compact description of such a curve for any numberof dimensions. Later I found a simpler algorithm with a not-so-simple correctness proof [15].
Theoretical Computer Science
Space-filling curves: an introduction with applications in scientific computing . Springer(2013)[5] M. Bader and C. Zenger. Cache oblivious matrix multiplication using an element ordering based ona Peano curve.
Linear Algebra and its Applications
J. Computational Geometry ,7(2):145–190 (2016)[7] H.-J. Bungartz, M. Mehl, and T. Weinzierl. A parallel adaptive Cartesian PDE solver using space-filling curves. , LNCS 4128:1064–1074, 2006.[8] A. R. Butz. Alternative algorithm for Hilbert’s space-filling curve.
IEEE Trans. Comp. , 20(4):424–426 (1971)[9] G. Chochia and M. Cole.
Recursive 3D mesh indexing with improved locality.
Technical Report,University of Edinburgh (1997)[10] C. Faloutsos and S. Roseman. Fractals for secondary key retrieval. In , pp 247–252 (1989)[11] P. Fishburn, P. Tetali, and P. Winkler. Optimal linear Arrangement of a rectangular grid.
DiscreteMath.
Scientific American , 235(6):124–133 (1976)[13] C. Gotsman and M. Lindenbaum. On the metric properties of discrete space-filling curves.
IEEETrans. Image Processing , 5(5):794–797 (1996)[14] D. F. Harlacher, H. Klimach, S. Roller, C. Siebert, and F. Wolf. Dynamic load balancing forunstructured meshes on space-filling curves. In , pp 1661–1669 (2012)[15] H. Haverkort. Harmonious Hilbert curves and other extradimensional space-filling curves.
CoRR ,abs/1211.0175 (2012)[16] H. Haverkort. An inventory of three-dimensional Hilbert space-filling curves.
CoRR , abs/1109.2323(2011)[17] H. Haverkort. Recursive tilings and space-filling curves with little fragmentation.
J. ComputationalGeometry , 2(1):92–127 (2011)[18] H. Haverkort and F. van Walderveen. Locality and bounding-box quality of two-dimensional space-filling curves.
Comput. Geom. , 43(2):131–147 (2010)[19] H. Haverkort and F. van Walderveen. Four-dimensional Hilbert curves for R-trees.
ACM J. Exper-imental Algorithmics , 16:3.4 (2011)[20] D. Hilbert. ¨Uber die stetige Abbildung einer Linie auf ein Fl¨achenst¨uck.
Math. Ann. , 38(3):459–460(1891)[21] J. Hungersh¨ofer and J.-M. Wierum. On the quality of partitions based on space-filling curves.
Int.Conf. on Computational Science (ICCS 2002) , LNCS 2331:36–45 (2002)[22] Aubrey Jaffer. Recurrence for Multidimensional Space-Filling Functions.
CoRR , abs/1402.1807(2014)[23] I. Kamel and C. Faloutsos. On packing R-trees. In , pp 490–499 (1993)4924] J. K. Lawder.
Calculation of mappings between one and n-dimensional values using the Hilbertspace-filling curve.
Birkbeck University of London, School of Computer Science and InformationSystems, research report BBKCS-00-01 (2000)[25] J. K. Lawder and P. J. H. King. Querying multi-dimensional data indexed using the Hilbert spacefilling curve.
SIGMOD Record
Le¸cons sur l’int´egration et la recherche des fonctions primitives , pp 44–45. Gauthier-Villars (1904)[27] S. Liao, M. A. Lopez, and S. T. Leutenegger. High dimensional similarity search with space fillingcurves. , pp 615–622 (2001)[28] G. Mitchison and R. Durbin. Optimal numberings of an N × N array. Siam J. Alg. Disc. Meth.
Distributed andParallel Databases
IEEE Trans. Knowledge and Data Engineering (2000), retrieved 24 July 2015.[32] E. H. Moore. On certain crinkly curves.
Trans. Amer. Math. Soc.
DiscreteApplied Mathematics , 117:211–237 (2002)[35] R. Niedermeier and P. Sanders.
On the Manhattan-distance between points on space-filling mesh-indexings.
Technical Report IB 18/96, Karlsruhe University, Dept. of Computer Science (1996)[36] G. Peano. Sur une courbe, qui remplit toute une aire plane.
Math. Ann. , 36(1):157–160 (1890)[37] L. K. Platzman and J. J. Bartholdi III. Spacefilling curves and the planar travelling salesmanproblem.
J of the ACM (2013), retrievedJuly 2016.[39] H. Sagan.
Space-filling curves . Universitext. Springer. (1994)[40] S. Sasburg.
Approximating average and worst-case quality measure values for n -dimensional space-filling curves. Master’s thesis, Eindhoven University of Technology (2011)[41] D. Voorhies. Space-filling curves and a measure of coherence. In J. Arvo (ed.),
Graphics Gems II ,p26–30, Academic Press (1991)[42] J.-M. Wierum.
Definition of a new circular space-filling curve: β Ω -indexing. Technical ReportTR-001-02, Paderborn Center for Parallel Computing (PC ) (2002)[43] J.-M. Wierum. Logarithmic path-length in space-filling curves. In , pp 22–26 (2002)[44] P. Xu and S. Tirthapura. Optimality of clustering properties of space-filling curves. ACM Trans.on Database Systems
IEEE Trans. Visualization andComputer Graphics
Example curves
Table 10 lists the example curves in this article with their properties and their descriptions in the styleof Section 2.3. Table 10: Example curves in this articlename nickname description prop. figures
Ca00.chI (cid:104) (cid:111) (cid:104) (cid:111) (cid:104) (cid:111) - (cid:104) - - (cid:111) (cid:110) - (cid:105) (cid:110) - (cid:105) - (cid:110) - (cid:105) - (cid:110) - (cid:105) fpsv 15e Ca00.cT4
Sasburg (cid:104) (cid:111) (cid:104) (cid:111) (cid:104) (cid:111) - (cid:104) - - (cid:111) (cid:110) - (cid:105) (cid:110) - (cid:105) - (cid:110) - (cid:105) - (cid:110) - (cid:105) bfimpv 15d Ca00.cT7
Imposter (cid:104) (cid:111) (cid:104) (cid:111) (cid:104) (cid:111) - (cid:104) - - (cid:111) (cid:110) - (cid:105) (cid:110) - (cid:105) - (cid:110) - (cid:105) - (cid:110) - (cid:105) fimpv 9,15f Ca00.c4I
Butz (cid:104) (cid:111) (cid:104) (cid:111) (cid:104) (cid:111) - (cid:104) - - (cid:111) (cid:110) - - - (cid:105) (cid:110) - (cid:105) - (cid:110) - (cid:105) - (cid:110) - (cid:105) bfpsv 3,15b Ca00.c4Z
Harmonious (cid:104) (cid:111) (cid:104) (cid:111) (cid:104) (cid:111) - (cid:104) - - (cid:111) (cid:110) - - - (cid:105) (cid:110) - (cid:105) - (cid:110) - (cid:105) - (cid:110) - (cid:105) fhipv 2,15a Ca00.cc.44.hh.db
Alfa (cid:104) (cid:111) (cid:104) (cid:111) (cid:110) - (cid:105) - (cid:104) - - (cid:111) (cid:110) - - - (cid:105) (cid:104) - - (cid:111) - (cid:110) - (cid:105) - (cid:110) - (cid:105) bfilov 5c,15c Ca00.cv.4h
Base camp (cid:104) (cid:111) (cid:110) - - (cid:105) (cid:104) - (cid:111) - (cid:110) - - (cid:105) (cid:104) - (cid:111) (cid:110) (cid:105) - (cid:104) - (cid:111) - (cid:110) - - (cid:105) cu 3,19a Ca00.gs
Beta (cid:110) - - - (cid:105) (cid:110) - - - (cid:105) (cid:104) - - (cid:111) - (cid:110) - (cid:105) (cid:104) (cid:111) (cid:110) - (cid:105) - (cid:104) - - (cid:111) - (cid:104) - - (cid:111) bfilo 24 Ca11.cTJ
Wind-fold (cid:104) (cid:111) (cid:104) (cid:111) - (cid:104) - (cid:111) (cid:104) - (cid:111) (cid:110) (cid:105) - (cid:110) - - (cid:105) - (cid:110) - (cid:105) - (cid:110) - (cid:105) impv 15h Cd00.cPJ (cid:104) (cid:111) (cid:104) - (cid:111) (cid:104) (cid:111) - (cid:104) - - - (cid:111) - (cid:110) - (cid:105) (cid:110) - - (cid:105) (cid:110) - (cid:105) - (cid:110) - - (cid:105) dimpv 16d Cd00.ct.4h
Indoor stroll (cid:104) (cid:111) (cid:110) - - (cid:105) (cid:104) - (cid:111) - (cid:110) - - (cid:105) - (cid:104) - - (cid:111) (cid:110) - (cid:105) (cid:104) (cid:111) - (cid:110) - (cid:105) cu 19c Cd00.rv.3C (cid:104) - (cid:111) (cid:104) - - (cid:111) (cid:110) - (cid:105) - (cid:110) - - (cid:105) - (cid:104) - - (cid:111) (cid:110) - (cid:105) (cid:104) (cid:111) - (cid:104) - - - (cid:111) i 20b Cd11.cP4 (cid:104) (cid:111) (cid:104) - (cid:111) - (cid:104) - (cid:111) (cid:104) - - (cid:111) - (cid:110) (cid:105) - (cid:110) - - - (cid:105) (cid:110) - (cid:105) - (cid:110) - - (cid:105) dimpv 16c Ce11.ct.P9
Outdoor stroll (cid:104) (cid:111) (cid:110) - - (cid:105) - (cid:104) - - (cid:111) (cid:110) - (cid:105) - (cid:104) - (cid:111) (cid:110) (cid:105) - - (cid:104) - - (cid:111) (cid:110) - (cid:105) cu 19d Cl00.cf.ff.dd (cid:104) (cid:111) (cid:110) - - - (cid:105) (cid:104) - - (cid:111) - (cid:110) - - (cid:105) (cid:104) - (cid:111) - (cid:110) - (cid:105) (cid:104) (cid:111) (cid:110) - (cid:105) u 3,20a Cu00.cc.4d.4d.Z7
Long-legs (cid:110) - - (cid:105) (cid:104) - (cid:111) (cid:110) (cid:105) - (cid:104) - (cid:111) - (cid:104) - (cid:111) (cid:104) - - (cid:111) (cid:110) - (cid:105) - (cid:104) - - (cid:111) iv 3,16e La13.cv.II
Perfect fit (cid:104) (cid:111) (cid:110) - (cid:105) (cid:104) (cid:111) - (cid:110) - - (cid:105) - (cid:104) - - (cid:111) (cid:110) - (cid:105) - - (cid:104) - - - (cid:111) - (cid:110) - - (cid:105) i 19e Ll36.cc.II.hT.33
Rough-edge (cid:104) (cid:111) (cid:104) (cid:111) - (cid:110) - - (cid:105) - (cid:104) - - - (cid:111) - (cid:110) - (cid:105) - (cid:110) - - - (cid:105) (cid:104) - (cid:111) - (cid:110) - - (cid:105) v 16h Ll36.cc.II.CC.J3
Big cross (cid:104) (cid:111) (cid:110) - - (cid:105) - (cid:104) - - (cid:111) - (cid:110) - (cid:105) - (cid:104) - (cid:111) - (cid:110) - - - (cid:105) (cid:104) - (cid:111) - (cid:110) - - (cid:105) iv 3,16f Se00.cT7
Pirouette (cid:104) (cid:111) (cid:104) - (cid:111) (cid:104) (cid:111) (cid:104) - (cid:111) - - (cid:110) - (cid:105) (cid:110) - - (cid:105) - (cid:110) - (cid:105) (cid:110) - - (cid:105) dimpv 16a Se33.c7T
Mosquito (cid:104) (cid:111) (cid:104) (cid:111) (cid:104) - (cid:111) - - (cid:104) - - - (cid:111) - (cid:110) - (cid:105) - (cid:110) - - - (cid:105) (cid:110) - - (cid:105) - (cid:110) - - (cid:105) ipv 16g Se66.cT3
Helix (cid:104) - - (cid:111) - (cid:104) - (cid:111) (cid:104) - (cid:111) (cid:104) (cid:111) - - (cid:110) - - (cid:105) (cid:110) - (cid:105) - (cid:110) - (cid:105) - (cid:110) (cid:105) dmpv 16b Si00.cc.LT.I3.II (cid:104) (cid:111) (cid:104) (cid:111) (cid:104) (cid:111) (cid:104) (cid:111) - (cid:104) - - (cid:111) - (cid:104) - - (cid:111) (cid:104) (cid:111) - (cid:104) - - (cid:111) dfpsv 15g Si11.ct.P9
Rollercoaster (cid:104) (cid:111) (cid:110) - - (cid:105) (cid:104) (cid:111) - (cid:110) - (cid:105) - - (cid:104) - - (cid:111) (cid:110) - (cid:105) - (cid:104) - (cid:111) - (cid:110) - - (cid:105) cdi 19b Listed properties are: b: optimal worst-case curve section shapes as measured by WS, WBVand/or WBS; c: centred;d: fully interior-diagonal-harmonious; f: face-continuous; h: maximally facet-harmonious; i: pattern-isotropic; l: op-timal dilation WL , WL and/or WL ∞ ; m: metasymmetric; o: hyperorthogonal; p: order-preserving; s: coordinate-shifting; u: standing; v: vertex-gated. Symmetric curves are recognized by a name of the form P cmm. c sq . Well-foldedcurves are recognized by a name starting with Ca00 . No full harmony
Theorem 13
No three-dimensional Hilbert curve can harmonize with the two-dimensional Hilbert curveon every facet.
Proof: Let A be the first octant in the traversal, and let B , C , and D be the octants that share anoctant facet with A , in the order in which they are visited. Let A (cid:48) , B (cid:48) , C (cid:48) and D (cid:48) be the octants thatare opposite of A , B , C and D , respectively, with respect to the centre of the cube. If we know that anoctant X is visited before an octant Y , we will write X ≺ Y . So we have A ≺ B ≺ C ≺ D .To match the two-dimensional Hilbert curve on the unit cube facets adjacent to A , we must have B ≺ D (cid:48) ≺ C ; B ≺ C (cid:48) ≺ D ; and C ≺ B (cid:48) ≺ D ; we can summarize this by A ≺ B ≺ D (cid:48) ≺ C ≺ B (cid:48) ≺ D and B ≺ C (cid:48) ≺ D . In particular, we have D (cid:48) ≺ C ≺ B (cid:48) , so, to get their common unit cube facet withoctants A (cid:48) , B (cid:48) , C and D (cid:48) correct, we need to visit A (cid:48) either (a) after B (cid:48) or (b) before D (cid:48) . These twooptions are illustrated in Figure 25a and 25b, respectively, and we will now discuss them in detail.Option (a): Since we now have B ≺ D (cid:48) ≺ C ≺ B (cid:48) ≺ A (cid:48) , and B ≺ C (cid:48) , we can only get the commonunit cube facet of B , D (cid:48) , A (cid:48) and C (cid:48) correct if we visit these octants in that order. The partial orderthus obtained can only be completed in one way: A ≺ B ≺ D (cid:48) ≺ C ≺ B (cid:48) ≺ A (cid:48) ≺ C (cid:48) ≺ D . Thistraces out the Ca00 -pattern, as illustrated in Figure 25a. Now the second-order approximating curves ofthe two-dimensional Hilbert curves on the unit cube facets bordering D (cid:48) induce a partial order on thesuboctants of D (cid:48) , as illustrated in the centre of the figure. The partial order can be completed to a fullorder, for example with an Si00 -pattern, but not with a
Ca00 -pattern. Therefore a self-similar solutionbased on the
Ca00 -pattern is not possible.Option (b): Since we now have A (cid:48) ≺ D (cid:48) , B ≺ D (cid:48) and B ≺ C (cid:48) , we can only get the common unitcube facet of B , C (cid:48) , A (cid:48) and D (cid:48) correct if we visit these octants in that order. The partial order thusobtained can only be completed in one way: A ≺ B ≺ C (cid:48) ≺ A (cid:48) ≺ D (cid:48) ≺ C ≺ B (cid:48) ≺ D . This traces outthe Si00 -pattern, as illustrated in Figure 25b. Now the second-order approximating curves of the two-dimensional Hilbert curves on the unit cube facets bordering B induce a partial order on the suboctantsof B , as illustrated in the centre of the figure. The partial order can be completed to a full order thatfollows an Si00 -pattern, but only in such a way that the traversal of B ends in a suboctant that is notadjacent to the next octant, C (cid:48) . Therefore a continuous self-similar traversal based on the Si00 -patternis not possible.So, in both cases we find that no traversal is possible that has the defining properties of a three-dimensional Hilbert curve and matches the two-dimensional Hilbert curve on every facet of the unitcube. (cid:117)(cid:116) BD C B A C D (a) ABD C B A C D (b) Figure 25: (a) No three-dimensional Hilbert curve with the
Ca00 -pattern can harmonize with the two-dimensional Hilbert curve on all facets: in the third octant, one can get A correct with a Si00 -pattern butnot with a
Ca00-pattern . (b) No three-dimensional Hilbert curve with the
Si00 -pattern can harmonizewith the two-dimensional Hilbert curve on all facets: to get A correct in the second octant, one wouldhave to place the pattern such that the exit gate does not connect to the third octant.53 Equivalence relations between dilation, diameter ratio, and L i -bounding ball ratio Theorem 14
The L i -dilation of any space-filling curve is equal to its L i -diameter ratio, for any i . Proof: Consider a space-filling curve τ and two points a, b ∈ [0 ,
1] with a ≤ b . Let x, y , with a ≤ x ≤ y ≤ b ,be a pair of points that determines the diameter of C ( a, b ) and is closest along the curve, that is, withminimum y − x . Since C ( x, y ) ⊆ C ( a, b ) and δ i ( τ ( x ) , τ ( y )) ≥ δ i ( τ ( a ) , τ ( b )), reducing the curve sectionunder consideration from C ( a, b ) to C ( x, y ) can only increase its dilation δ i ( τ ( a ) , τ ( b )) d / ( b − a ) and itsdiameter ratio diam i ( C ( a, b )) d / ( b − a ); when C ( a, b ) shrinks to C ( x, y ) both will rise to the same value δ i ( τ ( x ) , τ ( y )) d / ( y − x ). Therefore, WL i and WD i are determined by the same point pairs and have thesame value. (cid:117)(cid:116) Since the L ∞ -diameter of the minimum bounding L ∞ -ball of any set S is equal to the L ∞ -diameterof S , we also have: Theorem 15
The L ∞ -bounding ball ratio of any space-filling curve is equal to its L ∞ -diameter ratio. I conjecture that the L -bounding ball ratio also equals the L -diameter ratio, but I can prove thisonly for two-dimensional space-filling curves: Theorem 16
For two-dimensional space-filling curves, WL = WD = WBB . Proof: We will first prove that for the L -metric in two dimensions, the worst-case bounding ball ratioWBB is realized by a curve section C ( a, b ) whose bounding ball is determined by exactly two points of C ( a, b ). Suppose that, on the contrary, the worst bounding ball ratio is only realized by curve sections C ( a, b ) whose bounding balls are determined by three points x, y, z ∈ [ a, b ]. Let ∆ be the trianglewith vertices τ ( x ), τ ( y ) and τ ( z ), and let ξ , υ and ζ be the angles of ∆ at the vertices τ ( x ), τ ( y ) and τ ( z ), respectively. The smallest bounding ball is then the circumscribed circle of ∆, which must be anacute triangle, and the circumscribed circle has diameter δ ( τ ( x ) , τ ( y )) / sin( ζ ) = δ ( τ ( y ) , τ ( z )) / sin( ξ ).If [ a, b ] (cid:54) = [ x, z ], then shrinking C ( a, b ) to C ( x, z ) would increase the bounding ball ratio, so we must have a = x and b = z . Since the distance between the end points of a curve section is a lower bound on thebounding ball ratio, and, by assumption, no worst-case bounding ball is determined by only two points,we get: δ ( τ ( x ) , τ ( y )) / sin ( ζ ) / ( z − x ) = diam (bbaldiam( C ( x, z ))) / ( z − x ) > δ ( τ ( x ) , τ ( y )) / ( y − x ), andthus, ( y − x ) / ( z − x ) > sin ( ζ ). Analogously, we get ( z − y ) / ( z − x ) > sin ( ξ ), and thus, sin ( ζ )+sin ( ξ ) < (( z − y ) + ( y − x )) / ( z − x ) = 1. However, since ∆ is acute, we have π/ > ξ = π − υ − ζ > π/ − ζ ,and therefore sin ( ζ ) + sin ( ξ ) > sin ( ζ ) + sin ( π/ − ζ ) = sin ( ζ ) + cos ( ζ ) = 1: a contradiction.Therefore, there must be curve sections C ( a, b ) that determine the worst-case bounding ball ratio andhave a bounding ball determined by only two points, which must also determine the diameter of C ( a, b ).Hence the worst-case bounding ball ratio WBB is a lower bound on the worst-case diameter ratio WD ,which, by Theorem 14, equals the dilation WL .Since the diameter ratio of any curve section is also a lower bound on the bounding ball ratio, itfollows that under the L -metric in two dimensions, the worst-case dilation, the worst-case diameterratio and the worst-case bounding ball ratio are all equal. (cid:117)(cid:116) Verifying the list of base patterns
To verify Table 5, we will first analyse how many base patterns there could be. We ignore reversal for themoment, and get back to that later. Let a vector ( x , x , x ) represent the octant that includes the unitcube vertex ( x , x , x ), assuming a unit cube of volume 1, centered at the origin. We say that a basepattern is in directed canonical form if it starts with octant ( − , − , − − , − , +1),( − , +1 , −
1) and (+1 , − , −
1) appear in that order, possibly with other octants in between. We canreflect and rotate any given octant order into directed canonical form in two steps, as follows. First, if thefirst octant is ( x , x , x ), then, for any i such that x i = 1, we reflect the pattern in the axis-parallel planethrough the origin that is orthogonal to the i -th coordinate axis. In effect, we change the coordinatesof any octant ( y , y , y ) to ( − x y , − x y , − x y ). As a result, the pattern now starts with octant( − , − , − − , − , +1),( − , +1 , −
1) and (+1 , − , −
1) appear in that order.Now observe that there are 840 directed canonical octant orders, as each of them can be constructedby starting with the sequence S , ..., S = ( − , − , − , ( − , − , +1) , ( − , +1 , − , (+1 , − , − S = ( − , +1 , +1) , S = (+1 , − , +1) , S =(+1 , +1 , −
1) and S = (+1 , +1 , +1). For the i -th octant to be inserted ( i ≥ i − S , ..., S i − ). Thus the total number of canonical octant ordersis 4 · · · r i be the position where S i is inserted in the aforementioned incremental construction of a givencanonical order ρ ; more precisely, let r i be the number of octants from S , ..., S i − that precede S i in ρ .Then we identify ρ by the number (( r · r ) · r ) · r .To verify the correctness and completeness of the list of base patterns in Table 5, we compare it tothe simple numbering scheme presented above. The search tool described in Section 8 has an option to iterate over all possible names of base patterns according to Table 5, and to output, for each name,the numerical identifier of the directed canonical form of the pattern. More precisely, if the nameindicates a symmetric order, the tool outputs the numerical identifier of the directed canonical form ofthat order. If the name indicates an asymmetric order, the tool outputs the numerical identifiers ofthe directed canonical forms of that order and its reverse. One may now verify that the tool outputseach of the numbers { , ..., } exactly once. Note that this is consistent with the counts of symmetricand asymmetric patterns in the table: one directed canonical form for each of 104 symmetric patterns,and two canonical forms for each of 368 asymmetric patterns, adds up to 840 directed canonical forms.This confirms that our naming scheme has a unique name for each possible base pattern, given that weconsider patterns that only differ by reflection, rotation and/or reversal to be equivalent. Start it with: hilbex patterns Full list of gate sequences
Table 11 lists all gate sequences for vertex-gated curves: each entry of the table consists of a prefix andone or more completions.Tables 12 and 13 list all gate sequences for vertex-edge-gated curves: each entry of the table consistsof a prefix, one or more options for the symbol specifying the gates in the first half of the curve, and oneor more options for the symbol specifying the gates in the second half of the curve. Each combination ofa prefix, one symbol from the second column, and one symbol from the third column, constitutes a gatesequence name for a vertex-edge-gated curve.Table 14 lists the remaining gate sequences, that is, for vertex-facet-gated, edge-gated, and facet-gatedcurves.Figure 26 shows all base patterns that are realized by one or more Hilbert curves.Table 11: Gate sequences for vertex-gated curves. Symmetric sequences in boldface.edge-crossing curves
Ca00.cc. hhhhhhhh h4 TTTTTTTT 44444444 La11.cc. hhhhhhhh TTTTTTTT Se09.cc. LL TTCa01.cc. hh h4 4h 44 La77.cc. hhhhhhhh TTTTTTTT Si00.cc. LTCa11.cc. hhhhhhhh h4 TTTTTTTT 44444444 Ll77.cc. hT Yi00.cc. LTCk01.cc. hT 4T Se06.cc. hh Yz00.cc. LT hLCk11.cc. hT T4 Se08.cc. hh facet-crossing curves
Cd00.cc. IIIIIIII Ih IP IX I4 La36.cc. hI hX Se6b.cc. Phhhhhhhhh hP hX h4 PPPPPPPP La37.cc. LE Sebb.cc. bbbbbbbbPX P4 XXXXXXXX X4 44444444 La6c.cc. Ih Xh Si06.cc. IC IE LP CP PCCd02.cc. I4 h4 P4 X4 44 La7c.cc. EL EC PE EP XC XE JPCd11.cc. PPPPPPPP La7d.cc. EC Si0b.cc. TbCd22.cc. 44444444 Ll16.cc. LL LJ EL EJ JL JJ Si16.cc. IC IE XC XECe00.cc. bbbbbbbb bd dddddddd Ll36.cc. II IX bI bX Si1b.cc. Lh JhCe01.cc. IP hP PP XP 4P Ll37.cc. LE Si36.cc. 7TCe02.cc. bd dd Ll6d.cc. IT XT Si3b.cc. ZhCe12.cc. P4 Ll7c.cc. PI Pb PT EL EC Yh06.cc. TC CTCe22.cc. dddddddd Ll7d.cc. EC Yh26.cc. JTCu00.cc. Ib Id hb hd Pb Ne00.cc. bbbbbbbb bd dddddddd Yi26.cc. XCPd Xb Xd 4b 4d Ne05.cc. LL LC JL JC Yi36.cc. XCCu01.cc. bP dP Ne55.cc. IIIIIIII IT TTTTTTTT Yk36.cc. JCCu02.cc. Id hd Pd Xd 4d Se00.cc. TTTTTTTT Yo36.cc. JCCu20.cc. 4b 4d Se01.cc. LL LJ CL CJ Yz06.cc. TCCu21.cc. dP EL EJ JL JJ Yz60.cc. TCCu22.cc. 4d Se03.cc. LZ CZ EZ JZ Yz62.cc. TJ CXLa16.cc. LL LJ EL EJ JL JJ Se33.cc. 77777777 Yz63.cc. CXLa17.cc. IP PP XP Se66.cc. TTTTTTTT C , L or N Ca00.cr. [ I3 ][ bCPJ47 ] Ca00.cr. [ LhTX ][ EdZ9 ] Ca00.cr. [ bCPJ47 ][ I3 ] Ca00.cr. [ EdZ9 ][ LhTX ] Ca00.cv. [ I3 ][ EdZ9 ] Ca00.cv. [ LhTX ][ I3 ] Ca00.cv. [ bCPJ47 ][ LhTX ] Ca00.cv. [ EdZ9 ][ bCPJ47 ] Ca01.cr. [ bCPJ47 ][ b ] Ca01.cv. [ bCPJ47 ][ Lh ] Ca01.cv. [ EdZ9 ][ I ] Ca01.rc. [ I3 ][ ICPJ4 ] Ca01.rc. [ LhTX ][ TX ] Ca01.vc. [ bCPJ47 ][ Ed ] Ca01.vc. [ EdZ9 ][ CPJ43 ] Ca02.cr. [ I3 ][ ] Ca02.cr. [ LhTX ][ dZ ] Ca02.cv. [ I3 ][ dZ ] Ca02.cv. [ EdZ9 ][ ] Ca11.cr. [ TXZ9 ][ Lh ] Ca11.cr. [ CPJ43 ][ b ] Ca11.cr. [ ][ I ] Ca11.cv. [ ICPJ4 ][ Lh ] Ca11.cv. [ LhEd ][ b ] Ca11.cv. [ TX ][ I ] Ca12.cr. [ Ed ][ dZ ] Ca12.cv. [ TX ][ ] Cd00.ct. [ I3 ][ EdZ9 ] Cd00.ct. [ bCPJ47 ][ LhTX ] Cd00.cv. [ I3 ][ EdZ9 ] Cd00.cv. [ bCPJ47 ][ LhTX ] Cd01.ct. [ bCPJ47 ][ LhEd ] Cd01.cv. [ bCPJ47 ][ Lh ] Cd01.tc. [ LhTX ][ CPJ43 ] Cd01.vc. [ LhTX ][ ICPJ4 ] Cd02.cv. [ I3 ][ dZ ] Cd11.ct. [ CPJ43 ][ LhEd ] Cd11.ct. [ ][ TX ] Cd11.cv. [ ICPJ4 ][ Lh ] Ce00.cr. [ LhTX ][ EdZ9 ] Ce00.cr. [ bCPJ47 ][ I3 ] Ce00.ct. [ bCPJ47 ][ EdZ9 ] Ce00.ct. [ EdZ9 ][ I3 ] Ce01.cr. [ I3 ][ I ] Ce01.cr. [ bCPJ47 ][ b ] Ce01.cr. [ EdZ9 ][ Lh ] Ce01.ct. [ I3 ][ Ed ] Ce01.ct. [ LhTX ][ CPJ43 ] Ce01.ct. [ bCPJ47 ][ TXZ9 ] Ce01.ct. [ EdZ9 ][ ] Ce01.rc. [ I3 ][ CPJ43 ] Ce01.rc. [ LhTX ][ TXZ9 ] Ce01.rc. [ bCPJ47 ][ ] Ce01.rc. [ EdZ9 ][ Ed ] Ce01.tc. [ I3 ][ TX ] Ce01.tc. [ LhTX ][ b ] Ce01.tc. [ bCPJ47 ][ LhEd ] Ce01.tc. [ EdZ9 ][ ICPJ4 ] Ce02.cr. [ LhTX ][ dZ ] Ce11.cr. [ CPJ43 ][ b ] Ce11.ct. [ ICPJ4 ][ TXZ9 ] Ce11.ct. [ TX ][ ] Ce12.cr. [ Ed ][ dZ ] Ce12.cr. [ ][ ] Ck00.cr. [ bCPJ47 ][ I3 ] Ck00.cv. [ bCPJ47 ][ EdZ9 ] Ck01.cr. [ bCPJ47 ][ ] Ck01.cr. [ EdZ9 ][ ] Ck01.cv. [ bCPJ47 ][ Z9 ] Ck01.rc. [ I3 ][ ICPJ4 ] Ck01.rc. [ LhTX ][ b ] Ck01.vc. [ bCPJ47 ][ ] Ck01.vc. [ EdZ9 ][ CPJ43 ] Ck11.cr. [ ICPJ4 ][ ] Ck11.cr. [ LhEd ][ Z9 ] Ck11.cr. [ TX ][ ] Ck11.cv. [ TXZ9 ][ ] Ck11.cv. [ CPJ43 ][ Z9 ] Ck11.cv. [ ][ ] Ck12.cr. [ b ][ hT ] Ck12.cv. [ ][ bC ] Cu00.ct. [ I3 ][ I3 ] Cu00.ct. [ bCPJ47 ][ EdZ9 ] Cu00.cv. [ I3 ][ bCPJ47 ] Cu00.cv. [ bCPJ47 ][ EdZ9 ] Cu00.rc. [ I3 ][ bCPJ47 ] Cu00.rc. [ bCPJ47 ][ LhTX ] Cu00.tc. [ LhTX ][ EdZ9 ] Cu00.tc. [ EdZ9 ][ bCPJ47 ] Cu01.ct. [ I3 ][ ] Cu01.ct. [ LhTX ][ CPJ43 ] Cu01.ct. [ bCPJ47 ][ TXZ9 ] Cu01.ct. [ EdZ9 ][ Ed ] Cu01.cv. [ I3 ][ ] Cu01.cv. [ bCPJ47 ][ Z9 ] Cu01.cv. [ EdZ9 ][ ] Cu01.rc. [ I3 ][ CPJ43 ] Cu01.rc. [ LhTX ][ TXZ9 ] Cu01.rc. [ bCPJ47 ][ Ed ] Cu01.rc. [ EdZ9 ][ ] Cu01.tc. [ I3 ][ b ] Cu01.tc. [ LhTX ][ TX ] Cu01.tc. [ bCPJ47 ][ LhEd ] Cu01.tc. [ EdZ9 ][ ICPJ4 ] Cu02.cv. [ I3 ][ bC ] Cu10.ct. [ ICPJ4 ][ EdZ9 ] Cu10.cv. [ CPJ43 ][ EdZ9 ] Cu10.rc. [ b ][ bCPJ47 ] Cu10.tc. [ TXZ9 ][ bCPJ47 ] Cu11.ct. [ ICPJ4 ][ TXZ9 ] Cu11.ct. [ TX ][ Ed ] Cu11.cv. [ CPJ43 ][ Z9 ] Cu11.rc. [ b ][ CPJ43 ] Cu11.tc. [ TXZ9 ][ ICPJ4 ] Cu11.tc. [ ][ b ] Cu20.rc. [ ][ LhTX ] Cu21.rc. [ ][ Ed ] Cu21.rc. [ dZ ][ ] La11.cr. [ ][ hTX ] La11.cr. [ ][ bCJ ] La11.cv. [ I ][ ] La11.cv. [ L ][ ] La13.cv. [ I ][ I ] La16.cr. [ ][ TX ] La16.cr. [ ][ CJ ] La16.ct. [ I ][ ] La16.ct. [ L ][ ] La17.cr. [ ][ ] La17.cr. [ ][ ] La17.ct. [ I ][ TX ] La17.ct. [ L ][ CJ ] La17.rc. [ hTX ][ h ] La17.rc. [ bCJ ][ b ] La17.tc. [ hTX ][ ] La17.tc. [ bCJ ][ Z ] La1c.ct. [ ][ E ] La1c.ct. [ ][ LhT ] La1d.ct. [ ][ Lh ] La37.tc. [ X ][ ] La67.rc. [ TX ][ h ] La67.rc. [ CJ ][ b ] La67.vc. [ h ][ ] La67.vc. [ b ][ Z ] La77.cr. [ ][ I ] La77.cr. [ Z ][ L ] La7c.cv. [ ][ bCP ] La7c.cv. [ Z ][ I ] La7d.cv. [ ][ CP ] Ll16.ct. [ I ][ ] Ll16.cv. [ ][ Z ] Ll17.ct. [ I ][ TX ] Ll17.rc. [ bCJ ][ b ] Ll17.tc. [ hTX ][ ] Ll1c.ct. [ ][ bCP ] Ll1c.ct. [ ][ LhT ] Ll1c.cv. [ I ][ bCP ] Ll1c.cv. [ L ][ LhT ] Ll1d.ct. [ ][ Lh ] Ll1d.cv. [ I ][ CP ] Ll37.tc. [ X ][ ] Ll67.rc. [ CJ ][ b ] Ll67.vc. [ h ][ ] Ll77.cr. [ b ][ ] Ll7c.cv. [ h ][ dZ9 ] Ll7c.cv. [ b ][ J47 ] Ll7d.cv. [ b ][ J4 ] Na00.cr. [ TX ][ Ed ] Na00.cr. [ Ed ][ TX ] Na00.cv. [ TX ][ I3 ] Na00.cv. [ CPJ4 ][ Lh ] Na00.cv. [ Ed ][ b7 ] Na01.cv. [ TX ][ b ] Na01.cv. [ CPJ4 ][ Lh ] Na01.rc. [ Ed ][ Ed ] Na01.vc. [ I3 ][ TX ] Na01.vc. [ Z9 ][ CPJ4 ] Na05.cv. [ Ed ][ hT ] Na11.cv. [ TX ][ I ] Na11.cv. [ CPJ4 ][ Lh ] Na11.cv. [ Ed ][ b ] Na15.cv. [ TX ][ hT ] Na15.cv. [ Ed ][ bC ] Ne00.cr. [ Ed ][ TX ] Ne00.ct. [ TX ][ b7 ] Ne00.ct. [ CPJ4 ][ Z9 ] Ne01.ct. [ TX ][ ] Ne01.ct. [ CPJ4 ][ Z9 ] Ne01.ct. [ Ed ][ ] Ne01.rc. [ TX ][ TX ] Ne01.rc. [ Ed ][ Ed ] Ne01.tc. [ I3 ][ TX ] Ne01.tc. [ b7 ][ Ed ] Ne01.tc. [ Z9 ][ CPJ4 ] Ne05.ct. [ TX ][ dZ ] Ne05.ct. [ Ed ][ ] Ne11.ct. [ CPJ4 ][ Z9 ] Ne11.ct. [ Ed ][ ] Ne15.ct. [ TX ][ ]57able 13: Vertex-edge-gated curves with partition S or Y Se00.cr. [ ICPJ4 ][ Ed7 ] Se00.cr. [ LhEd7 ][ IZ9 ] Se00.ct. [ bTXZ9 ][ Ed7 ] Se00.ct. [ CPJ43 ][ IZ9 ] Se01.cr. [ ICPJ4 ][ TX ] Se01.cr. [ bZ9 ][ Ed ] Se01.cr. [ TX3 ][ CPJ4 ] Se01.ct. [ IEd ][ Lh7 ] Se01.ct. [ Lh7 ][ I ] Se01.ct. [ bTXZ9 ][ ] Se01.ct. [ CPJ43 ][ bZ9 ] Se01.rc. [ IZ9 ][ TX ] Se01.rc. [ bCPJ4 ][ Ed ] Se01.rc. [ Ed7 ][ CPJ4 ] Se01.tc. [ IZ9 ][ CPJ4 ] Se01.tc. [ LhTX3 ][ TX ] Se01.tc. [ Ed7 ][ Ed ] Se02.cr. [ LhEd7 ][ X ] Se03.cr. [ bZ9 ][ J ] Se06.cr. [ LhEd7 ][ ] Se06.cv. [ bTXZ9 ][ ] Se06.cv. [ CPJ43 ][ Z9 ] Se06.rc. [ Lh3 ][ TX3 ] Se06.rc. [ bTX ][ CPJ4 ] Se06.vc. [ bTXZ9 ][ CPJ4 ] Se06.vc. [ CPJ43 ][ IEd ] Se07.cv. [ IEd ][ ] Se07.cv. [ bTXZ9 ][ ] Se07.cv. [ CPJ43 ][ Z9 ] Se07.rc. [ Lh3 ][ Ed ] Se07.rc. [ bTX ][ CPJ4 ] Se07.rc. [ CPJ47 ][ TX ] Se07.vc. [ Lh7 ][ Ed ] Se07.vc. [ bTXZ9 ][ CPJ4 ] Se07.vc. [ CPJ43 ][ TX ] Se0b.cv. [ IEd ][ ] Se0b.cv. [ bTXZ9 ][ ] Se11.cr. [ CPJ4 ][ TX ] Se11.ct. [ CPJ4 ][ bZ9 ] Se11.ct. [ Ed ][ ] Se12.cr. [ TX ][ X ] Se16.cr. [ TX ][ ] Se16.cr. [ Ed ][ ] Se16.cv. [ TX ][ ] Se16.cv. [ CPJ4 ][ Z9 ] Se16.cv. [ Ed ][ ] Se16.rc. [ TX ][ Z9 ] Se16.rc. [ CPJ4 ][ Ed7 ] Se16.rc. [ Ed ][ CPJ4 ] Se16.vc. [ IZ9 ][ CPJ4 ] Se16.vc. [ Lh3 ][ bTX ] Se16.vc. [ b ][ Lh ] Se16.vc. [ ][ IEd ] Se17.cv. [ CPJ4 ][ Z9 ] Se17.cv. [ Ed ][ ] Se17.rc. [ Ed ][ CPJ4 ] Se17.vc. [ IZ9 ][ CPJ4 ] Se17.vc. [ ][ TX ] Se1b.cv. [ TX ][ ] Se26.rc. [ E ][ TX3 ] Se26.vc. [ I ][ IEd ] Se27.rc. [ E ][ Ed ] Se27.vc. [ I ][ TX ] Se36.rc. [ P ][ Z9 ] Se36.vc. [ L ][ Lh ] Se66.cr. [ TX3 ][ b ] Se66.ct. [ IEd ][ TX3 ] Se66.ct. [ CPJ4 ][ Z9 ] Se67.ct. [ IEd ][ ] Se67.ct. [ bTX ][ ] Se67.ct. [ CPJ4 ][ Z9 ] Se67.rc. [ I ][ TX ] Se67.rc. [ b ][ Ed ] Se67.tc. [ TX3 ][ TX ] Se67.tc. [ Ed7 ][ Ed ] Se67.tc. [ Z9 ][ CPJ4 ] Se6b.ct. [ IEd ][ X ] Se6b.ct. [ bTX ][ J ] Se77.ct. [ TX ][ ] Se77.ct. [ CPJ4 ][ Z9 ] Se7b.ct. [ Ed ][ J ] Si00.cr. [ ICPJ4 ][ Ed7 ] Si00.cr. [ LhEd7 ][ IZ9 ] Si00.cr. [ bZ9 ][ bCPJ4 ] Si00.cr. [ TX3 ][ LhTX3 ] Si00.ct. [ IEd ][ bCPJ4 ] Si00.ct. [ Lh7 ][ LhTX3 ] Si00.ct. [ bTXZ9 ][ Ed7 ] Si00.ct. [ CPJ43 ][ IZ9 ] Si01.cr. [ ICPJ4 ][ TX ] Si01.cr. [ bZ9 ][ CPJ4 ] Si01.ct. [ Lh7 ][ Lh7 ] Si01.ct. [ CPJ43 ][ bZ9 ] Si01.rc. [ LhTX3 ][ Ed ] Si01.rc. [ Ed7 ][ CPJ4 ] Si01.tc. [ IZ9 ][ CPJ4 ] Si01.tc. [ bCPJ4 ][ TX ] Si02.cr. [ LhEd7 ][ X ] Si02.cr. [ TX3 ][ J ] Si03.cr. [ LhEd7 ][ X ] Si03.cr. [ TX3 ][ J ] Si06.cr. [ LhEd7 ][ ] Si06.cr. [ bZ9 ][ ] Si06.cr. [ TX3 ][ Z9 ] Si06.cv. [ Lh7 ][ ] Si06.cv. [ bTXZ9 ][ ] Si06.cv. [ CPJ43 ][ Z9 ] Si06.tc. [ IEdZ9 ][ Lh ] Si06.tc. [ Lh3 ][ CPJ4 ] Si06.tc. [ bTX ][ IEd ] Si06.tc. [ CPJ47 ][ bTX ] Si06.vc. [ ICPJ4 ][ TX3 ] Si06.vc. [ LhEd7 ][ CPJ4 ] Si06.vc. [ bZ9 ][ Z9 ] Si06.vc. [ TX3 ][ Ed7 ] Si07.cv. [ Lh7 ][ ] Si07.cv. [ CPJ43 ][ Z9 ] Si07.tc. [ Lh3 ][ CPJ4 ] Si07.tc. [ CPJ47 ][ Ed ] Si07.vc. [ LhEd7 ][ CPJ4 ] Si07.vc. [ TX3 ][ TX ] Si0b.cv. [ bTXZ9 ][ ] Si11.cr. [ CPJ4 ][ TX ] Si11.ct. [ CPJ4 ][ bZ9 ] Si12.cr. [ Ed ][ J ] Si13.cr. [ TX ][ X ] Si16.cr. [ Ed ][ Z9 ] Si16.cv. [ CPJ4 ][ Z9 ] Si16.tc. [ Lh7 ][ CPJ4 ] Si16.tc. [ bZ9 ][ Lh ] Si16.vc. [ IZ9 ][ Z9 ] Si16.vc. [ Lh3 ][ CPJ4 ] Si17.cv. [ CPJ4 ][ Z9 ] Si17.tc. [ Lh7 ][ CPJ4 ] Si17.vc. [ Lh3 ][ CPJ4 ] Si1b.cv. [ Ed ][ ] Si26.vc. [ ][ Ed7 ] Si26.vc. [ ][ TX3 ] Si27.vc. [ ][ TX ] Si36.vc. [ ][ Ed7 ] Si36.vc. [ ][ TX3 ] Si37.vc. [ ][ Ed ] Yh06.ct. [ h7 ][ Ed ] Yh06.ct. [ bZ ][ P4 ] Yh06.tc. [ TX ][ L ] Yh06.tc. [ CJ ][ I ] Yh06.vc. [ TX ][ ] Yh06.vc. [ CJ ][ ] Yh26.vc. [ X3 ][ ] Yh26.vc. [ Z9 ][ ] Yi00.cr. [ bZ ][ L3 ] Yi00.ct. [ h7 ][ P4 ] Yi02.cr. [ h7 ][ Z9 ] Yi02.cr. [ bZ ][ J4 ] Yi03.cr. [ h7 ][ Z9 ] Yi06.cr. [ bZ ][ Z ] Yi06.tc. [ CJ ][ L ] Yi06.vc. [ TX ][ ] Yi26.vc. [ J4 ][ ] Yi26.vc. [ Z9 ][ ] Yi36.vc. [ J4 ][ ] Yk03.cr. [ bZ ][ b ] Yk03.cv. [ h7 ][ T ] Yk36.vc. [ d ][ ] Yo36.vc. [ d ][ ] Yz00.cr. [ bZ ][ I9 ] Yz00.cv. [ h7 ][ CJ ] Yz00.rc. [ L3 ][ h7 ] Yz00.tc. [ P4 ][ bZ ] Yz02.cr. [ h7 ][ Z9 ] Yz02.cr. [ bZ ][ X3 ] Yz02.cv. [ h7 ][ X3 ] Yz02.cv. [ bZ ][ J4 ] Yz03.cr. [ h7 ][ Z9 ] Yz03.cv. [ bZ ][ J4 ] Yz06.cr. [ bZ ][ ] Yz06.ct. [ h7 ][ Ed ] Yz06.tc. [ CJ ][ I ] Yz06.vc. [ TX ][ ] Yz20.rc. [ J4 ][ h7 ] Yz20.rc. [ Z9 ][ bZ ] Yz26.vc. [ J4 ][ ] Yz26.vc. [ Z9 ][ ] Yz60.ct. [ ][ Ed ] Yz60.cv. [ L ][ P4 ] Yz60.rc. [ Z ][ h7 ] Yz62.cv. [ I ][ CP ] Yz62.cv. [ L ][ IE ] Yz63.cv. [ I ][ CP ]58able 14: Gate sequences for vertex-facet-gated, edge-gated, and facet-gated curves.vertex-facet-gated gate sequences (256 curves per gate sequence) Cl00.cf.ee Cl00.cf.ef Cl00.cf.fe Cl00.cf.ff edge-gated curves (1 curve per gate sequence)
Cd00.rt.Ib Cd00.rt.Eb Cd00.rv.Xb Cd00.rv.3bCd00.rt.IC Cd00.rt.EC Cd00.rv.XC Cd00.rv.3CCd00.rt.IP Cd00.rt.EP Cd00.rv.XP Cd00.rv.3PCd00.rt.IX Cd00.rt.EXCd00.rt.I3 Cd00.rt.E3 facet-gated curves (1 curve per gate sequence)
Ca00.gs
Ca00 Ca01 Ca11Ck01 Ck11La11 La77Ll77 Se06Se08 Se09 Si00 Yi00Yz00Ll36Ne00 Ne55 Se00 Se01 Se33 Se66Se6bYi26 Yz06 Yz60 Yz62Cd00 Cd11 Ce00 Ce01Cu00 Cu01 La7cSebb Si06 Si0bSi1b Si36 Yh06 Yh26 Cu21Cu22 La16 La17 La36 La37 La6c La7dCd02 Cd22Ce02 Ce12Ce22 Cu02 Cu20Si16 Si3bYi36 Yk36 Yo36 Yz63Ll16 Ll37 Ll6d Ll7c Ll7dNe05 Se03La1d La67Ll17 Ll1c Ll1d Ll67 Na00 Na01Cd01 Ce11Ck00 Cu10 Cu11La13 La1c Se07Se0b Se11 Se12 Se16 Se17 Se1b Se26 Na05Na11 Na15 Ne01 Ne11 Ne15 Se02Si03 Si07 Si11 Si12 Si13Si17 Si26 Si27 Se27 Se36 Se67Se77 Se7b Si01 Si02 Yz20 Yz26Si37 Yi02 Yi03 Yi06Yk03 Yz02 Yz03Ca02 Ca12 Ck12 Cl00
Figure 26: There are 472 possible base patterns (see Table 5), but only the 126 patterns shown abovecan be realized by Hilbert curves (see Tables 11–14).59
Analytical confirmation of certain observations
Theorem 17
No three-dimensional Hilbert curve follows partition X . Proof: With partition X , each pair of octants in the first half of the traversal shares an octant edge, butno octant facet. This immediately rules out curves with facet gates.Edge-crossing vertex-gated curves are not possible, since neither of the vertices of the octant edgethat is shared by the first and the second octant is on a common octant edge with the entrance gate(the outer vertex) of the first octant. In other words, the second octant is too far from the entrance gateto be reachable by an edge-crossing vertex-gated curve in the first octant. By an analogous argument,vertex-edge-gated curves are not possible, given Theorem 4.Facet-crossing vertex-gated curves are not possible, since in such curves, the last octant is oppositeto the first octant with respect to a facet diagonal, but with partition X , all such octants are in the firsthalf of the traversal. By the same argument, edge-gated curves are not possible, given Theorem 6, whichsays that the first and the last octant must be opposite of each other with respect to a facet diagonal.Finally, cube-crossing vertex-gated curves are not possible by Theorem 3. (cid:117)(cid:116) Theorem 18
All symmetric curves are vertex-gated curves whose names start with Ca , Cd , Ce , La , Ne or Se . Proof: A symmetric curve must be vertex-gated, edge-gated, or facet-gated. We know there is only onefacet-gated curve (Theorem 8), which is asymmetric, and the gates of edge-gated curves are positionedasymmetrically (Theorem 6). This only leaves vertex-gated curves to consider.A vertex-gated curve starts at a vertex of the unit cube whose coordinates sum up to (mod 1), andthe coordinate sums of the entrance and exit gates of each octant differ by . Hence all even-indexedgates must be at an octant vertex whose coordinates sum up to (mod 1), that is, at a vertex or at afacet midpoint of the unit cube. This holds, in particular, for g , which must be at a facet midpoint,because at a unit cube vertex, it could not connect two octants. If a vertex-gated curve is symmetric,then the facet midpoint g must be a fixed point of the symmetry.Only the transformations a – e and q – s in Table 3 have facet midpoints as fixed points, but trans-formations q – s are not symmetric (they are not equal to their own inverse). Curves with partition X do not exist (Theorem 17). As we can verify with the help of Table 3, this leaves Ca , Cd , Ce , La , Na , Ne and Se as possible prefixes of names of symmetric curves. From these prefixes, Na can be ruled outbecause symmetric vertex-gated curves with transformation a must be edge-crossing, and vertex-gated,edge-crossing curves with partition N can easily be seen to be impossible by arguments similar to thosein the proof of Theorem 17. (cid:117)(cid:116) Theorem 19
All centred three-dimensional Hilbert curves are vertex-edge-gated.
Proof: A three-dimensional Hilbert curve is centred if and only if g , the exit gate of the fourth octant,is the centre of the unit cube. Since the centre of the unit cube is a vertex of each octant that touchesit, a three-dimensional Hilbert curve can only be centred if it has at least one vertex gate, that is, thecurve must be vertex-gated, vertex-edge-gated, or vertex-facet-gated.As argued in the proof of Theorem 18, if a curve is vertex-gated, the point g halfway on the curvemust be the centre of a facet of the unit cube and cannot be in the interior of the cube. In vertex-facet-gated curves, octants appear in pairs that share the octant facet that contains the facet gates, while thevertex gates are on the opposite sides of these octants, on the boundary of the unit cube. This leavesvertex-edge-gated curves as the only class of curves that may have g in the centre of the unit cube. (cid:117)(cid:116) Finding 4
The only metasymmetric three-dimensional Hilbert curves are the curves
Ca00.cT [ bC47 ] , Ca11.cT [ IPJ3 ] , Cd00.cP [ IPJ3 ] , Cd11.cP [ bC47 ] , Se00.cT [ bPJ7 ] , and Se66.cT [ IC43 ] . How found: Unfortunately I cannot provide a non-tedious way to verify these findings at this point.Curves that are both symmetric and metasymmetric can be identified by checking the gate sequences forsymmetric vertex-gated curves whose names start with Ca , Cd , Ce , La , Ne or Se , following Theorem 18.As one may verify with the help of Table 11 in Appendix E, there are 28 symmetric gate sequences. Insix of these, the gates are placed such that a metasymmetric curve results, provided the reflections in60he third to eighth octant are chosen to agree with those in the first two octants. This results in fourmetasymmetric curves (corresponding to four options for reflections in the first two octants) for each ofthe six gate sequences.However, recall from Section 3.2 that the definition of metasymmetry does not require the curve tobe symmetric: the curve may also be “pseudo-symmetric”, that is, the correspondence between the firstand the second half of the curve may have the form of a similarity transformation that does not equal itsown inverse. The reader may verify that pseudo-symmetric curves that are not vertex-gated cannot exist,and that for vertex-gated pseudo-symmetric curves, much of the arguments in the proof of Theorem 18still applies, to the effect that no pseudo-symmetric three-dimensional Hilbert curves exist that are nottruly symmetric. (cid:117)(cid:116)(cid:117)(cid:116)