Common functions supporting community detection algorithms
community.to.membership takes a merge matrix, a typical result
of community structure detection algorithms and creates a membership
vector by performing a given number of merges in the merge matrix.
community.to.membership(graph, merges, steps, membership=TRUE, csize=TRUE)
- The graph to which the merge matrix belongs.
- The merge matrix, see
walktrap.communityfor the exact format.
- The number of steps, ie. merges to be performed.
- Logical scalar, whether to include the membership vector in the result.
- Logical scalar, whether to include the sizes of the communities in the result.
- A named list with two members:
csize A numeric vector giving the sizes of the communities.
g <- graph.full(5) %du% graph.full(5) %du% graph.full(5) g <- add.edges(g, c(0,5, 0,10, 5, 10)) wtc <- walktrap.community(g) community.to.membership(g, wtc$merges, steps=12)
Looks like there are no examples yet.