Data Structures & AlgorithmsModerateGATE CS · Product-company placement

What is the minimum number of edges m such that EVERY simple undirected graph with 9 vertices and m edges is guaranteed to be connected?

  1. A. 8
  2. B. 29
  3. C. 28
  4. D. 19

Correct answer: B. 29

A disconnected graph can have at most C(8, 2) = 28 edges (K_8 plus an isolated vertex), so 29 edges force connectivity. 8 edges are enough to connect, but they do not guarantee it.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic