A forest is an undirected graph with no graph cycle; each of its connected components of a graph is a tree, including any isolated vertex. A finite forest with vertices and connected components of a graph hasIndeed, a connected component of a graph with vertices contributes edges; adding these counts gives . Equivalently, start with isolated vertices: every added edge must join different connected components of a graph, reducing their number by one. Joining vertices already connected would create a graph cycle. [ref]
https://ocw.mit.edu/courses/18-200-principles-of-discrete-applied-mathematics-spring-2024/mit18_200_s24_lec05-06.pdf. MIT, counting notes, p. 4: building forests by merging components
Deleting in our example gives , , and five edges: the two trees contribute . Deleting as well leaves isolated, so and four edges. A forest therefore describes separate hierarchies or the intermediate stages of building a spanning tree. The acyclic graph condition accounts for missing connections without assuming that all locations are mutually reachable.
New to topics? Read the docs here!