129k views
5 votes
A forest is a disconnected graph that is a disjoint union of trees. If G is an n-vertex forest with t trees, how many edges does it have?

A) n−t
B) n+t
C) n−1
D) n+1

1 Answer

6 votes

Final answer:

A forest with n vertices and t trees has n - t edges because each tree in the forest with ni vertices has ni - 1 edges, and the sum of the edges in each tree equals n - t when considering t trees.

Step-by-step explanation:

The question asks about the number of edges in a forest that consists of trees. A forest is a collection of disjoint trees, and each tree in a forest is a connected graph with no cycles. In graph theory, a tree with n vertices always has n - 1 edges. Therefore, if a forest is a disjoint union of t trees, and G is an n-vertex forest, it means that each tree contributes n - 1 edges for the vertices it contains.

Given that there are t such trees, let's assume each tree has ni vertices where i denotes the i-th tree and the sum of all ni equals to the total number of vertices n. The number of edges in each tree will be ni - 1, and the total number of edges in the forest is the sum of edges in each tree, which equals to (n1 - 1) + (n2 - 1) + ... + (nt - 1) = n - t. Hence, a forest with n vertices and t trees has n - t edges.

User Amitamb
by
7.4k points