getNumberOfSpanningTrees: Compute number of spanning trees of a graph

View source: R/getNumberOfSpanningTrees.R

getNumberOfSpanningTreesR Documentation

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)

Arguments

graph

[grapherator]
Graph.

Value

[integer(1)]

Examples

# generate complete graph
g = genRandomMCGP(10)

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

jakobbossek/mcMST documentation built on March 14, 2023, 4:28 p.m.