Skip to main content
Journal of Research of the National Institute of Standards and Technology logoLink to Journal of Research of the National Institute of Standards and Technology
. 2005 Apr 1;110(2):127–136. doi: 10.6028/jres.110.012

Hamiltonian Paths Through Two- and Three-Dimensional Grids

William F Mitchell 1
PMCID: PMC4847574  PMID: 27308109

Abstract

This paper addresses the existence of Hamiltonian paths and cycles in two-dimensional grids consisting of triangles or quadrilaterals, and three-dimensional grids consisting of tetrahedra or hexahedra. The paths and cycles may be constrained to pass from one element to the next through an edge, through a vertex, or be unconstrained and pass through either. It was previously known that an unconstrained Hamiltonian path exists in a triangular grid under very mild conditions, and that there are triangular grids for which there is no through-edge Hamiltonian path. In this paper we prove that a through-vertex Hamiltonian cycle exists in any triangular or tetrahedral grid under very mild conditions, and that there exist quadrilateral and hexahedral grids for which no unconstrained Hamiltonian path exists. The existence proofs are constructive, and lead to an efficient algorithm for finding a through-vertex Hamiltonian cycle.

Keywords: adaptive grid refinement, Hamiltonian path, load balancing, refinement-tree partition

1. Introduction

Adaptive grid refinement has been shown to be an effective tool for reducing the size of the grid (and consequently the linear system) required for a given accuracy when numerically solving partial differential equations. Problems involving singularities or multi-scale behavior practically require adaptive refinement. When implemented for parallel computers, dynamic load balancing is required to keep all of the processors busy. This involves partitioning the grid into equal sized pieces (in some measure), and distributing the data among the processors accordingly. Many of the methods for computing a partition are based on a linearization of the elements (or path through the elements) in a two-dimensional or three-dimensional grid, and then cutting the linear sequence into pieces of equal size. Some of the methods that fall into this category are the space filling curves [1], OCTREE [2], and refinement-tree [3] methods. Further information on partitioning methods can be found in Ref. [4].

The space filling curve and OCTREE methods are not guaranteed to create connected partitions, which may be a desirable property. The refinement-tree method is guaranteed to give connected partitions provided that an appropriate linearization of the initial coarse grid is given. Such a linearization would be a Hamiltonian path, i.e., a path which passes from an element to a neighboring element and goes through each element exactly once. Heber et al. [5] proved that, for grids consisting of triangles, a Hamiltonian path always exists under very mild conditions. Moreover, the proof is a constructive proof which leads to an efficient algorithm to find a Hamiltonian path. However, the refinement-tree partitioning algorithm requires a stronger result in which the Hamiltonian path always passes through vertices when moving from one element to the next (as opposed to passing through edges), and does not go out the same vertex through which it came in. We call this a through-vertex Hamiltonian path. Heber’s algorithm produces Hamiltonian paths that pass through both vertices and edges. Additionally, Ref. [5] only addresses triangles, not the other elements considered in this paper.

The main result of this paper is the proof that there always exists a through-vertex Hamiltonian path in grids consisting of triangles or tetrahedra, under very mild conditions. The proof is constructive, which leads to an algorithm to construct such a path. We do not explicitly give the algorithm in this paper, but it follows easily from the proofs of the main theorems. Little is known about the conditions under which a Hamiltonian path exists in grids consisting of quadrilaterals or hexahedra. An algorithm is given that might find a through-vertex Hamiltonian path in a quadrilateral or hexahedral grid, if one exists, and is likely to give a broken path with a small number of discontinuities, i.e., something close to a through-vertex Hamiltonian path.

The remainder of the paper is organized as follows. In Sec. 2 we introduce the notation and define the terms used in this paper. Section 3 addresses triangles and tetrahedra. It reviews previously known results and presents the main results of this paper. In Sec. 4 we discuss quadrilaterals and hexahedra. Section 5 contains the conclusions.

2. Definitions

