Decompose a graph into components
Creates a separate graph for each component of a graph.
decompose.graph(graph, mode = c("weak", "strong"), max.comps = NA, min.vertices = 0)
- The original graph.
- Character constant giving the type of the components,
weakfor weakly connected components or
strongfor strongly connected components.
- The maximum number of components to return. The first
max.compscomponents will be returned (which hold at least
min.verticesvertices, see the next parameter), the others will be ignored. Supply
- 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.
- A list of graph objects.
- Graph decomposition
- Graph component
# 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)
Looks like there are no examples yet.