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.