GATE / CS ARCHIVE

GATE CSE 1991 / QUESTION 1(xv)

Most edges with a fixed component count

Discrete Mathematics · Graph Theory · Full GATE CSE 1991 paper

GATE 1991, Q1(xv) 2 marks · Other
Report issue

Graph Theory

Question 1(xv), GATE 1991: Find the maximum number of edges in an undirected graph with n vertices and k components.
Question 1(xv), GATE 1991: Find the maximum number of edges in an undirected graph with n vertices and k components.
Tap to enlarge
Answer & solution

Answer: (n−k+1)(n−k)/2 for a simple graph (no official key was published)

For component sizes n1, …, nk, simplicity permits at most Σ C(ni, 2) edges, attained by making each component complete. If two component sizes a≥b≥2 occur, transferring a vertex from the smaller to the larger changes the sum by a−b+1>0. Repeating leaves one component of size n−k+1 and k−1 isolated vertices, giving C(n−k+1, 2). This assumes 1≤k≤n and a simple loopless graph. If parallel edges are unrestricted, no finite maximum follows merely from n and k.

Original paper, page 2