The Gateway to Computer Science Excellence
+28 votes

The maximum number of edges in a n-node undirected graph without self loops is

  1. $n^2$
  2. $\frac{n(n-1)}{2}$
  3. $n-1$
  4. $\frac{(n+1)(n)}{2}$
in Graph Theory by Veteran (52.1k points)
edited by | 5.5k views

2 Answers

+36 votes
Best answer
In a graph of $n$ vertices you can draw an edge from a vertex to $\left(n-1\right)$ vertex we will do it for n vertices so total number of edges is $n\left(n-1\right)$ now each edge is counted twice so the required maximum number of edges is $\frac{n\left(n-1\right)}{2}.$

Correct Answer: $B$
by Boss (14.4k points)
edited by
But the question disallows only self loops , parallel edges may be present.
I have not considered parallel edge because it will lead to infinity which is not in option

The correct answer is ∞, but if we assume that the graph is Simple (i.e self-loop and parallel edges are disallowed) then the ans will be (b) n(n-1)/2 .

+15 votes

For maximum no of edges we must have one edge for each pair of vertices.

We can select a pair out of N nodes in NC2 ways = N(N-1)/2

by Veteran (56.9k points)
Nice ..

For directed graph , maximum no of edges would be n^2 -n ??
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,650 questions
56,242 answers
95,943 users