# Unit distance graph

In mathematics, and particularly geometric graph theory, a unit distance graph is a graph formed from a collection of points in the Euclidean plane by connecting two points by an edge whenever the distance between the two points is exactly one. Edges of unit distance graphs sometimes cross each other, so they are not always planar; a unit distance graph without crossings is called a matchstick graph.

The Hadwiger–Nelson problem concerns the chromatic number of unit distance graphs. It is known that there exist unit distance graphs requiring five colors in any proper coloring, and that all such graphs can be colored with at most seven colors. Another important open problem concerning unit distance graphs asks how many edges they can have relative to their number of vertices.

## Examples

The following graphs are unit distance graphs:

Any Cartesian product of unit distance graphs produces another unit distance graph. However, the same is not true for other commonly-used graph products (Horvat & Pisanski 2010).

## Subgraphs of unit distance graphs

Some sources define a graph as being a unit distance graph if its vertices can be mapped to distinct locations in the plane such that adjacent pairs are at unit distance apart, disregarding the possibility that some non-adjacent pairs might also be at unit distance apart. For instance, the Möbius-Kantor graph has a drawing of this type.

According to this looser definition of a unit distance graph, all generalized Petersen graphs are unit distance graphs (Žitnik, Horvat & Pisanski 2010). In order to distinguish the two definitions, the graphs in which non-edges are required to be a non-unit distance apart may be called strict unit distance graphs (Gervacio, Lim & Maehara 2008).

The graph formed by removing one of the spokes from the wheel graph W7 is a subgraph of a unit distance graph, but is not a strict unit distance graph: there is only one way (up to congruence) to place the vertices at distinct locations such that adjacent vertices are a unit distance apart, and this placement also puts the two endpoints of the missing spoke at unit distance (Soifer 2008, p. 94).

## Counting unit distances

 Unsolved problem in mathematics:How many unit distances can be determined by a set of $n$ points?(more unsolved problems in mathematics)

Paul Erdős (1946) posed the problem of estimating how many pairs of points in a set of n points could be at unit distance from each other. In graph theoretic terms, how dense can a unit distance graph be?

The hypercube graph provides a lower bound on the number of unit distances proportional to $n\log n.$ By considering points in a square grid with carefully chosen spacing, Erdős found an improved lower bound of the form

$n^{1+c/\log \log n},$ and offered a prize of \$500 for determining whether or not the maximum number of unit distances can also be upper bounded by a function of this form (Kuperberg 1992). The best known upper bound for this problem, due to Joel Spencer, Endre Szemerédi, and William Trotter (1984), is proportional to

$n^{4/3};$ this bound can also be viewed as counting incidences between points and unit circles, and is closely related to the Szemerédi–Trotter theorem on incidences between points and lines.

## Representation of algebraic numbers and the Beckman–Quarles theorem

For every algebraic number A, it is possible to find a unit distance graph G in which some pair of vertices are at distance A in all unit distance representations of G (Maehara 1991, 1992). This result implies a finite version of the Beckman–Quarles theorem: for any two points p and q at distance A, there exists a finite rigid unit distance graph containing p and q such that any transformation of the plane that preserves the unit distances in this graph preserves the distance between p and q (Tyszka 2000). The full Beckman–Quarles theorem states that any transformation of the Euclidean plane (or a higher-dimensional space) that preserves unit distances must be a congruence; that is, for the infinite unit distance graph whose vertices are all the points in the plane, any graph automorphism must be an isometry (Beckman & Quarles 1953).

## Generalization to higher dimensions

The definition of a unit distance graph may naturally be generalized to any higher-dimensional Euclidean space. Any graph may be embedded as a set of points in a sufficiently high dimension; Maehara & Rödl (1990) show that the dimension necessary to embed a graph in this way may be bounded by twice its maximum degree.

The dimension needed to embed a graph so that all edges have unit distance, and the dimension needed to embed a graph so that the edges are exactly the unit distance pairs, may greatly differ from each other: the 2n-vertex crown graph may be embedded in four dimensions so that all its edges have unit length, but requires at least n  2 dimensions to be embedded so that the edges are the only unit-distance pairs (Erdős & Simonovits 1980).

## Computational complexity

It is NP-hard, and more specifically complete for the existential theory of the reals, to test whether a given graph is a unit distance graph, or is a strict unit distance graph (Schaefer 2013).

It is also NP-complete to determine whether a unit distance graph has a Hamiltonian cycle, even when the vertices of the graph all have integer coordinates (Itai, Papadimitriou & Szwarcfiter 1982).