For the purposes of this paper, an element, E, is a triangle, quadrilateral, tetrahedron, or hexahedron. An element contains vertices, v, and edges, e, with the obvious definitions, and three-dimensional elements contain faces, f.

A grid, G, is the union of a collection of elements, {Ei}, all of the same kind, such that G = ∪Ei is a connected, bounded region in ℜ2 or ℜ3, and EiEj=ϕ, ij, where E denotes the interior of element E, and ϕ is the empty set. We say that Ei is an element of G, EiG. A vertex of Ei is a boundary vertex if it lies on the boundary of G, and an interior vertex if it is not a boundary vertex. We say the size of G, |G|, is N if there are N elements in G. A triangular grid, quadrilateral grid, tetrahedral grid, and hexahedral grid is a grid consisting entirely of triangles, quadrilaterals, tetrahedra and hexahedra, respectively.

A grid is said to be conforming if EiEj, ij, is a common vertex, common edge, common face or empty. A vertex of an element is called a hanging node if it lies in the interior of an edge or face of another element. It follows immediately from the definition that a conforming grid has no hanging nodes. A grid is said to be 1-nonconforming if there is at least one hanging node in the grid, all edges contain at most one hanging node, the interior of all faces contain at most one hanging node, and the intersection of two elements is a vertex, edge or face of one of the elements, or empty. See Fig. 1 for examples of conforming and 1-nonconforming grids. This paper will primarily consider triangular and tetrahedral grids that are conforming, and quadrilateral and hexahedral grids that are conforming or 1-nonconforming.

Fig. 1.

Fig. 1

(a) A conforming triangular grid. (b) A 1-nonconforming quadrilateral grid. (c) A grid that is neither conforming nor 1-nonconforming, because an element edge contains more than one hanging node.

A path with length n in a grid G is a sequence of elements, E1E2En, EiG, i = 1, n, with EiEi + 1ϕ, and EiEi + 1, i = 1, n − 1. A cycle of length n is a path of length n + 1 in which E1 = En+ 1. A Hamiltonian path is a path in which every element in G appears exactly once. A Hamiltonian cycle is a cycle in which every element in G appears exactly once except for E1 = En + 1, which appears exactly twice.

A sequence of elements E1E2En for which there exists an i with EiEi + 1 = ϕ is called a broken path, and the sequence Ei Ei + 1 is called a discontinuity in the path.

A through-vertex path (through-vertex cycle) is a path (cycle) in which the passage from one element to the next is specified as a common vertex, and the path does not pass through the same vertex when entering and exiting an element. Specifically, it is E1v1E2v2vn−1 En where viEiEi + 1, i = 1, n − 1, vivi + 1, i = 1, n − 2, and E1E2En is a path (cycle). We say that the path passes through vi when going from Ei to Ei + 1, and that we come into Ei through the in-vertex vi − 1 and leave Ei through the out-vertex vi. A through-edge path and cycle, and through-face path and cycle are defined similarly. A through-vertex Hamiltonian path is a through-vertex path that is also a Hamiltonian path, and the definitions of the obvious similar terms are similar. An unconstrained path is one that may pass through any of vertices, edges or faces. Although the term is redundant, we will use it when we want to emphasize that the path is not constrained to pass through only vertices, edges or faces.

A vertex, v, is called a cut vertex if G \ v is disconnected. See Fig. 2. A local cut vertex is a vertex whose removal causes G to become disconnected locally. Formally, v is a local cut vertex if there exists an R > 0 such that for all 0 < ∈ < R, (GB (v, ∈)) \ v is disconnected, where B (v, ∈) is the ball of radius ∈ centered at v. Note that a cut vertex is also a local cut vertex. Figure 2(b) illustrates a local cut vertex that is not a cut vertex. In three dimensions, the terms cut edge and local cut edge are defined similarly.

Fig. 2.

Fig. 2

(a) A grid containing a cut vertex. (b) A grid containing a local cut vertex. In each case, the vertex is shown as a large dot.

3. Triangles and Tetrahedra

