Reference articles on history, science, culture and more
Encyclopedia

Hypercube graph

Graphs formed by a hypercube's edges and vertices

Image credit is listed at the end of this article.

In graph theory, the hypercube graph Q_{n} is the edge graph of the n-dimensional hypercube, that is, it is the graph formed from the vertices and edges of the hypercube. For instance, the cube graph Q_{3} is the graph formed by the 8 vertices and 12 edges of a three-dimensional cube. Q_{n} has 2^{n} vertices, 2^{n-1}n edges, and is a regular graph with n edges touching each vertex.

The hypercube graph Q_{n} may also be constructed by creating a vertex for each subset of an n-element set, with two vertices adjacent when their subsets differ in a single element, or by creating a vertex for each n-digit binary number, with two vertices adjacent when their binary representations differ in a single digit. It is the n-fold Cartesian product of the two-vertex complete graph, and may be decomposed into two copies of Q_{n-1} connected to each other by a perfect matching.

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

01Construction

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 one. These two constructions are closely related: a binary number may be interpreted as a set (the set of positions where it has a nonzero digit), and two such sets differ in a single element whenever the corresponding two binary numbers have Hamming distance one.

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

The above construction gives a recursive algorithm for constructing the adjacency matrix of a hypercube, A_{n}. Copying is done via the Kronecker product \otimes _{K}, so that the two copies of Q_{n-1} have an adjacency matrix \mathrm {1} _{2}\otimes _{K}A_{n-1},where 1_{d} is the d\times d identity matrix. Meanwhile the joining edges have an adjacency matrix A_{1}\otimes _{K}1_{2^{n-1}}. The sum of these two terms gives a recursive function for the adjacency matrix of a hypercube:A_{n}={\begin{cases}1_{2}\otimes _{K}A_{n-1}+A_{1}\otimes _{K}1_{2^{n-1}}&{\text{if }}n>1\\{\begin{bmatrix}0&1\\1&0\end{bmatrix}}&{\text{if }}n=1\end{cases}} Another construction of Q_{n} is the Cartesian product of n two-vertex complete graphs K_{2}. More generally the Cartesian product of copies of a complete graph is called a Hamming graph; the hypercube graphs are examples of Hamming graphs.

Construction of 3</sub>"}},"i":0}}]}' id="mwKQ">Q3 by connecting pairs of corresponding vertices in two copies of Q2
Construction of 3</sub>"}},"i":0}}]}' id="mwKQ">Q3 by connecting pairs of corresponding vertices in two copies of Q2

02Examples

The graph Q_{0} consists of a single vertex, while Q_{1} is the complete graph on two vertices.

Q_{2} is a cycle of length 4.

The graph Q_{3} is the 1-skeleton of a cube and is a planar graph with eight vertices and twelve edges.

The graph Q_{4} is the Levi graph of the Möbius configuration. It is also the knight's graph for a toroidal 4\times 4 chessboard.

A Hamiltonian cycle on a tesseract with vertices labelled with a 4-bit cyclic Gray code
A Hamiltonian cycle on a tesseract with vertices labelled with a 4-bit cyclic Gray code

03Properties

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 and v if and only if they 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}. 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. The question whether every matching extends to a Hamiltonian cycle remains an open problem.

Other properties

The hypercube graph Q_{n} (for n>1) :

The family Q_{n} for all n>1 is a Lévy family of graphs.

Maximum lengths of snakes (Ls) and coils (Lc) in the snakes-in-the-box problem for dimensions n from 1 to 4
Maximum lengths of snakes (Ls) and coils (Lc) in the snakes-in-the-box problem for dimensions n from 1 to 4

04Problems

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 a 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.

Watch videos about Hypercube graphExplainers and documentaries on YouTube (opens in a new tab)

Sources and credits

This article is adapted from the Wikipedia article Hypercube graph, written by its contributors and licensed under CC BY-SA 4.0. Fathomly has changed the layout, removed citation markers, navigation and maintenance notices, and adjusted punctuation. This adapted version is shared under the same license. For references, see the original article.

Images, from Wikimedia Commons:

Fathomly is not affiliated with or endorsed by the Wikimedia Foundation. Spotted a problem? Tell us.