GraphTheory
NumberOfSpanningTrees
number of spanning trees of graph
Calling Sequence
Parameters
Description
Examples
NumberOfSpanningTrees(G)
G
-
graph
NumberOfSpanningTrees(G) returns the number of labeled spanning trees of the graph G.
The strategy is to evaluate the determinant of a certain matrix related to the graph. (See Introduction to Graph Theory, by Douglas B. West)
withGraphTheory:
K3≔CompleteGraph3
K3≔Graph 1: an undirected graph with 3 vertices and 3 edge(s)
NumberOfSpanningTreesK3
3
K4≔CompleteGraph4
K4≔Graph 2: an undirected graph with 4 vertices and 6 edge(s)
NumberOfSpanningTreesK4
16
See Also
IsTree
SpanningTree
Download Help Document