A tree is a
connected undirected graph with no
cycles. It is a spanning tree of a graph
G if it spans
G (that is, it includes every vertex of
G) and is a subgraph of
G (every edge in the tree belongs to
G). A spanning tree of a connected graph
G can also be defined as a maximal set of edges of
G that contains no cycle, or as a minimal set of edges that connect all vertices.
Fundamental cycles Adding just one edge to a spanning tree will create a cycle; such a cycle is called a
fundamental cycle with respect to that tree. There is a distinct fundamental cycle for each edge not in the spanning tree; thus, there is a one-to-one correspondence between fundamental cycles and edges not in the spanning tree. For a connected graph with
V vertices, any spanning tree will have
V − 1 edges, and thus, a graph of
E edges and one of its spanning trees will have
E −
V + 1 fundamental cycles (The number of edges subtracted by number of edges included in a spanning tree; giving the number of edges not included in the spanning tree). For any given spanning tree the set of all
E −
V + 1 fundamental cycles forms a
cycle basis, i.e., a basis for the
cycle space.
Fundamental cutsets Dual to the notion of a fundamental cycle is the notion of a
fundamental cutset with respect to a given spanning tree. By deleting just one edge of the spanning tree, the vertices are partitioned into two disjoint sets. The fundamental cutset is defined as the set of edges that must be removed from the graph
G to accomplish the same partition. Thus, each spanning tree defines a set of
V − 1 fundamental cutsets, one for each edge of the spanning tree. The duality between fundamental cutsets and fundamental cycles is established by noting that cycle edges not in the spanning tree can only appear in the cutsets of the other edges in the cycle; and
vice versa: edges in a cutset can only appear in those cycles containing the edge corresponding to the cutset. This duality can also be expressed using the theory of
matroids, according to which a spanning tree is a base of the
graphic matroid, a fundamental cycle is the unique circuit within the set formed by adding one element to the base, and fundamental cutsets are defined in the same way from the
dual matroid.
Spanning forests A collection of disjoint (unconnected) trees is described as a
forest. A
spanning forest in a graph is a subgraph that is a forest with an additional requirement. There are two incompatible requirements in use, of which one is relatively rare. • Almost all graph theory books and articles define a spanning forest as a forest that spans all of the vertices, meaning only that each vertex of the graph is a vertex in the forest. A connected graph may have a disconnected spanning forest, such as the forest with no edges, in which each vertex forms a single-vertex tree. • A few graph theory authors define a spanning forest to be a maximal acyclic subgraph of the given graph, or equivalently a subgraph consisting of a spanning tree in each
connected component of the graph. To avoid confusion between these two definitions, suggest the term "full spanning forest" for a spanning forest with the same number of components as the given graph (i.e., a maximal forest), while instead call this kind of forest a "maximal spanning forest" (which is redundant, as a maximal forest necessarily contains every vertex). ==Counting spanning trees==