louvain
Finds communities in a graph with the Louvain method (Blondel et al., 2008): each node joins the neighboring community that raises modularity most, then each community becomes one node, until nothing moves. Links are undirected; duplicates add their weights, and links with a missing end or a weight that isn't a positive number are ignored. The result is deterministic: nodes are visited in the order given, and ties go to the lowest-numbered community.
Returns each node's community, numbered from 0 by size (largest first, ties in the order the communities' first nodes appear in nodes). A node with no links is a community of its own.
Parameters
import {louvain} from "@d3plus/math";