In this section we present what is known about the existence of the different types of Hamiltonian paths and cycles for conforming triangular and tetrahedral grids. We begin with a review of previously published results. We then give the main results of this paper, which are the existence of through-vertex Hamiltonian cycles under very mild conditions. Counterexamples are presented throughout to show conditions under which Hamiltonian cycles and paths do not exist, and to show that the conditions in the hypotheses of the theorems are essential.

Note that the existence of a cycle implies the existence of a path. Therefore most of the existence statements are made for cycles, and it is understood that the same statement holds for paths.

Conversely, non-existence statements are usually made about paths, and it is understood that the same statement holds for cycles. The exceptions to this are when quoting statements from other papers and when a path exists but a cycle does not.

The following theorem is due to Heber et al. [5].

Theorem 1 There exists a Hamiltonian path for any conforming triangular grid that contains no local cut vertices.

The statement of the theorem in Ref. [5] does not mention the absence of local cut vertices or that the grid must be conforming, however the definition of a grid in that paper is that it be a “simplicial complex coming from the simplicial decomposition of a connected 2D 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 hypotheses of the theorem need to be extended slightly because the definition of a cycle assumes at least two elements.

Corollary 1 There exists a Hamiltonian cycle for any conforming triangular grid, of size at least 2, that contains no local cut vertices.

Hamiltonian paths and cycles also exist for tetrahedral grids under similar conditions. This follows immediately from Theorem 2 later in this section.

The following counterexamples show that the absence of cut vertices is an essential condition for Theorem 1, and the absence of local cut vertices is an essential condition for Corollary 1. However, it is not known whether the absence of local cut vertices is essential for the Hamiltonian path.

Counterexample 1 There exists a triangular grid containing cut vertices for which there is no Hamiltonian path. See Fig. 3.

Fig. 3.

Fig. 3

Example of a triangular grid containing cut vertices for which there is no Hamiltonian path.

Counterexample 2 There exists a triangular grid containing local cut vertices (but no cut vertices) for which there is no Hamiltonian cycle. See Fig. 4.

Fig. 4.

Fig. 4

Example of a triangular grid containing local cut vertices for which there is no Hamiltonian cycle.

Corollary 1 says that, under very mild conditions, we can always find a Hamiltonian cycle (and hence a Hamiltonian path) in a triangular grid. This is an unconstrained Hamiltonian cycle, i.e., it does not say whether the passage from one element to the next is through a vertex or edge. Indeed, the recursive algorithm implied by the proof of Theorem 1 in Ref. [5] will usually result in passages through both vertices and edges. The obvious question is whether or not through-vertex Hamiltonian cycles or paths and through-edge Hamiltonian cycles or paths exist. The following well-known counterexample shows that we cannot expect to find a through-edge Hamiltonian path in a triangular grid. In fact, determining whether or not a through-edge Hamiltonian cycle exists in a triangular grid is known to be NP-complete [6]. A similar counterexample can be constructed for through-face Hamiltonian paths in tetrahedral grids.

Counterexample 3 There exists a conforming triangular grid with no local cut vertices for which there is no through-edge Hamiltonian path. See Fig. 5.

Fig. 5.

Fig. 5

Example of a conforming triangular grid without local cut vertices for which there is no through-edge Hamiltonian path.

The situation is less grim for through-vertex Hamiltonian cycles. The main result of this paper is that through-vertex Hamiltonian cycles exist for triangular and tetrahedral grids under conditions similar to those for the existence of an unconstrained Hamiltonian cycle. They again require a conforming grid with no local cut vertices. Triangular grids also require that there be at least one interior vertex, and tetrahedral grids also require that there be no local cut edges.

The following lemma says that, under conditions that will arise in the proofs of the main theorems, we can always find two triangles that share a edge, or two tetrahedra that share a face.

Lemma 1 Let G be a conforming triangular (tetrahedral) grid with |G| ≥ 2, no local cut vertices and no local cut edges. Let G1G contain no local cut vertices and no local cut edges, G2 = G \ G1, |G1| ≥ 1, and |G2| ≥ 1. Then

  1. there exists E1, E2G such that E1E2 is a common edge (face), and

  2. there exists E1G1 and E2G2 such that E1E2 is a common edge (face).

