is.connected(graph, mode=c("weak", "strong"))
clusters(graph, mode=c("weak", "strong"))
no.clusters(graph, mode=c("weak", "strong"))
cluster.distribution(graph, cumulative = FALSE, mul.size = FALSE, ...)
cluster
, right
now only mode
makes sense.is.connected
a logical constant. For clusters
a named list with three components:
no.clusters
an integer constant is returned.
For cluster.distribution
a numeric vector with the relative
frequencies. The length of the vector is the size of the largest
component plus one. Note that (for currently unknown reasons) the
first element of the vector is the number of clusters of size zero, so
this is always zero.is.connected
decides whether the graph is weakly or strongly
connected. clusters
finds the maximal (weakly or strongly) connected
components of a graph.
no.clusters
does almost the same as clusters
but returns
only the number of clusters found instead of returning the actual
clusters.
cluster.distribution
creates a histogram for the maximal
connected component sizes.
The weakly connected components are found by a simple breadth-first search. The strongly connected components are implemented by two consecutive depth-first searches.
subcomponent
g <- erdos.renyi.game(20, 1/20)
clusters(g)
Run the code above in your browser using DataLab