IAE Academy

GATE 2022 CS Q.30: solution and answer

GATE 2022 · CSQ.30 · 1 mark · NAT

Consider a simple undirected graph of 10 vertices. If the graph is disconnected, then the maximum number of edges it can have is ____________.

See the question in the paper

Answer and solution

ANSWER

The maximum number of edges is 36.

Official answer: 36Source: Official answer key, GATE 2022 CS (IIT Kharagpur)

  1. A disconnected graph has at least two components. To maximise edges, first take exactly two components, with and vertices, where . Merging extra components into one of these only allows more edges, so two components is enough.

  2. A simple graph on vertices has at most edges, reached by . So the number of edges is at most .

  3. Expand: . This is a parabola opening upward with its minimum at , so on it is largest at the ends and .

  4. Check the values: , , . These agree with , and .

  5. The maximum is , reached by together with one isolated vertex (a graph with 10 vertices, disconnected).

  6. General rule: a disconnected simple graph on vertices has at most edges. Here .

KEY IDEA

A disconnected graph splits into components. The edge count is largest when one component is a complete graph on vertices and the other is a single isolated vertex, giving edges.

WATCH OUT FOR

Using or . Removing one edge from leaves the graph connected. To disconnect it you must remove all 9 edges at one vertex, which leaves .

From the GATE 2022 CS paper. Every question of this paper · Download the full paper · All 14 Graph theory questions, with notes

More Graph theory questions