Extract communities via the Girvan Newman method

extract_comm_girvan(
  x,
  weights = NA,
  directed = TRUE,
  modularity = TRUE,
  edge.betweenness = FALSE,
  bridges = FALSE,
  merges = TRUE,
  membership = TRUE
)

Arguments

x

The input graph, edge directions are ignored in directed graphs.

weights

The weights of the edges. It must be a positive numeric vector, NULL or NA. If it is NULL and the input graph has a ‘weight’ edge attribute, then that attribute will be used. If NULL and no such attribute is present, then the edges will have equal weights. Set this to NA if the graph was a ‘weight’ edge attribute, but you don't want to use it for community detection. Larger edge weights increase the probability that an edge is selected by the random walker. In other words, larger edge weights correspond to stronger connections.

directed

Logical constant, whether to calculate directed edge betweenness for directed graphs. It is ignored for undirected graphs.

modularity

Logical scalar, whether to include the vector of the modularity scores in the result. If the membership argument is TRUE, then it will always be calculated.

edge.betweenness

Logical constant, whether to return the edge betweenness of the edges at the time of their removal.

bridges

Logical constant, whether to return a list the edge removals which actually splitted a component of the graph.

merges

Logical scalar, whether to include the merge matrix in the result.

membership

Logical scalar, whether to calculate the membership vector for the split corresponding to the highest modularity value.

Value

a communities object that can be handled with the functions at membership.

Details

The edge betweenness score of an edge measures the number of shortest paths through it. The idea of the edge betweenness-based community structure detection is that it is likely that edges connecting separate modules have high edge betweenness as all the shortest paths from one module to another must traverse through them. So if we gradually remove the edge with the highest edge betweenness score we will get a hierarchical map, a rooted tree, called a dendrogram of the graph. The leafs of the tree are the individual vertices and the root of the tree represents the whole graph.

The result of this function can be queried using the utility functions documented here: membership,

References

this function just wraps the edge_betweenness function and documentation.