nw:louvain-communities
nw:louvain-communities
Detects community structure present in the network. It does this by maximizing modularity using the Louvain method. The communities are reported as a list of turtle-sets.
Often you’ll want to tell turtles about the community that they are in. You can do this like so:
turtles-own [ community ]
...
foreach nw:louvain-communities [ [comm] ->
ask comm [ set community comm ]
]
You can give each community its own color with something like this:
let communities nw:louvain-communities
let colors sublist 0 (length communities) base-colors
(foreach communities colors [ [community col] ->
ask community [ set color col ]
])
Take me to the full Networks Extension Dictionary