# Every simple undirected graph with more than $(n-1)(n-2)/2$ edges is connected

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.

-
hint: What if you have one isolated vertex (not connected to any other vertices) what is the maximum number of edges in the graph? – Joe Nov 22 '12 at 0:42

I am not sure what bothers you but as I see it you are confused about the following two facts

1. If a graph is connected then $e \geq n-1.$

2. 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 (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 vertexes.

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?

-