How many undirected graphs (not necessarily connected) can be constructed out of a given set V= {V 1, V 2,…V n} of n vertices ?
(A) n(n-l)/2
(B) 2^n
(C) n!
(D) 2^(n(n-1)/2)
Answer: (D)
Explanation: In an undirected graph, there can be maximum n(n-1)/2 edges. We can choose to have (or not have) any of the n(n-1)/2 edges. So, total number of undirected graphs with n vertices is 2^(n(n-1)/2).
Quiz of this Question
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 neveropen!