Skip to contents

MapEquation: two-level description length of a partition of an undirected (weighted) network. InfomapPartition: deterministic local moving and aggregation minimising it. Identical to the Python arm morie.fn.mapeq; modules are zero-based.

Usage

MapEquation(A, membership, flow = "undirected")

InfomapPartition(A, flow = "undirected", max_passes = 100)

Arguments

A

Adjacency (weight) matrix; it is symmetrised.

membership

Module label of each node.

flow

"undirected" (stationary random walk) or "igraph" (PageRank flow with teleportation 0.15, as igraph::cluster_infomap).

max_passes

Maximum number of aggregation levels.

Value

A number or a list.

References

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

Rosvall, M., Axelsson, D. and Bergstrom, C. T. (2009). The map equation. European Physical Journal Special Topics 178, 13-23.

Examples

A <- matrix(0, 6, 6)
A[rbind(c(1, 2), c(1, 3), c(2, 3), c(3, 4), c(4, 5), c(4, 6), c(5, 6))] <- 1
A <- A + t(A)
MapEquation(A, c(0, 0, 0, 1, 1, 1))
#> [1] 2.32073
InfomapPartition(A)$membership
#> [1] 0 0 0 1 1 1