decompose | R Documentation |
Creates a separate graph for each connected component of a graph.
decompose(graph, mode = c("weak", "strong"), max.comps = NA, min.vertices = 0)
graph |
The original graph. |
mode |
Character constant giving the type of the components, wither
|
max.comps |
The maximum number of components to return. The first
|
min.vertices |
The minimum number of vertices a component should contain in order to place it in the result list. E.g. supply 2 here to ignore isolate vertices. |
A list of graph objects.
Gabor Csardi csardi.gabor@gmail.com
is_connected()
to decide whether a graph is connected,
components()
to calculate the connected components of a graph.
Connected components
articulation_points()
,
biconnected_components()
,
component_distribution()
,
is_biconnected()
# the diameter of each component in a random graph
g <- sample_gnp(1000, 1 / 1000)
components <- decompose(g, min.vertices = 2)
sapply(components, diameter)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.