# components

From igraph v0.4.4
by Gabor Csardi

##### In- or out- component of a vertex

Finds all vertices reachable from a given vertex, or the opposite: all vertices from which a given vertex is reachable via a directed path.

- Keywords
- graphs

##### Usage

`subcomponent(graph, v, mode = "all")`

##### Arguments

- graph
- The graph to analyze.
- v
- The vertex to start the search from.
- mode
- Character string, either
in ,out orall . Ifin all vertices from which`v`

is reachable are listed. Ifout all vertices reachable from`v`

##### Details

A breadh-first search is conducted starting from vertex
`v`

.

##### Value

- Numeric vector, the ids of the vertices in the same component as
`v`

.

##### See Also

##### Examples

```
g <- erdos.renyi.game(100, 1/200)
subcomponent(g, 1, "in")
subcomponent(g, 1, "out")
subcomponent(g, 1, "all")
```

*Documentation reproduced from package igraph, version 0.4.4, License: GPL version 2 or later (June, 1991)*

### Community examples

Looks like there are no examples yet.