Let $G$ be a $r$-regular graph with $n$-vertices with diameter $2$. I want to find a good bound for $n$ in terms of $r$.
First I observe that it can be said that $n\leq r^2+r$. There are at most $r^2$ vertex which is not adjacent to a vertex. Thus, we get $n-r\leq r^2$ and result follows.
We may also assume that for every non-adjecent two vertex $v_1,v_2$ there is a unique $v_3$ that the path $v_1v_3v_2$ has length $2$. Any reference is welcome. If it is easy to do, any hint or solution is also welcome.
Suppose $G$ is $r$-regular with diameter two. A vertex $u$ has $r$ neighbours, and each of these neighbours is adjacent to at most $r-1$ vertices at distance two from $u$. So the number of vertices of the graph is at most $$ 1+ r + r(r-1) = r^2+1. $$ This bound, a special case of the Moore bound, can only be tight if $r\in\{2,3,7, 57\}$ - famous result due to Hoffman and Singleton. For 2, 3, 7 there unique examples: respectively $C_5$, the Petersen graph and the Hoffman-Singleton graph on 50 vertices. The existence of 57-regular graph of diameter two on 3250 vertices is a very famous open problem.