Almost-equidistant sets

For a positive integer $d$, a set of points in $d$-dimensional Euclidean space is called almost-equidistant if for any three points from the set, some two are at unit distance. Let $f(d)$ denote the largest size of an almost-equidistant set in $d$-space. It is known that $f(2)=7$, $f(3)=10$, and that the extremal almost-equidistant sets are unique. We give independent, computer-assisted proofs of these statements. It is also known that $f(5) \ge 16$. We further show that $12\leq f(4)\leq 13$, $f(5)\leq 20$, $18\leq f(6)\leq 26$, $20\leq f(7)\leq 34$, and $f(9)\geq f(8)\geq 24$. Up to dimension $7$, our work is based on various computer searches, and in dimensions $6$ to $9$, we give constructions based on the known construction for $d=5$. For every dimension $d \ge 3$, we give an example of an almost-equidistant set of $2d+4$ points in the $d$-space and we prove the asymptotic upper bound $f(d) \le O(d^{3/2})$.


Introduction and our results
For a positive integer d, we denote the d-dimensional Euclidean space by R d . A set V of (distinct) points in R d is called almost equidistant if among any three of them, some pair is at distance 1. Let f (d) be the maximum size of an almost-equidistant set in R d . For example, the vertex set of the well-known Moser spindle ( Figure 1) is an almost-equidistant set of 7 points in the plane and thus f (2) ≥ 7.
In this paper we study the growth rate of the function f . We first consider the case when the dimension d is small and give some almost tight estimates on f (d) for d ≤ 9. Then we turn to higher dimensions and show 2d + 4 ≤ f (d) ≤ O(d 3/2 ). We also discuss some possible generalisations of the problem.

Our results in low dimensions
It is trivial that f (1) = 4 and that, up to congruence, there is a unique almost-equidistant set on 4 points in R. Bezdek, Naszódi, and Visy [5] showed that an almost-equidistant set in the plane has at most 7 points. Talata (personal communication) showed in 2007 that there is a unique extremal set. We give a simple, computer-assisted proof of this result.
Theorem 1 (Talata, 2007). The largest number of points in an almost-equidistant set in R 2 is 7, that is, f (2) = 7. Moreover, up to congruence, there is only one planar almost-equidistant set with 7 points, namely the Moser spindle. Figure 2 shows an example of an almost-equidistant set of 10 points in R 3 . It is made by taking a so-called biaugmented tetrahedron, which is a non-convex polytope formed by gluing three unit tetrahedra together at faces, and rotating a copy of it along the axis through the two simple vertices so that two additional unit-distance edges are created. This unit-distance graph is used in a paper of Nechushtan [19] to show that the chromatic number of R 3 is at least 6. Györey [13] showed, by an elaborate case analysis, that this is the unique largest almost-equidistant set in dimension 3. We again give an independent, computer-assisted proof.
Theorem 2 (Györey [13]). The largest number of points in an almost-equidistant set in R 3 is 10, that is, f (3) = 10. Moreover, up to congruence, there is only one almost-equidistant set in R 3 with 10 points.
In dimension 4, we have only been able to obtain the following bounds.  The lower bound comes from a generalization of the example in Figure 2; see also Theorem 5. The proofs of the upper bounds in the above theorems are computer assisted. Based on some numerical work to find approximate realisations of graphs, we believe, but cannot prove rigorously, that there does not exist an almost-equidistant set of 13 points in R 4 . Conjecture 1. The largest number of points in an almost-equidistant set in R 4 is 12, that is, f (4) = 12.
In dimension 5, Larman and Rogers [16] showed that f (5) ≥ 16 by a construction based on the so-called Clebsch graph. In dimensions 6 to 9, we use their construction to obtain lower bounds that are stronger than the lower bound 2d + 4 stated below in Theorem 5. We again complement this with some computer-assisted upper bounds.
The unit-distance graph of an almost-equidistant point set P in R d is the graph obtained from P by letting P be its vertex set and by placing an edge between pairs of points at unit distance.
For every d ∈ N, a unit-distance graph in R d does not contain K d+2 (see Corollary 8) and the complement of the unit-distance graph of an almost-equidistant set is triangle-free.
is the Ramsey number of K d+2 and K 3 , that is, the smallest positive integer N such that for every graph G on N vertices there is a copy of K d+2 in G or a copy of K 3 in the complement of G.