Proof: For part 1, suppose there are no elements that share an edge (face). Then all connections between elements are vertices (or edges), which must then be local cut vertices (or local cut edges) contradicting the hypothesis that there are no local cut vertices or local cut edges.

For part 2, suppose there is no element in G2 that shares an edge (face) with an element in G1. Then G1 and G2 are connected by only vertices (and edges), which must then be local cut vertices (or local cut edges). □

We first give the main result for tetrahedral grids, where the proof is shorter.

Theorem 2 Let G be a conforming tetrahedral grid with |G| ≥ 2. If G contains no local cut vertices and no local cut edges then there exists a through-vertex Hamiltonian cycle for G.

Proof: We prove this by induction on |G1| where G1G, G1 satisfies the hypotheses of the theorem, and we can exhibit a through-vertex Hamiltonian cycle for G1.

For |G1| = 2, let G1 = {E1, E2} where E1 and E2 are any two elements that share a common face. Lemma 1 insures the existence of these elements. Let v1 and v2 be two of the vertices that they share. Then E1v1E2v2E1 is a through-vertex Hamiltonian cycle for this subgrid.

By induction, let k = |G1| and suppose we have G1G, k ≥ 2, G1 satisfies the hypotheses of the theorem, and E1v1E2v2EkvkE1 is a through-vertex Hamiltonian cycle for G1. The grid and cycle can be extended to size k + 1 as follows.

Let Ek + 1G \ G1 be an element that shares a face with some element EiG1. The existence of Ek + 1 is guaranteed by Lemma 1. Without loss of generality, assume Ei is not E1 (otherwise, just start the numbering of the cycle with a different element). Since Ei has only four vertices, one of the three vertices shared by Ei and Ek + 1 must be either Ei’s in-vertex vi − 1 or Ei’s out-vertex vi. Without loss of generality, suppose it is vi (otherwise, just reverse the ordering of the cycle). One of the three shared vertices, say v, must not be vi − 1 or vi. Then a through-vertex Hamiltonian cycle in G1Ek + 1 is E1vi − 1 EivEk + 1viEi + 1E1. □

The proof for triangular grids is also a constructive proof that begins with a cycle through two elements and inductively extends this cycle to the complete grid. However, it is a more complicated proof because, in the notation of Theorem 2, we cannot guarantee that Ek + 1 shares a vertex with Ei that is not vi − 1 or vi. In that case, a more complicated extension of the cycle must be performed.

Theorem 3 Let G be a conforming triangular grid with |G| ≥ 2. If G contains no local cut vertices and has at least one interior vertex then there exists a through-vertex Hamiltonian cycle for G.

Proof: As in Theorem 2, we prove this by induction on |G1|, and the base case with two triangles is trivial. By induction, suppose we have G1G, |G1| = k ≥ 2, G1 contains no local cut vertices, and E1v1E2v2EkvkE1 is a through-vertex Hamiltonian cycle for G1. The grid and cycle can be extended to a larger size as follows.

Let Ek + 1G \ G1 be an element that shares an edge with some element EiG1. The existence of Ek + 1 is guaranteed by Lemma 1. Without loss of generality, assume Ei is not E1 (otherwise, just start the numbering of the cycle with a different element). One of the two vertices that Ek + 1 shares with Ei must be either Ei’s in-vertex, vi − 1, or Ei’s out-vertex, vi. Without loss of generality, assume it shares the out-vertex (otherwise, just reverse the order of the cycle). There are four cases to consider.

Case 1. Ek + 1 does not contain vi − 1.

This is the easy case that corresponds to the proof of Theorem 2. Let v be the other vertex shared by Ek + 1 and Ei. Then the new cycle is E1vi − 1EivEk + 1viEi + 1E1. This extension is illustrated in Fig. 6. The arrows pointing from a vertex to the interior of a triangle or from the interior of a triangle to a vertex denote the in-vertex and out-vertex, respectively.

