induced_subgraph()
can be achieved in two steps with
induced_subgraph_edges()
and subgraph_from_edges()
,
but it is much slower than expected.
Usage
induced_subgraph(graph, vids, impl = 0L)
induced_subgraph_edges(graph, vids)
subgraph_from_edges(graph, eids, delete_vertices = TRUE)
Arguments
- graph
An
igraph_ptr
object.- vids
An integer vector of vertex IDs.
- impl
how to construct a new graph: {0: AUTO, 1: COPY_AND_DELETE, 2: CREATE_FROM_SCRATCH}
- eids
An integer vector of edge IDs.
- delete_vertices
whether to delete the unused vertices.