Our results in higher dimensions
We now turn to higher dimensions. The obvious generalization of the Moser spindle gives an example of an almost-equidistant set of 2d + 3 points in R d . The next theorem improves this by 1. It is a generalization of the almost-equidistant set on 10 points in R 3 from Figure 2.
Theorem 5. In each dimension d ≥ 3, there is an almost-equidistant set in R d with 2d + 4 points.
Rosenfeld [23] showed that an almost-equidistant set on a sphere in R d of radius 1/ √ 2 has size at most 2d, which is best possible. Rosenfeld's proof, which uses linear algebra, was adapted by Bezdek and Langi [4] to spheres of other radii. They showed that an almost-equidistant set on a sphere in R d of radius ≤ 1/ √ 2 has at most 2d + 2 elements, which is attained by the union of two d-simplices inscribed in the same sphere.
Pudlák [21] and Deaett [10] gave simpler proofs of Rosenfeld's result. Our final result is an asymptotic upper bound for the size of an almost-equidistant set, based on Deaett's proof [10]. We note that Polyanskii [20] recently found an upper bound of O(d 13/9 ) for the size of an almost-equidistant set in R d and Kupavskii, Mustafa, and Swanepoel [15] improved this to O(d 4/3 ). Both papers use ideas from our proof of Theorem 6.
In this paper, we use v to denote the Euclidean norm of a vector v from R d . For a subset S of R d , we use span(S) and aff(S) to denote the linear hull and the affine hull of S, respectively.
The proofs of Theorems 5 and 6 are in Section 2. Theorems 1 to 4 are proved in Section 3. In Section 4, we discuss a possible generalization of the problem of determining the function f .

High dimensions
In this section, we first prove Theorem 5 by constructing, for every integer d ≥ 3, an almost-equidistant set in R d with 2d + 4 points. In the rest of the section, we prove Theorem 6 by showing the upper bound f (d) ≤ O(d 3/2 ).

