algorithms

algorithms.louvain

louvain(options: LouvainOptions & AlgorithmWriteOptions): Promise<NodeGroupResult>

Detect communities using the Louvain modularity-maximisation algorithm.

Dispatched to the background worker. Emits the standard algorithm lifecycle events. When writeTo is supplied community labels are written to node properties (recorded in history, undoable).

optionsLouvainOptions & AlgorithmWriteOptionsLouvainOptions merged with AlgorithmWriteOptions.

Returns: Promise<NodeGroupResult>

Example

await api.algorithms.louvain({ writeTo: "community", resolution: 1.0 });