The Wayback Machine - https://web.archive.org/web/20140329041107/http://mathworld.wolfram.com/HypercubeGraph.html

Hypercube Graph

DOWNLOAD Mathematica Notebook HypercubeGraphs

The n-hypercube graph, also called the n-cube graph and commonly denoted Q_n or 2^n, is the graph whose vertices are the 2^k symbols epsilon_1, ..., epsilon_n where epsilon_i=0 or 1 and two vertices are adjacency if the symbols differ in exactly one coordinate.

The graph of the n-hypercube is given by the graph Cartesian product of path graphs P_2×...×P_2_()_(n).

The above figures show symmetric projections of the n-hypercube graphs with n=2 to 7. Note that the second figure (n=3) shows a projection of the usual cube looking along a space diagonal so that the top and bottom vertices coincide, and hence only seven of the cube's eight vertices are visible. In addition, three of the central edges connect to the upper vertex, while the other three connect to the lower vertex.

Hypercube graphs may be computed in Mathematica using the command HypercubeGraph[n], and precomputed properties of hypercube graphs are implemented in Mathematica as GraphData[{"Hypercube", n}].

Special cases are summarized in the following table.

nQ_n
0singleton graph K_1
1path graph P_2
2square graph C_4
3cubical graph
4tesseract graph

All hypercube graphs are Hamiltonian, and any Hamiltonian cycle of a labeled hypercube graph defines a Gray code (Skiena 1990, p. 149).

The numbers of (directed) Hamiltonian paths on an n-hypercube graph for n=1, 2, ... are 0, 0, 48, 48384, 129480729600, ... (Sloane's A006070; extending the result of Gardner 1986, pp. 23-24), while the numbers of (directed) Hamiltonian cycles are 0, 2, 12, 2688, 1813091520, ... (Harary et al. 1988; Sloane's A091299).

Hypercube graphs are distance-transitive, and therefore also distance-regular.

In 1954, Ringel showed that the hypercube graphs Q_n admit Hamilton decompositions whenever n is a power of 2 (Alspach 2010). Alspach et al. (1990) showed that every Q_n for n>2 admits a Hamilton decomposition.

HypercubeGraphUnitDistance

For n>=1, they are also unit-distance (Gerbracht 2008), as illustrated above for the first few hypercube graphs. This can be established by induction for the n-hypercube graph by starting with the unit-distance embedding of the square graph, translating the embedding by one unit in a direction not chosen in any of the steps before (only finitely many unit translation vectors have been used, so there must be a direction not used before), connecting the vertices in the translate with the corresponding vertices in the original one, and repeating until the n-hypercube graph has been constructed.

The n-hypercube graph is isomorphic to the Hasse diagram for the Boolean algebra on n elements.

Wolfram Web Resources

Mathematica »

The #1 tool for creating Demonstrations and anything technical.

Wolfram|Alpha »

Explore anything with the first computational knowledge engine.

Wolfram Demonstrations Project »

Explore thousands of free applications across science, mathematics, engineering, technology, business, art, finance, social sciences, and more.

Computable Document Format »

The format that makes Demonstrations (and any information) easy to share and interact with.

STEM initiative »

Programs & resources for educators, schools & students.

Computerbasedmath.org »

Join the initiative for modernizing math education.