GATE / CS ARCHIVE

SIMILAR QUESTIONS / DISCRETE MATHEMATICS

Maximize edges for fixed vertices and components

2 questions solved the same way, newest first. Back to Discrete Mathematics

1 mark · NAT
Report issue

Graph Theory

Question 30, GATE 2022: What is the maximum possible edge count of a disconnected simple undirected graph on 10 vertices?
Tap to enlarge
Answer & solution

Official answer: 36

For a disconnected simple graph with 10 vertices, maximize edges by making each component complete. Moving vertices into the largest component increases the sum of binomial(component size, 2), so the maximum uses sizes 9 and 1. This gives binomial(9, 2)=36 edges.

If two nonempty components have a and b vertices, merging them would add ab edges. To keep at least two components while maximizing edges, use one largest possible component and one isolated vertex. Equivalently for a split k and 10−k the complete-component bound is C(10,2)−k(10−k), largest at k=1 or 9.

Original paper, page 22 · Answer key

2 marks · Other
Report issue

Most edges with a fixed component count

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