Fig. 6.

Fig. 6

Extension of the cycle for case 1 in Theorem 3.

Case 2. Ek + 1 contains vi − 1 and there is another triangle, Ek + 2, not on the current cycle, that shares an edge and vi with Ek + 1.

This case is illustrated in Fig. 7. Let v be the other vertex shared by Ek + 1 and Ek + 2. Then the new cycle is E1vi − 1EiviEk + 1vEk + 2viEi + 1E1.

Fig. 7.

Fig. 7

Extension of the cycle for case 2 in Theorem 3.

Case 3. Ek + 1 contains vi − 1 and there is another triangle, Ek + 2, that is on the current cycle and shares an edge and vi with Ek + 1.

First note that Ek + 1 must contain both the in-vertex and out-vertex of Ek + 2, otherwise we could apply case 1 with Ek + 2 as Ei to add Ek + 1 to the cycle. Also note that whenever a triangle not on the cycle contains both the in-vertex and out-vertex of a triangle that is on the cycle, we can “swap” this triangle with the other triangle by removing the other triangle from the cycle and inserting the new triangle in its place, as illustrated in Fig. 8.

Fig. 8.

Fig. 8

Swapping element Ek + 1 for element Ek + 2 in the cycle.

Case 3a. vi is an interior vertex.

Swap elements around vi until either

  1. there are two adjacent elements that are not in the cycle (then apply case 2), or

  2. there are adjacent elements, one on the cycle and one not on the cycle, where the one not on the cycle does not contain both the in-vertex and out-vertex of the one on the cycle (then apply case 1).

Note that if we do not encounter two adjacent elements that are not in the cycle (the first subcase), then we must eventually reach the second subcase because the other triangle adjacent to Ei cannot contain the in-vertex of Ei, vi − 1. See Fig. 9.

Fig. 9.

Fig. 9

A case where swapping around an interior vertex vi continues until the other triangle adjacent to Ei is reached.

Case 3b. vi is a boundary vertex.

This implies that all three vertices of Ek + 1 are on the boundary, for if not we could select a different Ei, vi − 1 and vi (possibly reversing the order of the cycle) such that an interior vertex of Ek + 1 is vi. This leads to a natural decomposition of G into three components plus Ek + 1 as illustrated in Fig. 10. The intersection of any two components is a vertex of Ek + 1. Each component contains a triangle that shares an edge with Ek + 1 because there are no local cut vertices. One component contains Ei and a second component contains Ek + 2. If the third component is not empty, let E be the element that shares an edge with Ek + 1. If E is not on the cycle, then apply case 2 (reversing the order of the cycle if necessary). If E is on the cycle and Ek + 1 does not contain both the in-vertex and out-vertex of E, then apply case 1 with E as Ei. Thus we can assume that Ek + 1 contains the in-vertex and out-vertex of all adjacent triangles, so it can be swapped with any of them.

Fig. 10.

Fig. 10

Decomposition of G into three components plus Ek + 1 when all three vertices of Ek + 1 are on the boundary.

Pick an interior vertex of G, vint. Swap Ek + 1 with the neighbor that is in the same component as vint. Apply case 1, 2 or 3a to reinsert the other element, if appropriate. If not, then consider the decomposition around the new element and repeat the process (see Fig. 11). The component that contains vint has at least lost the swapped triangle, and thus is smaller in this decomposition. Since the size of the component containing vint will continue to shrink with each application of this process, it must eventually lead to vint, at which point case 3a applies, unless it ends earlier by applying case 1, 2 or 3a.

Fig. 11.

Fig. 11

Second decomposition of G into three components plus a triangle after swapping Ek + 1 with a neighbor.

Case 4. Ek + 1 contains vi − 1 and there is no other triangle that shares an edge and vi with Ek + 1, i.e., that edge is on the boundary.

