community_infomap: Infomap Community Detection

View source: R/communities.R

community_infomapR Documentation

Infomap Community Detection

Description

Information-theoretic community detection based on random walk dynamics. Minimizes the map equation (description length of random walks).

Usage

community_infomap(
  x,
  weights = NULL,
  v.weights = NULL,
  nb.trials = 10,
  modularity = TRUE,
  seed = NULL,
  ...
)

com_im(
  x,
  weights = NULL,
  v.weights = NULL,
  nb.trials = 10,
  modularity = TRUE,
  seed = NULL,
  ...
)

Arguments

x

Network input

weights

Edge weights for transitions. NULL uses network weights.

v.weights

Vertex weights (teleportation weights).

nb.trials

Number of optimization trials. Default 10.

modularity

Logical; calculate modularity? Default TRUE.

seed

Random seed for reproducibility. Default NULL.

...

Additional arguments passed to to_igraph

Value

A cograph_communities object

A cograph_communities object. See detect_communities.

References

Rosvall, M., & Bergstrom, C.T. (2008). Maps of random walks on complex networks reveal community structure. PNAS, 105(4), 1118-1123.

Examples

if (requireNamespace("igraph", quietly = TRUE)) {
  g <- igraph::make_graph("Zachary")
  comm <- community_infomap(g, nb.trials = 20)
}

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