[Math] Prove that if $deg(u)+deg(v) \geq n-1$ for every two non adjacent vertices $u$ and $v$ of $G$ then $G$ is connected and $diam(G) \leq 2$

graph theory

Let $G$ be a graph of order $n$. Prove that if $deg(u)+deg(v) \geq n-1$ for every two non adjacent vertices $u$ and $v$ of $G$ then $G$ is connected and $diam(G) \leq 2$

This is what I got so far

Let $u$ and $v$ be 2 non adjacent vertices in $G$. Since $G$ has order $n$

$$deg(u) \leq n-2$$

and

$$deg(v) \leq n-2$$

so

$$deg(u) +deg(v) \leq 2(n-1)$$

thus

$$n-1 \leq deg(u)+deg(v) \leq 2(n-1)$$

now I don't know what to do next.

Best Answer

Hint: prove that $u$ and $v$ have a common neighbour.

Detailed hint: Assume $u$ and $v$ have no common neighbour. Let $N(x)$ be the set of neighbours of $x$. Then $|N(u)\cup N(v)|=deg(u)+deg(v)$. But what is the maximal $N(u)\cup N(v)$?