Then there must be another triangle that shares vi and an edge with Ei, for if that edge of Ei was also on the boundary, then vi would be a local cut vertex. Swap Ek + 1 with Ei, and then apply either case 2 or case 3 to add Ei back into the path. □

The inclusion of an interior vertex is an essential condition for Theorem 3. The same counterexample can be used as was used in Counterexample 3. However, this example does contain a through-vertex Hamiltonian path. It is not known whether or not the inclusion of an interior vertex is essential for the existence of a through-vertex Hamiltonian path.

Counterexample 4 There exists a conforming triangular grid with no local cut vertices and no interior vertices for which there is no through-vertex Hamiltonian cycle. See Fig. 5.

Since the inclusion of an interior vertex “fixes” Counterexample 4, a natural question is whether it can also “fix” Counterexample 3. The following counterexample says that this is not the case.

Counterexample 5 There exists a conforming triangular grid with no local cut vertices and at least one interior vertex for which there is no through-edge Hamiltonian path. See Fig. 12.

Fig. 12.

Fig. 12

Example of a conforming triangular grid without local cut vertices, but including an interior vertex, for which there is no through-edge Hamiltonian path.

4. Quadrilaterals and Hexahedra

It is not known under what conditions any kind of Hamiltonian path or cycle is guaranteed to exist for quadrilateral and hexahedral grids, or even if there is any characterization. It would certainly be much more stringent conditions than for triangles and tetrahedra, as the following counterexample shows. By replacing the squares with cubes, the same counterexample works for hexahedral grids.

Counterexample 6 There exists a conforming quadrilateral grid with no local cut vertices and at least one interior vertex for which there is no Hamiltonian path. See Fig. 13.

Fig. 13.

Fig. 13

Example of a conforming quadrilateral grid without local cut vertices, but including an interior vertex, for which there is no Hamiltonian path.

The proofs of Theorems 2 and 3 break down when applied to quadrilaterals and hexahedra because, in the notation of those theorems, Ek + 1 is not guaranteed to contain either the in-vertex or out-vertex of Ei. Without that condition, it is more difficult, and in some cases impossible, to modify the cycle in a way that adds Ek + 1 to it.

However, there are some other transformations of the cycle that can be applied to insert Ek + 1 into the cycle in some situations. These include some situations where the grid is 1-nonconforming. Most of these transformations apply not only to quadrilaterals and hexahedra, but to any shape of element, including triangles and tetrahedra, and to mixed elements. Thus one could write a general program that applies to any grid. The illustrations will show the application of the transformations to quadrilaterals. They show examples of the transformations, but are not exhaustive.

An algorithm that attempts to find a through-vertex Hamiltonian cycle begins by picking two elements that share an edge (face in three dimensions) and constructing a cycle consisting of these two elements and two of the vertices they share. Then repeatedly pick an element that is not in the cycle but shares an edge (face in three dimensions) with an element in the cycle, and attempt to add it to the cycle by trying all of the following transformations that apply until one succeeds. If none of them succeed then try another element and come back to this one later. If there are elements not yet added to the cycle and none of the transformations work with any of the remaining elements, then you must insert a “broken link” creating a discontinuity in the path, i.e., insert an element such that either it is not adjacent to the previous or next element in the cycle, or the in-vertex and out-vertex do not match. When all elements have been added to the (possibly broken) cycle, the algorithm finishes.

In the following transformations, the cycle contains the segment vi − 2 Ei − 1 vi − 1 EiviEi + 1 vi + 1 and E is an element that shares an edge (face in three dimensions) with Ei and is not in the cycle.

Transformation 1 If E contains vi and shares another vertex, u ≠ vi − 1, with Ei, then replace the segment with vi − 2Ei − 1vi − 1EiuEviEi + 1vi + 1. See Fig. 14.

Fig. 14.

Fig. 14

Example of Transformation 1.

This is the same transformation that was used in the proof of Theorem 2.

Transformation 2 If E contains vi − 1 and shares another vertex, u ≠ vi, with Ei, then replace the segment with vi − 2Ei − 1vi − 1EuEiviEi + 1vi + 1.

