powered by
Makes use of Kirchhoff's matrix tree theorem to compute the number of spanning trees of a given graph in polynomial time.
getNumberOfSpanningTrees(graph)
[integer(1)]
integer(1)
[grapherator] Graph.
grapherator
# 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