# decompose.graph

From igraph v0.5.3
by Gabor Csardi

##### Decompose a graph into components

Creates a separate graph for each component of a graph.

- Keywords
- graphs

##### Usage

```
decompose.graph(graph, mode = c("weak", "strong"),
max.comps = NA, min.vertices = 0)
```

##### Arguments

- graph
- The original graph.
- mode
- Character constant giving the type of the components,
wither
`weak`

for weakly connected components or`strong`

for strongly connected components. - max.comps
- The maximum number of components to return. The first
`max.comps`

components will be returned (which hold at least`min.vertices`

vertices, see the next parameter), the others will be ignored. Supply`NA`

here - min.vertices
- The minimum number of vertices a component should contain in order to place it in the result list. Eg. supply 2 here to ignore isolate vertices.

##### Value

- A list of graph objects.

##### concept

- Graph decomposition
- Graph component

##### See Also

`is.connected`

to decide whether a graph is
connected, `clusters`

to calculate the connected
components of a graph.

##### Examples

```
# the diameter of each component in a random graph
g <- erdos.renyi.game(1000, 1/1000)
comps <- decompose.graph(g, min.vertices=2)
sapply(comps, diameter)
```

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

### Community examples

Looks like there are no examples yet.