Question
Consider a simple undirected graph of 10 vertices. If the graph is disconnected, then the maximum number of edges it can have is ____________.
Official answer and solution
- Official answer
- 36
- From
- Official GATE 2022 answer key
Solution
Maximize the sum of edges across components by partitioning the 10 vertices into one isolated vertex and one complete graph.
A disconnected graph on vertices must have at least 2 connected components.
Let the components have sizes and such that with . The maximum number of edges in a graph with these components occurs when each component is a complete graph ( and ):
For , this sum is maximized when the component sizes are as unequal as possible, namely and :
Thus, the maximum number of edges in a disconnected simple graph on 10 vertices is 36.
36
Partitioning the vertices into two equal components of 5 vertices, which gives only edges.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2022 Computer Science and Information Technology (CS)
- Question
- 30 of 65
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.