Formula: greedy modularity max via local moves
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.
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"
