On my book it says that the maximum number of edges E, in a simply connected undirected unweighted graph $G(V,E)$ is $\dfrac{|V|(|V|-1)}{2}$.

How can I show that it is true? Thanks!

  • $\begingroup$ It seems there are some unfortunate typos in the question. (1.) The answer should be $\frac{1}{2}|V|(|V|-1)$ and not what you quote. (2.) I haven't heard of the term "simply connected" in the context of a graph, at least not at such an elementary level. It should just be "simple" (or, "simple, connected" but the answer doesn't change). Which book are you following? Are you sure you didn't make any mistakes in writing the question? $\endgroup$ – Srivatsan Sep 3 '11 at 13:34
  • $\begingroup$ Related(?): math.stackexchange.com/questions/17747/…. $\endgroup$ – Srivatsan Sep 3 '11 at 13:35
  • $\begingroup$ This question answered in the link below: math.stackexchange.com/questions/1244095/… $\endgroup$ – Herman Jaramillo Sep 24 '15 at 20:46

The expression $\dfrac{|V|(|V| - 1)}{2}$ arises naturally, as this is the number of pairs from $|V|$ vertices, i.e. this is ${|V| \choose 2}$. If we had any more, than the graph would not be simple.

Alternatively, you might now know about complete graphs, which have the maximal number of edges for a set of vertices. They have exactly this number of edges. Having any more would force it to be nonsimple, again.


Another way to view this problem is to use the "Handshaking Lemma". Viewing the vertices as people and the edges as handshakes, we could ask how many handshakes are possible among $n$ people if every pair of people shakes hands exactly once. Every person can shake hands with the other $n-1$ people in the room. There are not, however, $n(n-1)$ handshakes, since we are counting every handshake exactly twice in this way (this counts Alice shaking Bob's hand as a different handshake than Bob shaking Alice's hand). Thus, $\frac{1}{2}n(n-1)$ gives us the correct count.


Perhaps you could use induction. Every new vertex you add must have enough edges added to connect to each of the other vertices. It would be assumed each of the others are already connected.


Assume there are V number of people.

Let each give handshake all others one-by-one, without any duplication

Person 1:
1. Person 1 handshakes with all other (V-1) people, so in total (V-1) handshakes are done
2. Lets remove Person 1, from the group again, to eliminate duplicate handshakes when we select other people

Person 2
1. Person 2 handshakes with all other (V-2) people, so in total (V-2) handshakes are done, V-2 is since we removed 1 person
2. Lets remove Person 2, from the group, to eliminate duplicate handshakes when we select other people

so on..

We get 1 handshake from last two people


So, we get (V-1), (V-2), etc. handshakes without any duplication

So, Sum of all handshakes = (V-1) + (V-2) ..
We know, N + (N-1) .. is N*(N+1)/2
Replacing N with V-1, we get
total handshakes = (V-1) * (V-1+1) /2 = (V-1)*V/2

Non-duplicate handshakes analogy is similar to Maximum number of edges, in a simply connected undirected unweighted graph from V vertexes

So, total edges in simple graph = (V-1)*V/2

Best of luck


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.