$G$ is a graph with no cycles, 500 vertices, and 19 connected components. How many edges it has? any help/hint?
Asked
Active
Viewed 281 times
0
-
1See for example this answer – mrf Mar 21 '19 at 15:32
1 Answers
2
Each component is connected and does not contain circuits. Thus, each component is a tree. A tree with $n$ vertices has $n-1$ edges. Thus, the total number of edges is$$\sum_{i=1}^{19}(n_i-1)=500-19=481$$where $n_i$ is the number of vertices in the $i^{th}$ component.
Shubham Johri
- 17,739
-
The step that I can not understand logically that led me to ask the question is the one that passes from the formula you wrote to 500-19...can you confirm that we need to assume that there are exactly 19 components so even if we don't know the number of vertices of each component they are generally 500 and since we subtract 1 at every iteration at the and we subtract 19 from the total number of vertices? – Jack Mar 21 '19 at 15:56
-
@Jack Yes, only the number of components matters. The $i^{th}$ component has $n_i$ vertices and $n_i-1$ edges, so you need to sum $n_i-1$ over all components. $500-19$ arises from the fact $\sum(n_i-1)=\sum n_i-\sum1$. – Shubham Johri Mar 21 '19 at 16:02
-