 Equivalently, a forest is an undirected graph, all of whose connected components are trees; in other words, the graph consists of a disjoint union of trees.As special cases, the order-zero graph (a forest consisting of zero trees), a single tree, and edgeless graph, are examples of forests.Since for every tree , we can easily count the number of trees that are within a forest by subtracting the difference between total vertices and total edges.