The number of possible undirected graphs which may have self loops but no multiple edges and have n vertices is ________

Category: QuestionsThe number of possible undirected graphs which may have self loops but no multiple edges and have n vertices is ________
Editor">Editor Staff asked 1 month ago

The number of possible undirected graphs which may have self loops but no multiple edges and have n vertices  is ________
 
(a) 2^((n*(n-1))/2)
 
(b) 2^((n*(n+1))/2)
 
(c) 2^((n-1)*(n-1))/2)
 
(d) 2^((n*n)/2)
 
This interesting question is from Undirected Graph in portion Graph of Data Structures & Algorithms I
 
The question was posed to me in an internship interview.

1 Answers
Editor">Editor Staff answered 1 month ago

Correct option is (d) 2^((n*n)/2)
 
The explanation is: There can be at most, n*n edges in an undirected graph.