community_edge_betweenness: Edge Betweenness Community Detection

View source: R/communities.R

community_edge_betweennessR Documentation

Edge Betweenness Community Detection

Description

Girvan-Newman algorithm. Iteratively removes edges with highest betweenness centrality to reveal community structure.

Usage

community_edge_betweenness(
  x,
  weights = NULL,
  directed = TRUE,
  edge.betweenness = TRUE,
  merges = TRUE,
  bridges = TRUE,
  modularity = TRUE,
  membership = TRUE,
  ...
)

com_eb(
  x,
  weights = NULL,
  directed = TRUE,
  edge.betweenness = TRUE,
  merges = TRUE,
  bridges = TRUE,
  modularity = TRUE,
  membership = TRUE,
  ...
)

Arguments

x

Network input

weights

Edge weights. NULL uses network weights, NA for unweighted.

directed

Logical; treat graph as directed? Default TRUE.

edge.betweenness

Logical; return edge betweenness values? Default TRUE.

merges

Logical; return merge matrix? Default TRUE.

bridges

Logical; return bridge edges? Default TRUE.

modularity

Logical; return modularity scores? Default TRUE.

membership

Logical; return membership vector? Default TRUE.

...

Additional arguments passed to to_igraph

Value

A cograph_communities object

A cograph_communities object. See detect_communities.

References

Girvan, M., & Newman, M.E.J. (2002). Community structure in social and biological networks. PNAS, 99(12), 7821-7826.

Examples


g <- igraph::make_graph("Zachary")
comm <- community_edge_betweenness(g)
igraph::membership(comm)


net <- as_cograph(matrix(runif(25), 5, 5))
com_eb(net)


cograph documentation built on April 1, 2026, 1:07 a.m.