# Hypercube graph

Template:Infobox graph
In graph theory, the **hypercube graph** *Q _{n}* is a regular graph with 2

^{n}vertices, 2

^{n−1}

*n*edges, and

*n*edges touching each vertex. It can be obtained as the one-dimensional skeleton of the geometric hypercube; for instance,

*Q*

_{3}is the graph formed by the 8 vertices and 12 edges of a three-dimensional cube. Alternatively, it can be obtained from the family of subsets of a set with

*n*elements, by making a vertex for each possible subset and joining two vertices by an edge whenever the corresponding subsets differ in a single element.

Hypercube graphs should not be confused with cubic graphs, which are graphs that have exactly three edges touching each vertex. The only hypercube, *Q*_{n} that is a cubic graph is the cubical graph, *Q*_{3}.

## Contents

## Construction

The hypercube graph *Q*_{n} may be constructed from the family of subsets of a set with *n* elements, by making a vertex for each possible subset and joining two vertices by an edge whenever the corresponding subsets differ in a single element. Equivalently, it may be constructed using 2^{n} vertices labeled with *n*-bit binary numbers and connecting two vertices by an edge whenever the Hamming distance of their labels is 1. These two constructions are closely related: a binary number may be interpreted as a set (the set of positions where it has a 1 digit), and two such sets differ in a single element whenever the corresponding two binary numbers have Hamming distance 1.

Alternatively, *Q*_{n+1} may be constructed from the disjoint union of two hypercubes *Q*_{n}, by adding an edge from each vertex in one copy of *Q*_{n} to the corresponding vertex in the other copy, as shown in the figure. The joining edges form a perfect matching.

Another definition of *Q*_{n} is the Cartesian product of *n* two-vertex complete graphs *K*_{2}.

## Examples

The graph *Q*_{0} consists of a single vertex, while *Q*_{1} is the complete graph on two vertices and *Q*_{2} is a cycle of length 4.

The graph *Q*_{3} is the 1-skeleton of a cube, a cubical graph, a planar graph with eight vertices and twelve edges.

The graph *Q*_{4} is the Levi graph of the Möbius configuration.

## Properties

### Bipartiteness

Every hypercube graph is bipartite: it can be colored with only two colors. The two colors of this coloring may be found from the subset construction of hypercube graphs, by giving one color to the subsets that have an even number of elements and the other color to the subsets with an odd number of elements.

### Hamiltonicity

Every hypercube *Q*_{n} with *n* > 1 has a Hamiltonian cycle, a cycle that visits each vertex exactly once. Additionally, a Hamiltonian path exists between two vertices *u,v* if and only if have different colors in a 2-coloring of the graph. Both facts are easy to prove using the principle of induction on the dimension of the hypercube, and the construction of the hypercube graph by joining two smaller hypercubes with a matching.

Hamiltonicity of the hypercube is tightly related to the theory of Gray codes. More precisely there is a bijective correspondence between the set of *n*-bit cyclic Gray codes and the set of Hamiltonian cycles in the hypercube *Q*_{n}.^{[1]} An analogous property holds for acyclic *n*-bit Gray codes and Hamiltonian paths.

A lesser known fact is that every perfect matching in the hypercube extends to a Hamiltonian cycle.^{[2]} The question whether every matching extends to a Hamiltonian cycle remains an open problem.^{[3]}

### Other properties

The hypercube graph *Q*_{n} (n > 1) :

- is the Hasse diagram of a finite Boolean algebra.

- is a median graph. Every median graph is an isometric subgraph of a hypercube, and can be formed as a retraction of a hypercube.

- has more than 2
^{2n-2}perfect matchings. (this is another consequence that follows easily from the inductive construction.)

- is arc transitive and symmetric. The symmetries of hypercube graphs can be represented as signed permutations.

- contains all the cycles of length 4, 6, ..., 2
^{n}and is thus a bipancyclic graph.

- can be drawn as a unit distance graph in the Euclidean plane by choosing a unit vector for each set element and placing each vertex corresponding to a set
*S*at the sum of the vectors in*S*.

- is planar (can be drawn with no crossings) if and only if
**n**≤ 3. For larger values of*n*, the hypercube has genus .^{[4]}^{[5]}

- has exactly spanning trees.
^{[5]}

- The family
*Q*_{n}(n > 1) is a Lévy family of graphs

- The achromatic number of
*Q*_{n}is known to be proportional to , but the constant of proportionality is not known precisely.^{[6]}

- The bandwidth of
*Q*_{n}is exactly .^{[7]}

- The eigenvalues of the adjacency matrix are (-n,-n+2,-n+4,...,n-4,n-2,n) and the eigenvalues of its Laplacian are (0,2,...,2n). The k-th eigenvalue has multiplicity in both cases.

- The isoperimetric number is h(G)=1

## Problems

The problem of finding the longest path or cycle that is an induced subgraph of a given hypercube graph is known as the snake-in-the-box problem.

Szymanski's conjecture concerns the suitability of a hypercube as an network topology for communications. It states that, no matter how one chooses a permutation connecting each hypercube vertex to another vertex with which it should be connected, there is always a way to connect these pairs of vertices by paths that do not share any directed edge.^{[8]}

## See also

## Notes

- ↑ {{#invoke:citation/CS1|citation |CitationClass=citation }}.
- ↑ {{#invoke:citation/CS1|citation |CitationClass=citation }}.
- ↑ Ruskey, F. and Savage, C. Matchings extend to Hamiltonian cycles in hypercubes on Open Problem Garden. 2007.
- ↑ {{#invoke:citation/CS1|citation |CitationClass=citation }}
- ↑
^{5.0}^{5.1}{{#invoke:citation/CS1|citation |CitationClass=citation }}. - ↑ {{#invoke:citation/CS1|citation |CitationClass=citation }}.
- ↑ Optimal Numberings and Isoperimetric Problems on Graphs, L.H. Harper, Journal of Combinatorial Theory, 1, 385–393, Template:Hide in printTemplate:Only in print
- ↑ {{#invoke:citation/CS1|citation |CitationClass=citation }}.

## References

- {{#invoke:citation/CS1|citation

|CitationClass=citation }}.