Proof of Theorem 5
Consider an equilateral d-simplex with vertex set S = {x 0 , . . . , x d }. Let x i be the reflection of x i in the hyperplane through the facet of not containing x i . We will show that there exists an isometry ρ of R d that fixes the line determined by x 0 and x 1 such that the distances x 0 − ρ(x 0 ) and x 1 − ρ(x 1 ) are both 1, and such that {x 0 , . . . , With such an isometry ρ, the set R := S ∪ ρ(S) ∪ {x 0 , x 1 } clearly contains 2d + 4 distinct points. We next show that R is almost equidistant. Suppose for contradiction there is a subset of R with three points and with no pair of points at distance 1. Since S and ρ(S) form cliques in the unit-distance graph of R and every point from S ∪ ρ(S) is at unit distance from x 0 or x 1 , this subset is necessarily {x i , ρ(x j ), x k } for some i, j ∈ {0, . . . , d} and k ∈ {0, 1}. Since x k is at distance 1 from all other points in S ∪ ρ(S) except x k and ρ(x k ), we obtain i = k and j = k. However, then the points x k and ρ(x k ) are at distance 1, as the isometry ρ is chosen so that x k − ρ(x k ) = 1, contradicting the choice of the 3-point subset.
It remains to show that there exists an isometry ρ as described above. Let c := 1 2 (x 0 + x 1 ), and assume without loss of generality that Let V be any 2-dimensional subspace containing o and c. (For instance, we can let V be the linear span of c and x 2 .) Let π be the orthogonal projection of R d onto V . Then π(x 0 ) = π(x 1 ) = c and π(x 0 ) = π( Then ρ is an isometry that fixes the orthogonal complement of V (including x 0 and x 1 ) and moves x 0 and x 1 by a distance of 1. Since x 0 , x 1 / ∈ H, it follows that ρ(x 0 ), ρ(x 1 ) / ∈ H, hence ρ(x 0 ), ρ(x 1 ) do not coincide with any of x 2 , . . . , x d . Similarly, x 0 , x 1 do not coincide with any of ρ(x 2 ), . . . , ρ(x d ). It remains to show that {x 2 , . . . , x d } is disjoint from {ρ(x 2 ), . . . , ρ(x d )}. It is sufficient to prove that x i − ρ(x i ) < 1 for all i = 2, . . . , d, since x i − x j = 1 for all distinct i and j, and ρ does not fix any of x 2 , . . . , x d . We first calculate that Note that and similarly, It follows that We can embed R d isometrically into the hyperplane {(λ 0 , . . . , λ d ) | λ 0 + · · · + λ d = 1} of R d+1 by sending x i to 1 √ 2 e i ∈ R d+1 , i = 0, . . . , d. It follows that which is the first half of (1). Similarly, it follows that which establishes the second half of (1). Since the isometry ρ is a rotation in V , moving each point in V at distance 1 − 1 d 2 from o by a distance of 1, it will move each point in R d at distance less than 1 − 1 d 2 from o by a distance less than 1. Therefore, x 2 , . . . , x d are all moved by a distance less than 1, and the proof is finished.

Proof of Theorem 6
As a first step towards this proof, we show the following lemma, whose statement is illustrated in Figure 3. This lemma is also used later in Section 3.
Lemma 7. For d, k ∈ N, let C be a set of k points in R d such that the distance between any two of them is 1. Let c := 1 k p∈C p be the centroid of C and let A := span(C − c). Then the set of points equidistant from all points of C is the affine space c+A ⊥ orthogonal to A and passing through c. Furthermore, the intersection of all unit spheres centred at the points in C is the (d − k)-dimensional sphere of radius (k + 1)/(2k) centred at c and contained in c Figure 3: An illustration of the statement of Lemma 7 for d = k = 2. The points p 1 and p 2 are at distance 1. The intersection of the unit spheres centred at p 1 and p 2 is the 0-dimensional sphere of radius (k + 1)/(2k) = √ 3/2 centred at c.
gives the first part of the lemma. For every x ∈ R d and each i ∈ {1, . . . , k}, we have Let be the standard (k − 1)-simplex with vertices (1, 0, . . . , 0), . . . , (0, . . . , 0, 1) embedded in R k . Note that √ 2 p i − c is the distance between a vertex of and its centroid (1/k, . . . , 1/k), which is (k − 1)/k. Therefore p i − c = (k − 1)/(2k) and, in particular, for every i ∈ {1, . . . , k} and thus . . , k}, then the equality (2) gives Using this fact and the expression of c, we obtain where o denotes the origin in R d . Thus x − c, p i − c = η = 0 for every i ∈ {1, . . . , k} and, since every element of A is a linear combination of elements from C − c, we have For the second part of the lemma, let S be the intersection of all unit spheres centred at the points in C. By the first part of the lemma, we know that Corollary 8. For d ∈ N, every subset of R d contains at most d + 1 points that are pairwise at unit distance.
Proof. Lemma 7 applied to a set C of d points in R d with all pairs of points at unit distance implies that the set of points that are at unit distance from all points in C lies on a 0-dimensional sphere of diameter 2 (d + 1)/(2d) = 1.
The following lemma is a well-known result that bounds the rank of a square matrix from below in terms of the entries of the matrix [2,10,21].
The last lemma before the proof of Theorem 6 can be proved by a calculation, using its assumption that the vectors v i have pairwise inner products ε, so they differ from an orthogonal set by some skewing.
and such that for some orthonormal basis e 1 , . . . , e n we have Proof. Let ε ∈ [0, 1) and w 1 , . . . , w t be from the statement of the lemma. We first extend the set {w 1 , . . . , w t } to a set {w 1 , . . . , w n } of unit vectors in R n so that w i , w j = ε for all i, j with 1 ≤ i < j ≤ n. We proceed iteratively, choosing w i+1 after the vectors w 1 , . . . , w i have been obtained for some i with t ≤ i < n. The condition w i , w j = ε for each j with 1 ≤ j < i says that the desired point w i+1 lies in the hyperplanes {x ∈ R n | x, w j = ε}. Since ε ≥ 0, the intersection of these hyperplanes taken over j ∈ {1, . . . , i} is an affine subspace A of dimension at least n − i ≥ 1. The subspace A contains the point which is in the convex hull of {w 1 , . . . , w j−1 , εw j , w j+1 , . . . , w i } for every j ∈ {1, . . . , i}.
Since ε < 1, each point εw j is inside the unit ball centred in the origin and so is a. Additionally, A does not contain any of the points w 1 , . . . , w i . Altogether, A intersects the unit sphere centred in the origin at a point that is not in {w 1 , . . . , w i }. We let w i+1 be an arbitrary point from this intersection. For i = n − 1, we obtain the set {w 1 , . . . , w n }.
To show e i + λe 2 = (1 − ε) −1 for each i ∈ {1, . . . , n}, we simply use the fact that w i is a unit vector and derive It remains to prove the last expression in the statement of the lemma. Let x be an arbitrary point from R n . Since e 1 , . . . , e n is a basis of R n , we have x = n i=1 α i e i for some (α 1 , . . . , α n ) ∈ R n . For each j ∈ {1, . . . , n}, we express the term x, w j as using the facts that the basis e 1 , . . . , e n is orthonormal and that w j = √ 1 − ε(e j + λe).
Since the basis e 1 , . . . , e n is orthonormal, we have x 2 = n i=1 n j=1 α i α j e i , e j = n i=1 α 2 i and, since e = n j=1 e j , we also have x, e = n i=1 n j=1 α i e i , e j = n i=1 α i . The above expression thus equals Using the facts that 2λ + λ 2 n = ε/(1 − ε) and 1 + λn = 1+(n−1)ε 1−ε , this expression can be further simplified as and then rewritten to the final form We are now ready to prove Theorem 6. For d ≥ 2, let V ⊂ R d be an almost-equidistant set. We let G = (V, E) be the unit-distance graph of V and let k : Let S ⊆ V be a set of k points such that the distance between any two of them is 1. If such a set does not exist, then, since the complement of G does not contain a triangle, we have |V | < R(k, 3), where R(k, 3) is the Ramsey number of K k and K 3 . Using the bound R(k, 3) ≤ k+3−2 3−1 obtained by Erdős and Szekeres [11], we derive Thus we assume in the rest of the proof that S exists. Let B be the set of common neighbours of S, that is, Since V is equidistant, the set of non-neighbours of any vertex of G is a clique and so it has size at most d + 1 by Corollary 8. Every vertex from V \ B is a non-neighbour of some vertex from S and thus it follows that |V \ B| ≤ k(d + 2).
We now estimate the size of B. By Lemma 7 applied to S, the set B lies on a sphere of radius (k + 1)/2k in an affine subspace of dimension d − k + 1. We may take the centre of this sphere as the origin, and rescale by 2k/(k + 1) to obtain a set B of m unit vectors v 1 , . . . , v m ∈ R d−k+1 where m := |B|. For any three of the vectors from B , the distance between some two of them is 2k/(k + 1). For two such vectors where ε := 1/(k + 1). Note that the opposite implication also holds. That is, if v i , v j = ε, then v i and v j are at distance 2k/(k + 1).
Clearly, A is a symmetric matrix with real entries. If m ≥ d − k + 2, then A is also non-zero, as G contains no K d+2 and every vertex from B is adjacent to every vertex from S in G. We recall that rank XY ≤ min{rank X, rank Y } and rank(X + Y ) ≤ rank X + rank Y for two matrices X and Y . Since where J is the m × m matrix with each entry equal to 1, we have By Lemma 9, For i ∈ {1, . . . , m}, let N i be the set of vectors from B that are at distance 2k/(k + 1) from v i . That is, Note that the vectors from B \ (N i ∪ {v i }) have pairwise inner products ε, as neither of them is at distance 2k/(k + 1) from v i , and thus |B \ (N i ∪ {v i })| ≤ d − k + 2. In fact, we even have |B \ (N i ∪ {v i })| ≤ d − k + 1, since B contains only unit vectors and any subset of d − k + 2 points from B with pairwise distances 2k/(k + 1) would form the vertex set of a regular (d − k + 1)-simplex with edge lengths 2k/(k + 1) centred at the origin. However, then the distance from the centroid of such a simplex to its vertices would be equal to k(d − k + 1)/((k + 1)(d − k + 2)) = 1, which is impossible.

Low dimensions
In this section, we give proofs of Theorems 1, 2, 3, and 4. Before doing so, we introduce the notion of abstract almost-equidistant graphs. Denote the complete t-partite graph with classes of sizes m 1 , . . . , m t by K m 1 ,...,mt or K t (m 1 , . . . , m t ). A graph G is said to be an abstract almost-equidistant graph in R d if the complement of G does not contain K 3 and either • d = 2 and G does not contain K 4 nor K 2,3 ; • or d ≥ 3, d odd and G does not contain K d+2 nor K (d+1)/2 (3, . . . , 3); • or d ≥ 4, d even and G does not contain K d+2 nor K (d+2)/2 (1, 3, . . . , 3).
The following lemma justifies the notion of abstract almost-equidistant graphs. We will see later that its converse is not true, as there are abstract almost-equidistant graphs in R d that are not unit-distance graphs of any point set from R d .
Lemma 11. For every d ≥ 2 and every almost-equidistant set P from R d , the unitdistance graph of P is an abstract almost-equidistant graph in R d .
Proof. Let G be the unit-distance graph of an almost-equidistant set P ⊂ R d . Clearly, the complement of G does not contain a triangle, as P is almost equidistant. The graph G also does not contain a copy of K d+2 by Corollary 8. Thus it remains to show that K 2,3 does not occur as a unit-distance graph in R 2 , K (d+1)/2 (3, . . . , 3) does not occur as a unit-distance graph for odd d ≥ 3, and K (d+2)/2 (1, 3, . . . , 3) does not occur as a unit-distance graph for even d ≥ 4.
For d = 2, Suppose that K 2,3 occurs as a unit-distance graph in R 2 . Let the class with two points be {p, q}. The set of points that are at the same distance from both p and q is the intersection of two unit circles centred at p and q, respectively, and thus contains at most two points. Therefore, the other class cannot contain three points.
For odd d ≥ 3, suppose for contradiction that there exist sets V 1 , . . . , V k , where k = (d + 1)/2, such that each V i contains three points, and such that the distance between any two points from different V i equals 1. As in the proof of Lemma 7, it is easy to show that each V i lies on a circle. Furthermore, for any distinct i, j, a 1 − a 2 ⊥ b 1 − b 2 for all a 1 , a 2 ∈ V i and b 1 , b 2 ∈ V j . Thus the affine hulls of the V i s are pairwise orthogonal to each other, hence V 1 ∪ · · · ∪ V k together span a space of dimension at least 2k > d, a contradiction.
For even d ≥ 4, suppose that there exist sets four points a, b, c, d with a − b = a − c = a − d = 1, the sets V 2 , . . . , V k each contains three points, and such that the distance between any two points from different V i equals 1. As in the case of odd d, the V i lie on circles (or a sphere in the case of V 1 ), the affine hulls of the V i s have dimension at least 2 and are pairwise orthogonal to each other, hence V 1 ∪ · · · ∪ V k together span a space of dimension at least 2k = d. It follows that the affine hull of V 1 ∪ · · · ∪ V k has dimension exactly 2k, and that the affine hulls of all the the V i s are 2-dimensional. In particular, we have that a, b, c, d lie on a circle C. However, then C and the unit circle with centre a intersect in 3 points, a contradiction.

An abstract almost-equidistant graph
there is a point set P in R d , called a realisation of G, and a one-to-one correspondence f : P → V such that, for all points p and q from P , if {f (p), f (q)} ∈ E, then p and q are at unit distance. If G is not realisable in R d , then we say that it is non-realisable. For a realisable graph G and its realisation P , we sometimes do not distinguish between the vertices of G and the points from P .
By Lemma 11, if there is no realisable abstract almost-equidistant graphs in R d on n vertices, then there is no almost-equidistant set in R d of size n. Using a simple exhaustive computer search, we enumerated all non-isomorphic graphs that are abstract almost-equidistant in R d for d ∈ {2, 3, 4, 5, 6}. We filtered out graphs that are minimal, meaning that any graph obtained by removing any edge from such a graph is no longer abstract almost-equidistant. We summarise our results obtained by the computer search in Tables 2 and 3. More detailed description of our computations can be found in Section 3.5.
The core of the proofs of Theorems 1, 2, and 3 is to show that none of the minimal abstract almost-equidistant graphs in R d is realisable in R d for d = 2, 3, 4, respectively.

Proof of Theorem 1
We show that f (2) = 7 and that, up to congruence, there is only one planar almostequidistant set with 7 points, namely the Moser spindle.
A computer search shows that, up to isomorphism, there are exactly two abstract almost-equidistant graphs on 7 vertices. One of them is the Moser spindle (Figure 1), which is clearly uniquely realisable in the plane up to congruence. The other graph (part (a) of Figure 4) is the graph of the square antiprism with one point removed, which is easily seen to be non-realisable in the plane. Lemma 11 thus implies that the Moser spindle is the unique (up to congruence) almost-equidistant set in the plane on 7 points.
There is a unique abstract almost-equidistant graph on 8 vertices, namely the graph of the square antiprism (part (b) of Figure 4), which is not realisable in the plane because it   [7,9,25]. The entries denoted by "?" are not known.  [18,25]. The entries denoted by "?" are not known. contains a non-realisable subgraph, namely the non-realisable abstract almost-equidistant graph on 7 vertices drawn in part (a) of Figure 4. Thus, by Lemma 11, there is no almost-equidistant set in the plane on 8 points.

Proof of Theorem 2
We prove f (3) = 10 and that, up to congruence, there is only one almost-equidistant set in R 3 with 10 points. A computer search shows that there is exactly one abstract almost-equidistant graph G 11 in R 3 on 11 vertices (Figure 5), and exactly 7 abstract almost-equidistant graphs in R 3 on 10 vertices, four of which are minimal (Figures 2 and 6).
Although G 11 contains the first graph in Figure 6, and we will show that none of the graphs in Figure 6 are realisable in R 3 , it is worth observing the following direct argument for the non-realisability of G 11 . Suppose for contradiction that it is realisable in R 3 . We label the vertices p 0 to p 10 , with subscripts modulo 11, such that {p i , p j } is an edge of G 11 if and only if i − j ≡ ±1, ±2 (mod 11). There are 11 equilateral tetrahedra p i p i+1 p i+2 p i+3 in a realisation of G 11 . Let T : R 3 → R 3 be the unique isometry that maps the tetrahedron p 0 p 1 p 2 p 3 to p 1 p 2 p 3 p 4 , that is, T (p i ) = p i+1 for i = 0, 1, 2, 3. Note that p 0 depending on the sign of sin α. However, both these expressions are larger than 1.
The graph in part (b) of Figure 6 is the complement of the Petersen graph, and contains 5 copies of the graph of the regular octahedron, one for every induced matching of three edges in the Petersen graph. Each such octahedron is uniquely realisable in R 3 . The octahedron O 1 with diagonals {p 0 p 6 , p 7 p 9 , p 3 p 8 } and the octahedron O 2 with diagonals {p 0 p 4 , p 1 p 3 , p 2 p 7 } have a common face p 0 p 3 p 7 . The only way to realise O 1 and O 2 is with the opposite faces p 6 p 8 p 9 and p 4 p 1 p 2 in two planes parallel to the plane of p 0 p 3 p 7 . Since an octahedron with edges of unit length has width 2/3, we obtain that the distance between p 4 and p 6 (both opposite to p 0 in O 1 and O 2 , respectively) is 2 2/3, which is impossible, as they have to be at unit distance.
The graph in part (c) of Figure 6 is a ring of 5 unit tetrahedra p i q i p i+1 q i+1 , i = 0, . . . , 4 with indices taken modulo 5, with two successive ones joined at an edge p i q i . Suppose for contradiction that we have a realisation of this graph in R 3 . Let m i be the midpoint of p i q i for each i ∈ {0, . . . , 4}. The distance between m i and m i+1 is r = 1/ √ 2. Since each p i q i is orthogonal to p i+1 q i+1 , it follows that m i , p i−1 q i−1 , and p i+1 q i+1 lie in the same plane and the lines p i−1 q i−1 and p i+1 q i+1 are tangent to the circle C i in this plane with centre m i and radius r. If C 1 and C 3 were in the same plane, then the edges p 4 q 4 and p 0 q 0 of the tetrahedron p 0 q 0 p 4 q 4 would have to be coplanar. Therefore C 1 and C 3 are in different planes, but they have the same tangent line p 2 q 2 touching both at m 2 . It follows that they lie on a unique sphere Σ. The lines p 0 q 0 and p 4 q 4 are tangent to Σ at m 0 and m 4 , respectively. It follows that the plane Π 0 through m 0 orthogonal to p 0 q 0 and the plane Π 4 through m 4 orthogonal to p 4 q 4 both contain the centre c of Σ. Thus c ∈ Π 0 ∩ Π 4 . Since both Π 0 and Π 4 contain m 0 and m 4 , it follows that Π 0 ∩ Π 4 is the line m 0 m 4 , and it follows that c ∈ m 0 m 4 , that is, m 0 − m 4 = r is a diameter of Σ. However, Σ contains two circles on its boundary of radius r, a contradiction.
Thus there is only one realisable abstract almost-equidistant graph in R 3 on 10 vertices and, by Lemma 11, there is also a unique (up to congruence) almost-equidistant set in R 3 on 10 points.

Proof of Theorem 3
We want to show that 12 ≤ f (4) ≤ 13. To do so, we use the following result, which says that the graph in Figure 7 is not realisable in R 4 . all points p i are on a sphere with centre c. However, the points p 0 , p 2 , p 3 , p 5 , p 8 , p 11 are easily seen not to lie on a sphere (for example, by using Lemma 7), a contradiction.
Using Lemma 11, we conclude that every almost-equidistant set in 4-space of maximum cardinality has at most 13 points.

Proof of Theorem 4
Here, we prove the estimates f (6) ≥ 18, f (7) ≥ 20, and f (9) ≥ f (8) ≥ 24 using the construction of Larman and Rogers [16] that gives f (5) ≥ 16. The computer search for the upper bounds is described in the next section. We first briefly describe the Larman-Rogers construction of an almost-equidistant set of 16 points in R 5 . Let V be the set of vertices of the cube {±1} 5 in R 5 with an odd number of positive signs. It is easy to check that |V | = 16 and that for any three points in V , some two differ in exactly two coordinates. Moreover, any two points differ in either two or four coordinates and then their distance is √ 8 or 4, respectively. It follows that S := 1 √ 8 V is an almost-equidistant set in R 5 . Also note that the norm of every vector from S is exactly 5/8.
Consider R 6 = E 1 ⊕ Re where dim E 1 = 5 and e is a unit vector orthogonal to E 1 . We place S in E 1 and show that S ∪ {± 3/8e} is an almost-equidistant set of 18 points in R 6 . Since S is an almost-equidistant set in R 5 , it suffices to check triples of points from S ∪ {± 3/8e} containing points from {± 3/8e}. Let T be such a triple. Then T contains a point p from S and q from {± 3/8e}. Since p and q are orthogonal, we obtain p − q 2 = p, p − 2 p, q + q, q = 5/8 + 0 + 3/8 = 1. Thus T contains a pair of points at unit distance and, consequently, f (6) ≥ 18.
Next consider We show that S ∪S is an almost-equidistant set of 20 points in R 7 . Again, since S is an almost-equidistant set in R 5 , we only need to check triples T of points from S ∪ S containing some of the vectors from S . Analogously as before, the distance between every point from S and every point of S is 1, as the norm of every vector from S is 3/8 and E 1 ⊥ E 2 . We can thus assume T ⊆ S . If two vectors from S differ only in the first coordinate, then their distance is 1. Since every triple of vectors from S contains a pair of vectors that differ only in the first coordinate, we obtain that T contains a pair of points at unit distance and thus f (7) ≥ 20.
Next consider Again, it suffices to check triples T of points from S ∪ S with T ∩ S = ∅. The distance between every point in S and every point in S again equals 1 and thus we can assume T ⊆ S . Every triple of points from S contains a pair of points that differ in exactly two coordinates and so they are at distance 1. Thus S is an almost-equidistant set of 8 points. It follows that S ∪ S is an almost-equidistant set of 24 points in R 8 , which implies that f (9) ≥ f (8) ≥ 24.

The computer search
In this subsection we describe how we computed the entries as stated in Tables 2 and 3, and also the upper bounds as stated in Table 1.
First, we describe our simple approach to generate all n-vertex abstract almostequidistant graphs in R d for given n and d. We start with a single vertex and repeatedly add a new vertex and go through all possibilities of joining the new vertex to the old vertices. For each possibility of adding edges, we check if the resulting graph contains one of the two forbidden subgraphs and that its complement does not contain a triangle. We use two tricks to speed this up. First, when adding a vertex, we can assume that the newly inserted vertex has minimum degree in the extended graph. Secondly, we only have to go through all possibilities of adding at least n−d−1 new edges, where n is the number of vertices before extending the graph. This is because the degree of the newly added vertex has to be at least n − d − 1, since the complement of an abstract almost-equidistant graph G is triangle-free, hence the non-neighbours of each vertex induce a clique in G, which has at most d + 1 vertices. To find all minimal graphs, we repeatedly attempt to remove an edge and check that the complement is still triangle-free. Once this is no longer possible, we know that we have a minimal abstract almost-equidistant graph.
We implemented this approach in Sage and used it to obtain all abstract almostequidistant graphs in R d for d ∈ {2, 3, 4}. To find all abstract almost-equidistant graphs in R 5 on at most 15 vertices and in R 6 on at most 13 vertices, we used a C++ implementation of this approach. The obtained numbers of abstract almost-equidistant graphs are summarized in Table 3.
Unfortunately, our program was not able to find all minimal abstract almostequidistant graphs in R d on n vertices for d ≥ 5 and large n in reasonable time. To do this, we used the programs Triangleramsey [8,9] by Brinkmann, Goedgebeur, and Schlage-Puchta and MTF [6,7] by Brandt, Brinkmann, and Harmuth. These programs generate all minimal K d+2 -free graphs with no K 3 in their complement, the so-called Ramsey (3, d + 2)-graphs. For each Ramsey (3, d + 2)-graph on the output we tested whether it is a minimal abstract almost-equidistant graph in R d using a simple C++ program that checks forbidden subgraphs from Lemma 11. This allowed us to find all minimal abstract almost-equidistant graphs in R 5 and all minimal abstract almostequidistant graphs in R 6 with at most 19 vertices; see Table 2. We were also able to find some minimal abstract almost-equidistant graphs in R 6 on 25 vertices.
The source code of our programs and the files are available on a separate website [24].

A more general setting
We consider the following natural generalization of the problem of determining the maximum sizes of almost-equidistant sets. For positive integers d, k, and l with l ≤ k, let f (d, k, l) be the maximum size of a point set P in R d such that among any k + 1 points from P there are at least l + 1 points that are pairwise at unit distance. Since every subset of R d with all pairs of points at unit distance has size at most d + 1, we have f (d, 1, 1) = d + 1 for every d. In the case k = 2 and l = 1, Theorems 5 and 6 give 2d + 4 ≤ f (d, 2, 1) ≤ O(d 3/2 ) for every d ≥ 3. In this section, we discuss the problem of determining the growth rate of f (d, k, l) for larger values of d, k, and l. A similar problem, where the notion of unit distance is replaced by orthogonality, has been studied by several authors [3,10,12,23]. More specifically, for positive integers d, k, and l with l ≤ k, let α(d, k, l) be the maximum size of a set V of nonzero vectors from R d such that among any k+1 vectors from V there are at least l+1 pairwise orthogonal vectors. Füredi and Stanley [12] showed that α(d, k, l) ≤ (1 + o(1)) πd/(2l)((l + 1)/l) d/2−1 k. Alon and Szegedy [3] used a probabilistic argument to show the following lower bound on α(d, k, l).
Let d, k, and l be positive integers with d ≥ 2 log k and with k sufficiently large with respect to l. It follows from the proof of Theorem 13 that there is a δ = δ(l) > 0 and a subset F = F (d, k, l) of {−1, 1} d of size at least d δ log (k+2)/ log log (k+2) such that among any k + 1 vectors from F there are at least l + 1 pairwise orthogonal vectors. We define the set P F = 1 is not difficult to verify that any two points p u and p v from P F are at unit distance if and only if the vectors u and v from F are orthogonal. It follows that for every fixed positive integer l there are some δ = δ(l) > 0 and k 0 (l) such that for every k ≥ k 0 (l) and every d ≥ 2 log k, f (d, k, l) ≥ d δ log (k+2)/ log log (k+2) .
Let d, k, l be positive integers. The following simple argument, which is based on an estimate on the chromatic number of R d , gives an upper bound on f (d, k, l) that is linear in k and exponential in d.
Let P be a set of points in R d such that among any k + 1 points from P there are l + 1 points that are pairwise at unit distance. Let G be the unit-distance graph for P . Let c be a colouring of G with m := χ(G) colours and let P = C 1 ∪ · · · ∪ C m be the colour classes induced by c. For every unit-distance graph H in R d , Larman and Rogers [16] showed that χ(H) ≤ (3 + o(1)) d . We thus have m ≤ (3 + o(1)) d . Since there are at least l + 1 ≥ 1 edges among any set of k + 1 vertices of G, we have |C i | ≤ k for every i ∈ {1, . . . , m}. In particular, |P | ≤ mk ≤ (3 + o(1)) d k. We thus obtain the following estimate.