Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/structural.properties.R

Calculate the maximal (weakly or strongly) connected components of a graph

1 2 3 | ```
component_distribution(graph, cumulative = FALSE, mul.size = FALSE, ...)
components(graph, mode = c("weak", "strong"))
``` |

`graph` |
The graph to analyze. |

`cumulative` |
Logical, if TRUE the cumulative distirubution (relative frequency) is calculated. |

`mul.size` |
Logical. If TRUE the relative frequencies will be multiplied by the cluster sizes. |

`mode` |
Character string, either “weak” or “strong”. For directed graphs “weak” implies weakly, “strong” strongly connected components to search. It is ignored for undirected graphs. |

`...` |
Additional attributes to pass to |

`is_connected`

decides whether the graph is weakly or strongly
connected.

`components`

finds the maximal (weakly or strongly) connected components
of a graph.

`count_components`

does almost the same as `components`

but returns only
the number of clusters found instead of returning the actual clusters.

`component_distribution`

creates a histogram for the maximal connected
component sizes.

The weakly connected components are found by a simple breadth-first search. The strongly connected components are implemented by two consecutive depth-first searches.

For `is_connected`

a logical constant.

For `components`

a named list with three components:

`membership` |
numeric vector giving the cluster id to which each vertex belongs. |

`csize` |
numeric vector giving the sizes of the clusters. |

`no` |
numeric constant, the number of clusters. |

For `count_components`

an integer constant is returned.

For `component_distribution`

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.

Gabor Csardi csardi.gabor@gmail.com

1 2 3 | ```
g <- sample_gnp(20, 1/20)
clu <- components(g)
groups(clu)
``` |

igraph documentation built on May 20, 2017, 12:49 a.m.

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.