EVOLUTION-MANAGER
Edit File: components.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: Connected components of a graph</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 component_distribution {igraph}"><tr><td>component_distribution {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Connected components of a graph</h2> <h3>Description</h3> <p>Calculate the maximal (weakly or strongly) connected components of a graph </p> <h3>Usage</h3> <pre> component_distribution(graph, cumulative = FALSE, mul.size = FALSE, ...) components(graph, mode = c("weak", "strong")) is_connected(graph, mode = c("weak", "strong")) count_components(graph, mode = c("weak", "strong")) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>graph</code></td> <td> <p>The graph to analyze.</p> </td></tr> <tr valign="top"><td><code>cumulative</code></td> <td> <p>Logical, if TRUE the cumulative distirubution (relative frequency) is calculated.</p> </td></tr> <tr valign="top"><td><code>mul.size</code></td> <td> <p>Logical. If TRUE the relative frequencies will be multiplied by the cluster sizes.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Additional attributes to pass to <code>cluster</code>, right now only <code>mode</code> makes sense.</p> </td></tr> <tr valign="top"><td><code>mode</code></td> <td> <p>Character string, either “weak” or “strong”. For directed graphs “weak” implies weakly, “strong” strongly connected components to search. It is ignored for undirected graphs.</p> </td></tr> </table> <h3>Details</h3> <p><code>is_connected</code> decides whether the graph is weakly or strongly connected. The null graph is considered disconnected. </p> <p><code>components</code> finds the maximal (weakly or strongly) connected components of a graph. </p> <p><code>count_components</code> does almost the same as <code>components</code> but returns only the number of clusters found instead of returning the actual clusters. </p> <p><code>component_distribution</code> creates a histogram for the maximal connected component sizes. </p> <p>The weakly connected components are found by a simple breadth-first search. The strongly connected components are implemented by two consecutive depth-first searches. </p> <h3>Value</h3> <p>For <code>is_connected</code> a logical constant. </p> <p>For <code>components</code> a named list with three components: </p> <table summary="R valueblock"> <tr valign="top"><td><code>membership</code></td> <td> <p>numeric vector giving the cluster id to which each vertex belongs.</p> </td></tr> <tr valign="top"><td><code>csize</code></td> <td> <p>numeric vector giving the sizes of the clusters.</p> </td></tr> <tr valign="top"><td><code>no</code></td> <td> <p>numeric constant, the number of clusters.</p> </td></tr> </table> <p>For <code>count_components</code> an integer constant is returned. </p> <p>For <code>component_distribution</code> a numeric vector with the relative frequencies. The length of the vector is the size of the largest component plus one. Note that (for currently unknown reasons) the first element of the vector is the number of clusters of size zero, so this is always zero. </p> <h3>Author(s)</h3> <p>Gabor Csardi <a href="mailto:csardi.gabor@gmail.com">csardi.gabor@gmail.com</a> </p> <h3>See Also</h3> <p><code><a href="decompose.html">decompose</a></code>, <code><a href="subcomponent.html">subcomponent</a></code>, <code><a href="groups.html">groups</a></code> </p> <h3>Examples</h3> <pre> g <- sample_gnp(20, 1/20) clu <- components(g) groups(clu) </pre> <hr /><div style="text-align: center;">[Package <em>igraph</em> version 1.3.5 <a href="00Index.html">Index</a>]</div> </body></html>