walktrap.community(graph, weights = E(graph)$weight, steps = 4, merges =
TRUE, modularity = TRUE, labels = TRUE, membership = TRUE)membership argument
is true, then it will be always calculated.TRUE and the graph has a
vertex attribute called name then it will be included in the
result, in the list member called labels.n communities (the number of
vertices in the graph) numbered from zero to n-1. The first
merge created community n, the second community n+1, etc.name vertex attribute will be copied here, if exists.modularity and
fastgreedy.community,
spinglass.community,
leading.eigenvector.community,
edge.betweenness.community for other community detection
methods.g <- graph.full(5) %du% graph.full(5) %du% graph.full(5)
g <- add.edges(g, c(0,5, 0,10, 5, 10))
walktrap.community(g)Run the code above in your browser using DataLab