# clusters

From igraph v0.5.1
by Gabor Csardi

##### Connected components of a graph

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

- Keywords
- graphs

##### Usage

```
is.connected(graph, mode=c("weak", "strong"))
clusters(graph, mode=c("weak", "strong"))
no.clusters(graph, mode=c("weak", "strong"))
cluster.distribution(graph, cumulative = FALSE, mul.size = FALSE, ...)
```

##### Arguments

- graph
- The graph to analyze.
- mode
- Character string, either
weak orstrong . For directed graphsweak implies weakly,strong strongly connected components to search. It is ignored for undirected graphs. - 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.
- ...
- Additional attributes to pass to
`cluster`

, right now only`mode`

makes sense.

##### Details

`is.connected`

decides whether the graph is weakly or strongly
connected.

`clusters`

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

`no.clusters`

does almost the same as `clusters`

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

`cluster.distribution`

creates a histogram for the maximal
connected component sizes.
Breadth-first search is conducted from each not-yet visited
vertex.

##### Value

- For
`is.connected`

a logical constant. For`clusters`

a named list with three components:- membership

csize numeric vector giving the sizes of the clusters. no numeric constant, the number of clusters.

##### concept

- Connectedness
- Graph component

##### code

`cluster.distribution`

##### See Also

##### Examples

```
g <- erdos.renyi.game(20, 1/20)
clusters(g)
```

*Documentation reproduced from package igraph, version 0.5.1, License: GPL (>= 2)*

### Community examples

Looks like there are no examples yet.