EVOLUTION-MANAGER
Edit File: mst.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: Minimum spanning tree</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 mst {igraph}"><tr><td>mst {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Minimum spanning tree</h2> <h3>Description</h3> <p>A subgraph of a connected graph is a <em>minimum spanning tree</em> if it is tree, and the sum of its edge weights are the minimal among all tree subgraphs of the graph. A minimum spanning forest of a graph is the graph consisting of the minimum spanning trees of its components. </p> <h3>Usage</h3> <pre> mst(graph, weights = NULL, algorithm = NULL, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>graph</code></td> <td> <p>The graph object to analyze.</p> </td></tr> <tr valign="top"><td><code>weights</code></td> <td> <p>Numeric algorithm giving the weights of the edges in the graph. The order is determined by the edge ids. This is ignored if the <code>unweighted</code> algorithm is chosen. Edge weights are interpreted as distances.</p> </td></tr> <tr valign="top"><td><code>algorithm</code></td> <td> <p>The algorithm to use for calculation. <code>unweighted</code> can be used for unweighted graphs, and <code>prim</code> runs Prim's algorithm for weighted graphs. If this is <code>NULL</code> then igraph tries to select the algorithm automatically: if the graph has an edge attribute called <code>weight</code> or the <code>weights</code> argument is not <code>NULL</code> then Prim's algorithm is chosen, otherwise the unweighted algorithm is performed.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Additional arguments, unused.</p> </td></tr> </table> <h3>Details</h3> <p>If the graph is unconnected a minimum spanning forest is returned. </p> <h3>Value</h3> <p>A graph object with the minimum spanning forest. (To check that it is a tree check that the number of its edges is <code>vcount(graph)-1</code>.) The edge and vertex attributes of the original graph are preserved in the result. </p> <h3>Author(s)</h3> <p>Gabor Csardi <a href="mailto:csardi.gabor@gmail.com">csardi.gabor@gmail.com</a> </p> <h3>References</h3> <p>Prim, R.C. 1957. Shortest connection networks and some generalizations <em>Bell System Technical Journal</em>, 37 1389–1401. </p> <h3>See Also</h3> <p><code><a href="components.html">components</a></code> </p> <h3>Examples</h3> <pre> g <- sample_gnp(100, 3/100) g_mst <- mst(g) </pre> <hr /><div style="text-align: center;">[Package <em>igraph</em> version 1.3.5 <a href="00Index.html">Index</a>]</div> </body></html>