Hamiltonian Paths Through Two- and Three- Dimensional Grids
Total Page:16
File Type:pdf, Size:1020Kb
Volume 110, Number 2, March-April 2005 Journal of Research of the National Institute of Standards and Technology [J. Res. Natl. Inst. Stand. Technol. 110, 000-000 (2005)] Hamiltonian Paths Through Two- and Three- Dimensional Grids Volume 110 Number 2 March-April 2005 William F. Mitchell This paper addresses the existence of under very mild conditions, and that there Hamiltonian paths and cycles in exist quadrilateral and hexahedral grids National Institute of Standards two-dimensional grids consisting of for which no unconstrained Hamiltonian and Technology, triangles or quadrilaterals, and path exists. The existence proofs are Gaithersburg, MD 20899-8910 three-dimensional grids consisting of constructive, and lead to an efficient tetrahedra or hexahedra. The paths algorithm for finding a through-vertex and cycles may be constrained to pass Hamiltonian cycle. from one element to the next through [email protected] an edge, through a vertex, or be unconstrained and pass through either. Key words: adaptive grid refinement; It was previously known that an Hamiltonian path; load balancing; unconstrained Hamiltonian path exists refinement-tree partition. in a triangular grid under very mild conditions, and that there are triangular grids for which there is no through-edge Accepted: February 23, 2005 Hamiltonian path. In this paper we prove that a through-vertex Hamiltonian cycle exists in any triangular or tetrahedral grid Available online: http://www.nist.gov/jres 1. Introduction The space filling curve and OCTREE methods are not guaranteed to create connected partitions, which Adaptive grid refinement has been shown to be an may be a desirable property. The refinement-tree effective tool for reducing the size of the grid (and con- method is guaranteed to give connected partitions sequently the linear system) required for a given accu- provided that an appropriate linearization of the initial racy when numerically solving partial differential equa- coarse grid is given. Such a linearization would be a tions. Problems involving singularities or multi-scale Hamiltonian path, i.e., a path which passes from an behavior practically require adaptive refinement. When element to a neighboring element and goes through implemented for parallel computers, dynamic load each element exactly once. Heber et al. [5] proved that, balancing is required to keep all of the processors busy. for grids consisting of triangles, a Hamiltonian path This involves partitioning the grid into equal sized always exists under very mild conditions. Moreover, pieces (in some measure), and distributing the data the proof is a constructive proof which leads to an among the processors accordingly. Many of the meth- efficient algorithm to find a Hamiltonian path. ods for computing a partition are based on a lineariza- However, the refinement-tree partitioning algorithm tion of the elements (or path through the elements) in a requires a stronger result in which the Hamiltonian two-dimensional or three-dimensional grid, and then path always passes through vertices when moving cutting the linear sequence into pieces of equal size. from one element to the next (as opposed to passing Some of the methods that fall into this category are the through edges), and does not go out the same vertex space filling curves [1], OCTREE [2], and refinement- through which it came in. We call this a through-vertex tree [3] methods. Further information on partitioning Hamiltonian path. Heber’s algorithm produces methods can be found in Ref. [4]. Hamiltonian paths that pass through both vertices and 127 Volume 110, Number 2, March-April 2005 Journal of Research of the National Institute of Standards and Technology edges. Additionally, Ref. [5] only addresses triangles, 1-nonconforming if there is at least one hanging node in not the other elements considered in this paper. the grid, all edges contain at most one hanging node, The main result of this paper is the proof that there the interior of all faces contain at most one hanging always exists a through-vertex Hamiltonian path in node, and the intersection of two elements is a vertex, grids consisting of triangles or tetrahedra, under very edge or face of one of the elements, or empty. See Fig. 1 mild conditions. The proof is constructive, which leads for examples of conforming and 1-nonconforming grids. to an algorithm to construct such a path. We do not This paper will primarily consider triangular and explicitly give the algorithm in this paper, but it follows tetrahedral grids that are conforming, and quadrilateral easily from the proofs of the main theorems. Little is and hexahedral grids that are conforming or 1-noncon- known about the conditions under which a Hamiltonian forming. path exists in grids consisting of quadrilaterals or hexa- A path with length n in a grid G is a sequence ∈ hedra. An algorithm is given that might find a through- of elements, E1E2 ...En, Ei G, i =1, n, with ∩ ≠ φ ≠ vertex Hamiltonian path in a quadrilateral or hexa- Ei Ei +1 , and Ei Ei +1, i = 1, n – 1. A cycle of hedral grid, if one exists, and is likely to give a length n is a path of length n + 1 in which E1 = En +1. A broken path with a small number of discontinuities, Hamiltonian path is a path in which every element in G i.e., something close to a through-vertex Hamiltonian appears exactly once. A Hamiltonian cycle is a cycle path. in which every element in G appears exactly once The remainder of the paper is organized as follows. except for E1 = En +1, which appears exactly twice. In Sec. 2 we introduce the notation and define the terms A sequence of elements E1E2 ...En for which there ∩ φ used in this paper. Section 3 addresses triangles and exists an i with Ei Ei +1 = is called a broken path, and tetrahedra. It reviews previously known results and the sequence Ei Ei +1 is called a discontinuity in the path. presents the main results of this paper. In Sec. 4 we A through-vertex path (through-vertex cycle) is a discuss quadrilaterals and hexahedra. Section 5 con- path (cycle) in which the passage from one element to tains the conclusions. the next is specified as a common vertex, and the path does not pass through the same vertex when entering 2. Definitions and exiting an element. Specifically, it is E1v1E2v2 ... ⊆ ∩ ≠ vn –1En where vi Ei Ei +1, i = 1, n – 1, vi vi +1, i =1, For the purposes of this paper, an element, E, is a tri- n – 2, and E1E2 ...En is a path (cycle). We say that the angle, quadrilateral, tetrahedron, or hexahedron. An path passes through vi when going from Ei to Ei +1, and element contains vertices, v, and edges, e, with the that we come into Ei through the in-vertex vi –1 and obvious definitions, and three-dimensional elements leave Ei through the out-vertex vi. A through-edge path contain faces, f. and cycle, and through-face path and cycle are defined A grid, G, is the union of a collection of elements, similarly. A through-vertex Hamiltonian path is a ∪ {Ei}, all of the same kind, such that G = Ei is a con- through-vertex path that is also a Hamiltonian path, and ℜ2 ℜ3 ° ∩ ° φ nected, bounded region in or , and Ei Ej = , the definitions of the obvious similar terms are similar. i ≠ j, where E° denotes the interior of element E, and φ An unconstrained path is one that may pass through is the empty set. We say that Ei is an element of G, any of vertices, edges or faces. Although the term is ∈ Ei G. A vertex of Ei is a boundary vertex if it lies on redundant, we will use it when we want to emphasize the boundary of G, and an interior vertex if it is not a that the path is not constrained to pass through only boundary vertex. We say the size of G, G, is N if there vertices, edges or faces. are N elements in G. A triangular grid, quadrilateral A vertex, v, is called a cut vertex if G \ v is discon- grid, tetrahedral grid, and hexahedral grid is a grid nected. See Fig. 2. A local cut vertex is a vertex whose consisting entirely of triangles, quadrilaterals, tetrahedra removal causes G to become disconnected locally. and hexahedra, respectively. Formally, v is a local cut vertex if there exists an R >0 ∩ ≠ ∈ ∩ ∈ A grid is said to be conforming if Ei Ej, i j, is a such that for all 0 < < R, (G B (v, )) \ v is discon- common vertex, common edge, common face or empty. nected, where B (v, ∈) is the ball of radius ∈ centered at A vertex of an element is called a hanging node if it lies v. Note that a cut vertex is also a local cut vertex. Figure in the interior of an edge or face of another element. It 2(b) illustrates a local cut vertex that is not a cut vertex. follows immediately from the definition that a con- In three dimensions, the terms cut edge and local cut forming grid has no hanging nodes. A grid is said to be edge are defined similarly. 128 Volume 110, Number 2, March-April 2005 Journal of Research of the National Institute of Standards and Technology manifold” which implies these conditions. The theorem also holds for Hamiltonian cycles, simply by starting the base case in Heber’s inductive proof with a Hamiltonian cycle between two triangles. The hypo- theses of the theorem need to be extended slightly because the definition of a cycle assumes at least two Fig. 1. (a) A conforming triangular grid.