In
graph theory
In mathematics and computer science, graph theory is the study of ''graph (discrete mathematics), graphs'', which are mathematical structures used to model pairwise relations between objects. A graph in this context is made up of ''Vertex (graph ...
, the hypercube graph is the graph formed from the vertices and edges of an -dimensional
hypercube
In geometry, a hypercube is an ''n''-dimensional analogue of a square ( ) and a cube ( ); the special case for is known as a ''tesseract''. It is a closed, compact, convex figure whose 1- skeleton consists of groups of opposite parallel l ...
. For instance, the
cube graph is the graph formed by the 8 vertices and 12 edges of a three-dimensional cube.
has
vertices, edges, and is a
regular graph with edges touching each vertex.
The hypercube graph may also be constructed by creating a vertex for each
subset
In mathematics, a Set (mathematics), set ''A'' is a subset of a set ''B'' if all Element (mathematics), elements of ''A'' are also elements of ''B''; ''B'' is then a superset of ''A''. It is possible for ''A'' and ''B'' to be equal; if they a ...
of an -element set, with two vertices adjacent when their subsets differ in a single element, or by creating a vertex for each -digit
binary number
A binary number is a number expressed in the Radix, base-2 numeral system or binary numeral system, a method for representing numbers that uses only two symbols for the natural numbers: typically "0" (zero) and "1" (one). A ''binary number'' may ...
, with two vertices adjacent when their binary representations differ in a single digit. It is the -fold
Cartesian product
In mathematics, specifically set theory, the Cartesian product of two sets and , denoted , is the set of all ordered pairs where is an element of and is an element of . In terms of set-builder notation, that is
A\times B = \.
A table c ...
of the two-vertex
complete graph, and may be decomposed into two copies of 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 that is a cubic graph is the cubical graph .
Construction

The hypercube graph may be constructed from the family of
subsets
In mathematics, a set ''A'' is a subset of a set ''B'' if all elements of ''A'' are also elements of ''B''; ''B'' is then a superset of ''A''. It is possible for ''A'' and ''B'' to be equal; if they are unequal, then ''A'' is a proper subse ...
of a
set with 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 vertices labeled with -bit
binary number
A binary number is a number expressed in the Radix, base-2 numeral system or binary numeral system, a method for representing numbers that uses only two symbols for the natural numbers: typically "0" (zero) and "1" (one). A ''binary number'' may ...
s and connecting two vertices by an edge whenever the
Hamming distance
In information theory, the Hamming distance between two String (computer science), strings or vectors of equal length is the number of positions at which the corresponding symbols are different. In other words, it measures the minimum number ...
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 digit), and two such sets differ in a single element whenever the corresponding two binary numbers have Hamming distance one.
Alternatively, may be constructed from the
disjoint union
In mathematics, the disjoint union (or discriminated union) A \sqcup B of the sets and is the set formed from the elements of and labelled (indexed) with the name of the set from which they come. So, an element belonging to both and appe ...
of two hypercubes , by adding an edge from each vertex in one copy of 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, . Copying is done via the
Kronecker product, so that the two copies of have an adjacency matrix ,where is the
identity matrix
In linear algebra, the identity matrix of size n is the n\times n square matrix with ones on the main diagonal and zeros elsewhere. It has unique properties, for example when the identity matrix represents a geometric transformation, the obje ...
in dimensions. Meanwhile the joining edges have an adjacency matrix . The sum of these two terms gives a recursive function function for the adjacency matrix of a hypercube:
Another construction of is the
Cartesian product
In mathematics, specifically set theory, the Cartesian product of two sets and , denoted , is the set of all ordered pairs where is an element of and is an element of . In terms of set-builder notation, that is
A\times B = \.
A table c ...
of two-vertex complete graphs . 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 consists of a single vertex, while is the
complete graph on two vertices.
is a
cycle of length .
The graph is the
1-skeleton of a
cube
A cube or regular hexahedron is a three-dimensional space, three-dimensional solid object in geometry, which is bounded by six congruent square (geometry), square faces, a type of polyhedron. It has twelve congruent edges and eight vertices. It i ...
and is a planar graph with eight
vertices and twelve
edges.
The graph is the
Levi graph of the
Möbius configuration. It is also the
knight's graph for a
toroidal chessboard.
Properties
Bipartiteness
Every hypercube graph is
bipartite: it can be
colored
''Colored'' (or ''coloured'') is a racial descriptor historically used in the United States during the Jim Crow era to refer to an African American. In many places, it may be considered a slur.
Dictionary definitions
The word ''colored'' wa ...
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 with has a
Hamiltonian cycle
In the mathematics, mathematical field of graph theory, a Hamiltonian path (or traceable path) is a path (graph theory), path in an undirected or directed graph that visits each vertex (graph theory), vertex exactly once. A Hamiltonian cycle (or ...
, a cycle that visits each vertex exactly once. Additionally, a
Hamiltonian path exists between two vertices and if and only if they have different colors in a -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
In mathematics, a bijection, bijective function, or one-to-one correspondence is a function between two sets such that each element of the second set (the codomain) is the image of exactly one element of the first set (the domain). Equival ...
correspondence between the set of -bit cyclic Gray codes and the set of Hamiltonian cycles in the hypercube . 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 (for ) :
* is the
Hasse diagram of a finite
Boolean algebra
In mathematics and mathematical logic, Boolean algebra is a branch of algebra. It differs from elementary algebra in two ways. First, the values of the variable (mathematics), variables are the truth values ''true'' and ''false'', usually denot ...
.
* 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 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 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 elements, choosing a distinct
unit vector
In mathematics, a unit vector in a normed vector space is a Vector (mathematics and physics), vector (often a vector (geometry), spatial vector) of Norm (mathematics), length 1. A unit vector is often denoted by a lowercase letter with a circumfle ...
for each set element, and placing the vertex corresponding to the set at the sum of the vectors in .
* is a
-vertex-connected graph, by
Balinski's theorem.
* is
planar (can be
drawn with no crossings) if and only if . For larger values of , the hypercube has
genus
Genus (; : genera ) is a taxonomic rank above species and below family (taxonomy), family as used in the biological classification of extant taxon, living and fossil organisms as well as Virus classification#ICTV classification, viruses. In bino ...
.
[.]
* has exactly
spanning trees.
* has
bandwidth exactly
.
* has
achromatic number proportional to
, but the constant of proportionality is not known precisely.
* has as the eigenvalues of its
adjacency matrix the numbers and as the eigenvalues of its Laplacian matrix the numbers . The th eigenvalue has multiplicity
in both cases.
* has
isoperimetric number .
The family for all 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
Network topology is the arrangement of the elements (Data link, links, Node (networking), nodes, etc.) of a communication network. Network topology can be used to define or describe the arrangement of various types of telecommunication networks, ...
for communications. It states that, no matter how one chooses a
permutation
In mathematics, a permutation of a set can mean one of two different things:
* an arrangement of its members in a sequence or linear order, or
* the act or process of changing the linear order of an ordered set.
An example of the first mean ...
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.
[.]
See also
*
de Bruijn graph
*
Cube-connected cycles
*
Fibonacci cube
*
Folded cube graph
In graph theory, a folded cube graph is an undirected graph formed from a hypercube graph by adding to it a perfect matching that connects ''opposite'' pairs of hypercube vertices.
Construction
The folded cube graph of dimension ''k'' (containin ...
*
Frankl–Rödl graph
*
Halved cube graph
*
Hypercube internetwork topology
*
Partial cube
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
.
Parametric families of graphs
Regular graphs