Maximum number of edges in a simple graph with ‘n’ vertices and ‘k’ components…
2017
Maximum number of edges in a simple graph with ‘n’ vertices and ‘k’ components is:
Attempted by 235 students.
Show answer & explanation
Concept: For a fixed number of vertices split between two component-sizes a and b (a + b constant), the total edge count C(a,2) + C(b,2) is maximized when a and b are as unequal as possible — because C(x,2) grows quadratically, concentrating vertices into one large component always beats spreading them out. So to maximize edges across exactly k components on n vertices, make one component as large as possible and connect it completely, while every other component is reduced to a single isolated vertex (0 edges).
Let the large component have m vertices; the other k − 1 components share the remaining n − m vertices.
To add zero extra edges from the other k − 1 components, each of them must be a single isolated vertex, so n − m = k − 1, giving m = n − k + 1.
Make the large component a complete graph on m = n − k + 1 vertices; a complete graph on m vertices has m(m − 1)/2 edges.
Substituting m = n − k + 1: edges = (n − k + 1)(n − k + 1 − 1)/2 = (n − k)(n − k + 1)/2.
Cross-check: take n = 5, k = 2. The formula gives (5 − 2)(5 − 2 + 1)/2 = 3 × 4/2 = 6. Directly: a complete graph on 4 vertices (K4) has 4×3/2 = 6 edges plus one isolated vertex, total 6 — and no other 2-component split of 5 vertices beats this (a 3+2 split gives only C(3,2) + C(2,2) = 3 + 1 = 4 edges), confirming the "as unequal as possible" principle.
So the maximum-edge count for n vertices in k components is (n − k)(n − k + 1)/2 — the expression matching this value among the options is correct.
Explore the full course: Iocl Engineers Officers Grade A Paper 2