TITLE: Proving distance between any two vertices is at most 2.
QUESTION [6 upvotes]: If there are $n$ vertices and at least $\frac{1}{2}(n-1)$ degrees for each vertex, how do I prove that the distance between any two vertices is at most 2? 
I have tried drawing a few graphs with different values for $n$ but I'm not sure how to prove it for all $n$.

REPLY [9 votes]: Pick any two vertices $v_1$ and $v_2$ from the graph. If they are connected by an edge, 
their distance is $1$ and we are done. If not, there are $n-2$ vertices
for $v_1$ and $v_2$ to connect.
Let $E_1$, $E_2$ be the set of vertices connected to $v_1$ and $v_2$ respectively.
We are given
$$|E_1| \ge \frac12(n-1)\quad\text{ and }\quad |E_2| \ge \frac12(n-1)$$
This implies
$$|E_1 \cap E_2| = |E_1| + |E_2| - |E_1 \cup E_2| \ge \frac12(n-1)  + \frac12(n-1) - (n-2) > 0$$
This means $E_1 \cap E_2 \ne \emptyset$. Pick a $v$ from $E_1 \cap E_2$ and connect $v_1$ and $v_2$ by a path of length $2$ ($v_1 \to v \to v_2$). In this case, the distance between $v_1$ and $v_2$ is $2$.