Community structure via greedy optimization of modularity
This function tries to find dense subgraph, also called communities in graphs via directly optimizing a modularity score.
fastgreedy.community(graph, merges=TRUE, modularity=TRUE, membership=TRUE, weights=E(graph)$weight)
- The input graph
- Logical scalar, whether to return the merge matrix.
- Logical scalar, whether to return a vector containing the modularity after each merge.
- Logical scalar, whether to calculate the membership vector corresponding to the maximum modularity score, considering all possible community structures along the merges.
- If not
NULL, then a numeric vector of edge weights. The length must match the number of edges in the graph. By default the
edge attribute is used as weights. If it is not present, then all edge
This function implements the fast greedy modularity optimization algorithm for finding community structure, see A Clauset, MEJ Newman, C Moore: Finding community structure in very large networks, http://www.arxiv.org/abs/cond-mat/0408187 for the details.
- Community structure
- Fast greedy community detection
A Clauset, MEJ Newman, C Moore: Finding community structure in very large networks, http://www.arxiv.org/abs/cond-mat/0408187
g <- graph.full(5) %du% graph.full(5) %du% graph.full(5) g <- add.edges(g, c(1,6, 1,11, 6, 11)) fc <- fastgreedy.community(g) membership(fc) sizes(fc)