How to prove max number of connection between n nodes is n*(n-1)/2

Manohar picture Manohar · Dec 5, 2012 · Viewed 24.5k times · Source

Given n nodes, if every node is connected to every other node (except itself) the number of connections will be n*(n-1)/2

How does one prove this ?

This is not a homework question. I have been away from CS text books for long and have forgotten the theory on how to prove this.

Answer

Aram Gevorgyan picture Aram Gevorgyan · Dec 5, 2012

you have n - nodes, each have n -1 connections (each is connected to every node except itself), so we get n*(n-1). However, because connection (x,y) and (y,x) is the same (for all connections), we end up with n*(n-1)/2.