# subgraph

From igraph v0.1.2
by Gabor Csardi

##### Subgraph of a graph

`subgraph`

creates a subgraph of a graph, containing
only the specified vertices and all the edges among them.

- Keywords
- graphs

##### Usage

`subgraph(graph, v)`

##### Arguments

- graph
- The original graph.
- v
- Numeric vector, the vertices of the original graph which will form the subgraph.

##### Details

The ids of the vertices will change in the subgraph of course since these are always consecutive.

##### Value

- A new graph object.

##### Examples

```
g <- graph.ring(10)
g2 <- subgraph(g, 1:7)
```

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

### Community examples

Looks like there are no examples yet.