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)

mcMST documentation built on April 1, 2023, 12:19 a.m.