edited by
18,393 views
57 votes
57 votes

If $G$ is the forest with $n$ vertices and $k$ connected components, how many edges does $G$ have?

  1. $\left\lfloor\frac {n}{k}\right\rfloor$
  2. $\left\lceil \frac{n}{k} \right\rceil$
  3. $n-k$
  4. $n-k+1$
edited by

11 Answers

2 votes
2 votes
Since a forest with n vertices can not have more than n-1 edges with no cycle. By keeping this definition in mind, draw some graphs such as

n = 4 components(k)=2 then e=2

n = 5 , k = 3 then e= 2

n = 4 k = 3 then e = 1  

and so all are satisfying than e = n - k
1 votes
1 votes

There are k components and n vertices.

Let us assume that number of vertices in different components to be $n1$, $n2$, $n3$, $n4$,... $nk$.

Now, number of edges in each components will be $n1-1$, $n2-1$, $n3-1$, $n4-1$,... $nk-1$. (Since, each component in a forest is a tree, and if no. of vertices in a tree is $i$, then no. of edges in that tree is $i-1$)

Total number of edges = $(n1-1)+(n2-1)+(n3-1)+(n4-1)+... (nk-1)$

$=(n1+n2+n3+n4+...nk)-(1+1+1+1+...' k'times )$

$=n-k$   (Since, $n1+n2+n3+n4+...nk=n$)

So, option D is correct.

edited by
0 votes
0 votes

Simplest answer is:

When no. of vertices = no. of components (n=k).

  It means each component will have just one vertex ,so for k components we have k vertices where n=k.

So in this forest we will have zero edges, or n-k=0 (because n=k). 

eg: n=k=4

   .   .   .   .    (each dot represent a vertex, so there is no edge here)

 

So, Answer is (C)

Answer:

Related questions

101 votes
101 votes
10 answers
1
39 votes
39 votes
9 answers
3
go_editor asked Sep 28, 2014
27,073 views
The maximum number of edges in a bipartite graph on $12$ vertices is____
33 votes
33 votes
9 answers
4
makhdoom ghaya asked Feb 13, 2015
24,598 views
Let G be a connected planar graph with 10 vertices. If the number of edges on each face is three, then the number of edges in G is_______________.