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.
subcomponent(graph, v, mode = c("all", "out", "in"))
- The graph to analyze.
- The vertex to start the search from.
- Character string, either
in, outor all. If inall vertices from which
vis reachable are listed. If
outall vertices reachable from
A breadh-first search is conducted starting from vertex
- Numeric vector, the ids of the vertices in the same component as
g <- sample_gnp(100, 1/200) subcomponent(g, 1, "in") subcomponent(g, 1, "out") subcomponent(g, 1, "all")
Looks like there are no examples yet.