Skip to contents

Formula: greedy modularity max via local moves

Usage

Comlou(G, resolution = 1, max_pass = 20)

Arguments

G

An n x n symmetric weighted adjacency matrix.

resolution

Resolution gamma; larger gives smaller communities.

max_pass

Cap on the number of aggregation passes.

Value

List with estimate (modularity), z, counts, n_communities, Q, n, method.

Details

Each node is moved to the neighbouring community that raises modularity most, repeatedly until no single move helps; the communities are then contracted into super-nodes and the sweep is repeated. Moves are evaluated in a fixed node order with ties broken toward the lowest community index, so the partition is reproducible rather than merely good.

References

Blondel, Guillaume, Lambiotte & Lefebvre (2008), J. Stat. Mech. 2008(10):P10008.

Examples

Comlou(matrix(c(0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0), 4, 4, byrow = TRUE))
#> $estimate
#> [1] 3.700743e-17
#> 
#> $z
#> [1] 0 0 0 1
#> 
#> $counts
#> [1] 3 1
#> 
#> $n_communities
#> [1] 2
#> 
#> $Q
#> [1] 3.700743e-17
#> 
#> $n
#> [1] 4
#> 
#> $method
#> [1] "Louvain greedy modularity communities"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"