## S3 method for class 'igraph':
modularity(x, membership, weights = NULL, \dots)
NULL
then a numeric vector giving edge
weights.If edge weights are given, then these are considered as the element of the $A$ adjacency matrix, and $k_i$ is the sum of weights of adjacent edges for vertex $i$.
walktrap.community
,
edge.betweenness.community
,
fastgreedy.community
,
spinglass.community
for various community detection
methods.g <- graph.full(5) %du% graph.full(5) %du% graph.full(5)
g <- add.edges(g, c(1,6, 1,11, 6, 11))
wtc <- walktrap.community(g)
modularity(wtc)
modularity(g, membership(wtc))
Run the code above in your browser using DataLab