This is like the previous transformation, but using the in-vertex instead of the out-vertex.

Transformation 3 If E contains both vi 1 and vi, and Ei 1 shares another vertex, u ≠ vi − 2 with Ei, then replace the segment with vi − 2Ei − 1uEivi − 1EviEi + 1vi + 1. See Fig. 15.

Fig. 15.

Fig. 15

Example of Transformation 3.

Transformation 4 If E contains both vi − 1 and vi, and Ei + 1 shares another vertex, u ≠ vi + 1 with Ei, then replace the segment with vi − 2Ei − 1vi − 1EviEiuEi + 1vi + 1.

This is like the previous transformation, but with the change occurring at the out-vertex of Ei instead of the in-vertex.

Transformation 5 If E shares a vertex u1 ≠ vi with Ei, and shares a vertex u2 with Ei − 1, u2 ≠ u1 and u2 ≠ vi − 2, then replace the segment with vi − 2Ei − 1u2Eu1EiviEi + 1vi + 1. See Fig. 16.

Fig. 16.

Fig. 16

Example of Transformation 5.

This transformation can also handle some forms of hanging nodes, as shown in Fig. 17.

Fig. 17.

Fig. 17

Example of Transformation 5 with hanging node.

Transformation 6 If E shares a vertex u1 ≠ vi − 1 with Ei, and shares a vertex u2 with Ei+1, u2 ≠ u1 and u2 ≠ vi + 1, then replace the segment with vi − 2Ei − 1vi − 1Eiu1Eu2Ei + 1vi + 1.

This is like the previous transformation, but with the changes occurring at Ei + 1 instead of Ei − 1.

Transformation 7 If E contains neither vi − 1 nor vi, but it shares a vertex u1 with Ei − 1, u1 ≠ vi − 2, and shares a vertex u2 with Ei, u2 ≠ u1, then replace the segment with vi − 2 Ei − 1u1Eu2EiviEi + 1vi + 1. See Fig. 18.

Fig. 18.

Fig. 18

Example of Transformation 7.

Transformation 8 If E contains neither vi − 1 nor vi, but it shares a vertex u1 with Ei + 1, u1 ≠ vi + 1, and shares a vertex u2 with Ei, u2 ≠ u1, then replace the segment with vi − 2Ei − 1vi − 1Eiu2Eu1Ei + 1vi + 1.

This is like the previous transformation, but with the changes occurring at Ei + 1 instead of Ei − 1.

Transformation 9 If E contains vi and there is another element, F, that is not on the cycle, shares a vertex, u1 ≠ vi, with E, and shares a vertex u2 with Ei, u2 ≠ u1 and u2 ≠ vi − 1, then replace the segment with vi − 2Ei − 1vi − 1Eiu2Fu1EviEi + 1vi + 1.

This transformation can handle some instances of hanging nodes, as shown in Fig. 19. It can also handle case 2 in the proof of Theorem 3, although it places the elements in a different order than that used in the proof.

Fig. 19.

Fig. 19

Example of Transformation 9.

Transformation 10 If E contains vi − 1 and there is another element, F, that is not on the cycle, shares a vertex, u1 ≠ vi − 1, with E, and shares a vertex u2 with Ei, u2 ≠ u1 and u2 ≠ vi, then replace the segment with vi − 2Ei − 1vi − 1Eu1Fu2EiviEi + 1vi + 1.

This is like the previous transformation, but with E sharing the in-vertex of Ei instead of the out-vertex.

Transformation 11 If E contains both vi − 1 and vi, then replace the segment with vi − 2Ei − 1vi − 1EviEi + 1vi + 1.

This is the swapping of one element for another that was described in case 3 of the proof of Theorem 3. One would next attempt to add Ei back into the cycle. If done recursively, this will handle case 3b of Theorem 3.

5. Conclusion

