If a graph with $n$ vertices has more than $\frac{(n-1)(n-2)}{2}$ edges then it is connected.
I am a bit confused about this question, since I can always prove that for a graph to connected you need more than $|E|>n-1$ edges.
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It only takes a minute to sign up.
Sign up to join this communityIf a graph with $n$ vertices has more than $\frac{(n-1)(n-2)}{2}$ edges then it is connected.
I am a bit confused about this question, since I can always prove that for a graph to connected you need more than $|E|>n-1$ edges.
I am not sure what bothers you but as I see it you are confused about the following two facts
If a graph is connected then $e \geq n-1.$
If a graph has more than $e > \frac{(n-1)(n-2)}{2}$ then it is connected.
Notice that the implications in 1 and 2 are in opposite directions.
For a proof of 2. you can check out this link.
I think your problem might be to prove that you cannot construct an undirected graph with $\dfrac{(n-1)(n-2)}{2}$ edges that is not connected. You are thinking about it the wrong way. The $E = n - 1$ formula about how few edges can you use to connect all the vertices.
Imagine you are an adversary trying to design a horrible highway system so that one town is disconnected. No matter how inefficiently you spend your roads, you'll still have to connect all the towns if there are so many roads.
Consider what the worst possible design could be, eg, the one that uses as many roads as possible but still leaves one town disconnected. How many edges does that have? What happens when you add one more edge to that?
1.As you mentioned we have:
$G\text{ is connected} \Rightarrow |V|-1 \le |E|$
But the other direction is not true, i.e:
$G\text{ is connected} \Leftrightarrow |V|-1 \le |E|$
is wrong statement.
So you can not use it for further reasoning. Sample counter example is this graph ($K_t$ is a complete graph on $t$ vertices, and $\cup$ means disjoint union of graphs):
$G = K_{n-1} \cup K_1$
$G$ has $n-1\choose 2$ edges and $n$ nodes, and ${n-1\choose 2} > n-1$ for $n>4$.
2.On the other hand, to prove that :
${|V|-1 \choose 2} < |E| \Rightarrow G\text{ is connected}$
We can do it as follow:
Suppose not, then $G$ is disjoint union of two graphs $G=G_1\cup G_2$, with $|G_1| = k, |G_2| = n-k, 0<k<n$, if we connect all the vertices of $G_1,G_2$ together to make graph $G"$, then $|E_{G"}|\le {n \choose 2}$ (because $G"$ has at most as complete graph edges) but:
${n-1 \choose 2} + 1 + k\cdot (n-k) \le |E_{G"}| \le {n \choose 2} \Rightarrow$
$(k-1)(n-k-1) + 1 \le 0\Rightarrow$ Contradicts with $0<k<n$.
Graph G has n nodes n=(n-1)+1 A graph to be disconnected there should be at least one isolated vertex.A graph with one isolated vertex has maximum of C(n-1,2) edges.
so every connected graph should have more than C(n-1,2) edges.