Hypercube graph

Graphs formed by a hypercube's edges and vertices
title: "Hypercube graph" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["parametric-families-of-graphs", "regular-graphs"] description: "Graphs formed by a hypercube's edges and vertices" topic_path: "general/parametric-families-of-graphs" source: "https://en.wikipedia.org/wiki/Hypercube_graph" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0
::summary Graphs formed by a hypercube's edges and vertices ::
::data[format=table title="infobox graph"]
| Field | Value |
|---|---|
| name | Hypercube graph |
| image | [[Image:Hypercubestar.svg |
| image_caption | The hypercube graph Q_4 |
| vertices | 2^n |
| edges | 2^{n-1}n |
| automorphisms | n!2^n |
| chromatic_number | 2 |
| girth | 4 if n\ge 2 |
| diameter | n |
| spectrum | {(n - 2 k)^{\binom{n}{k |
| :: |
| name = Hypercube graph | image = [[Image:Hypercubestar.svg|200px|class=skin-invert-image]] | image_caption = The hypercube graph Q_4 | vertices = 2^n | edges = 2^{n-1}n | automorphisms = n!2^n | chromatic_number = 2 | chromatic_index = | girth = 4 if n\ge 2 | diameter = n | spectrum = {(n - 2 k)^{\binom{n}{k}}; k = 0, \ldots, n} | properties = Symmetric Distance regular Unit distance Hamiltonian Bipartite Polytopal | notation = Q_n
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.
Construction
::figure[src="https://upload.wikimedia.org/wikipedia/commons/a/aa/Hypercubeconstruction.png" caption="2}}}}"] ::
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 } n1\ \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.
Examples
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.
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
::figure[src="https://upload.wikimedia.org/wikipedia/commons/c/c2/Gray_code_tesseract.svg" caption="A Hamiltonian cycle on a tesseract with vertices labelled with a 4-bit cyclic Gray code"] ::
Every hypercube Q_n with n1 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 {{nowrap|hypercube Q_n.{{citation | title = Some complete cycles on the n-cube | last = Mills | first = W. H. | journal = Proceedings of the American Mathematical Society | year = 1963 | pages = 640–643 | doi = 10.2307/2034292 | volume = 14 | issue = 4 | publisher = American Mathematical Society | jstor = 2034292}}.}} 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 n1) :
- 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^{2^{n-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,\dots 2^n and is thus a bipancyclic graph.
- can be drawn as a unit distance graph in the Euclidean plane by using the construction of the hypercube graph from subsets of a set of n elements, choosing a distinct unit vector for each set element, and placing the vertex corresponding to the set S at the sum of the vectors in S.
- is a n-vertex-connected graph, by Balinski's theorem.
- is planar (can be drawn with no crossings) if and only if n\le 3. For larger values of n, the hypercube has {{nowrap|genus (n-4)2^{n-3}+1.{{citation | last1 = Ringel | first1 = G. | author1-link = Gerhard Ringel | journal = Abh. Math. Sem. Univ. Hamburg| mr = 949280 | pages = 10–19 | title = Über drei kombinatorische Probleme am n-dimensionalen Wiirfel und Wiirfelgitter| volume = 20 | year = 1955}}{{citation | last1 = Harary | first1 = Frank | author1-link = Frank Harary | last2 = Hayes | first2 = John P. | last3 = Wu | first3 = Horng-Jyh | doi = 10.1016/0898-1221(88)90213-1 | issue = 4 | journal = Computers & Mathematics with Applications | mr = 949280 | pages = 277–289 | title = A survey of the theory of hypercube graphs | volume = 15 | year = 1988| url = http://deepblue.lib.umich.edu/bitstream/handle/2027.42/27522/0000566.pdf?sequence=1 | hdl = 2027.42/27522 | hdl-access = free
- has exactly 2^{2^n-n-1}\prod_{k=2}^n k^ spanning trees.
- has bandwidth exactly \sum_{i=0}^{n-1} \binom{i}{\lfloor i/2\rfloor}.
- has achromatic number proportional to \sqrt{n2^n}, but the constant of proportionality is not known precisely.
- has as the eigenvalues of its adjacency matrix the numbers {-n,-n+2,-n+4,\dots,n-4,n-2,n} and as the eigenvalues of its Laplacian matrix the numbers {0,2,\dots,2n}. The kth eigenvalue has multiplicity \binom{n}{k} in both cases.
- has isoperimetric number h(G)=1.
The family Q_n for all n1 is a Lévy family of graphs.
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 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.{{citation | last = Szymanski | first = Ted H. | contribution = On the Permutation Capability of a Circuit-Switched Hypercube | location = Silver Spring, MD | pages = 103–110 | publisher = IEEE Computer Society Press | title = Proc. Internat. Conf. on Parallel Processing | volume = 1 | year = 1989}}.
Notes
References
- {{citation | title = A survey of the theory of hypercube graphs | authorlink1 = Frank Harary | last1 = Harary | first1 = F. | last2 = Hayes | first2 = J. P. | last3 = Wu | first3 = H.-J. | journal = Computers & Mathematics with Applications | volume = 15 | issue = 4 | pages = 277–289 | year = 1988 | doi = 10.1016/0898-1221(88)90213-1| hdl = 2027.42/27522 | hdl-access = free
References
- Watkins, John J.. (2004). "Across the Board: The Mathematics of Chessboard Problems". Princeton University Press.
- Fink, J.. (2007). "Perfect matchings extend to Hamiltonian cycles in hypercubes". Journal of Combinatorial Theory, Series B.
- Ruskey, F. and [[Carla Savage
- Optimal Numberings and Isoperimetric Problems on Graphs, L.H. Harper, [[Journal of Combinatorial Theory]], 1, 385–393, {{doi. 10.1016/S0021-9800(66)80059-5
- Roichman, Y.. (2000). "On the Achromatic Number of Hypercubes". Journal of Combinatorial Theory, Series B.
::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::