We considered the existence of various types of Hamiltonian paths and cycles in two-dimensional grids consisting of triangles or quadrilaterals, and three-dimensional grids consisting of tetrahedra or hexahedra. The types of Hamiltonian paths and cycles are distinguished by whether passage from one element to the next must be associated with an edge (through-edge Hamiltonian), must be associated with a vertex (through-vertex Hamiltonian), or can pass through either (unconstrained Hamiltonian). The existence results presented in this paper can be summarized as:

  1. There exists an unconstrained Hamiltonian path in any conforming triangular grid with no local cut vertices (previously known result). This is easily extended to Hamiltonian cycle.

  2. There exist triangular grids for which there is no through-edge Hamiltonian path (previously known result). This also holds for through-face Hamiltonian paths in tetrahedral grids.

  3. There exists a through-vertex Hamiltonian cycle (and hence through-vertex Hamiltonian path) for any conforming triangular grid with no local cut vertices and at least one interior vertex.

  4. There exists a through-vertex Hamiltonian cycle (and hence through-vertex Hamiltonian path, unconstrained Hamiltonian cycle and unconstrained Hamiltonian path) for any tetrahedral grid that contains no local cut vertices and no local cut edges.

  5. There exist rectangular grids for which there is no Hamiltonian path or cycle of any type. This also holds for hexahedral grids.

Examples were given to show that the stated conditions are essential. Some open questions remain:

  1. It is not known if the absence of local cut vertices is essential for the existence of a Hamiltonian path in a triangular grid. (The absence of cut vertices is essential, and the absence of local cut vertices is essential for a Hamiltonian cycle.)

  2. It is not known if the presence of an interior vertex is essential for the existence of a Hamiltonian path in a triangular grid. (It is essential for a Hamiltonian cycle.)

  3. The conditions under which any type of Hamiltonian path or cycle exists in a rectangular or hexahedral grid are not known.

The existence proofs for through-vertex Hamiltonian cycles in triangular and tetrahedral grids are constructive proofs. An efficient algorithm to find such a cycle can be derived from the construction in the proofs. Another algorithm, which can be applied to elements of any shape, was outlined. This algorithm is not guaranteed to find a through-vertex Hamiltonian cycle even if one exists, but it is likely to produce a (possibly broken) cycle that is close.

Biography

About the author: William F. Mitchell is a computer scientist in the Mathematical and Computational Mathematics Division of the NIST Information Technology Laboratory. The National Institute of Standards and Technology is an agency of the Technology Administration, U.S. Department of Commerce.

6. References

  • 1.Pilkington JR, Baden SB. Dynamic partitioning of nonuniform structured workloads with spacefilling curves. IEEE Trans on Par and Dist Sys. 1996;7(3):288–300. [Google Scholar]
  • 2.Flaherty J, Loy R, Shephard M, Szymanski B, Teresco J, Ziantz L. Adaptive local refinement with octree load-balancing for the parallel solution of three-dimensional conservation laws. J Parallel Distrib Comput. 1998;47:139–152. [Google Scholar]
  • 3.Mitchell WF. The k-way refinement-tree partitioning method for adaptive grids. in progress. [Google Scholar]
  • 4.Devine K, Hendrickson B, Boman E, St John M, Vaughan C, Mitchell WF. Zoltan: A dynamic load-balancing library for parallel applications. Sandia National Laboratories; Albuquerque, NM: 2000. (User’s Guide, Sandia Technical Report SAND99-1377). [Google Scholar]
  • 5.Heber G, Biswas R, Gao GR. Self-avoiding walks over two-dimensional adaptive unstructured grids. NASA Ames Research Center; Moffett Field, CA: 1998. (NAS Technical Report, NAS-98-007). [Google Scholar]
  • 6.Dogrusoz U, Krishnamoorthy MS. Hamiltonian cycle problem for triangle graphs. Rensselaer Polytechnic Institute; Troy, NY: 1995. (Computer Science Technical Report TR95-7). [Google Scholar]

Articles from Journal of Research of the National Institute of Standards and Technology are provided here courtesy of National Institute of Standards and Technology

RESOURCES