Learn R Programming

mcMST (version 1.1.1)

getNumberOfSpanningTrees: Compute number of spanning trees of a graph

Description

Makes use of Kirchhoff's matrix tree theorem to compute the number of spanning trees of a given graph in polynomial time.

Usage

getNumberOfSpanningTrees(graph)

Value

[integer(1)]

Arguments

graph

[grapherator]
Graph.

Examples

Run this code
# generate complete graph
g = genRandomMCGP(10)

# this is equal to 10^8 (Cayley's theorem)
getNumberOfSpanningTrees(g)

Run the code above in your browser using DataLab