EVOLUTION-MANAGER
Edit File: sample_spanning_tree.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Samples from the spanning trees of a graph randomly and...</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for sample_spanning_tree {igraph}"><tr><td>sample_spanning_tree {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Samples from the spanning trees of a graph randomly and uniformly</h2> <h3>Description</h3> <p><code>sample_spanning_tree</code> picks a spanning tree of an undirected graph randomly and uniformly, using loop-erased random walks. </p> <h3>Usage</h3> <pre> sample_spanning_tree(graph, vid = 0) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>graph</code></td> <td> <p>The input graph to sample from. Edge directions are ignored if the graph is directed.</p> </td></tr> <tr valign="top"><td><code>vid</code></td> <td> <p>When the graph is disconnected, this argument specifies how to handle the situation. When the argument is zero (the default), the sampling will be performed component-wise, and the result will be a spanning forest. When the argument contains a vertex ID, only the component containing the given vertex will be processed, and the result will be a spanning tree of the component of the graph.</p> </td></tr> </table> <h3>Value</h3> <p>An edge sequence containing the edges of the spanning tree. Use <code><a href="subgraph.html">subgraph.edges</a></code> to extract the corresponding subgraph. </p> <h3>See Also</h3> <p><code><a href="subgraph.html">subgraph.edges</a></code> to extract the tree itself </p> <h3>Examples</h3> <pre> g <- make_full_graph(10) %du% make_full_graph(5) edges <- sample_spanning_tree(g) forest <- subgraph.edges(g, edges) </pre> <hr /><div style="text-align: center;">[Package <em>igraph</em> version 1.3.5 <a href="00Index.html">Index</a>]</div> </body></html>