View source: R/getRandomSpanningTree.R
getRandomSpanningTree | R Documentation |
Given a grapherator
object this function
returns a random spanning tree. The tree generation process is a simple heuristic:
A random weight from a U(0, 1)
-distribution is assigned to each edge of the
graph. Next, a spanning tree is computed by spantree
.
getRandomSpanningTree(graph)
graph |
[ |
[matrix
] Edge list of spanning tree edges.
Most likely this heuristic does not produce each spanning tree with equal probability.
g = genRandomMCGP(10L)
stree = getRandomSpanningTree(g)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.