an undirected graph g on 30 vertices has 4 connected components. what is the minimum number of edges in g?
For an undirected graph with 30 vertices and 4 connected components, the minimum number of edges is 26.
How to think about it
For any undirected graph:
- Each connected component with nin_iniβ vertices needs at least niβ1n_i-1niββ1 edges to be connected (a tree on nin_iniβ vertices).
- If the graph has kkk connected components, and the total number of vertices is nnn, then the minimum total number of edges happens when each component is a tree.
Let the components have sizes n1,n2,n3,n4n_1,n_2,n_3,n_4n1β,n2β,n3β,n4β with:
n1+n2+n3+n4=30n_1+n_2+n_3+n_4=30n1β+n2β+n3β+n4β=30
Then the minimum number of edges is:
βi=14(niβ1)=(βi=14ni)β4=30β4=26\sum_{i=1}^{4}(n_i-1)=\left(\sum_{i=1}^{4}n_i\right)-4=30-4=26i=1β4β(niββ1)=(i=1β4βniβ)β4=30β4=26
So regardless of how the 30 vertices are split into 4 nonempty connected components, the smallest possible number of edges is always:
26\boxed{26}26β