Skip to contents

Louvain can leave a community internally disconnected – a node moved away can sever the group it left behind, and nothing in the algorithm ever checks. Leiden inserts a refinement phase that guarantees every returned community is connected, which is why its partitions survive being looked at.

Usage

Leid(y, A, resolution = 1, quality = "modularity", max_iter = 20)

Arguments

y

Ignored; accepted for interface compatibility.

A

Weighted adjacency matrix, n by n.

resolution

Resolution parameter of the quality function.

quality

Quality function, passed through.

max_iter

Passes.

Value

Whatever Leidenclus returns, unchanged.

Details

An alias. The optimisation is Leidenclus; leid is the same method as scleid and it is the same algorithm on the same quality function, so only the calling convention differs here.

Formula: local move, refinement, then aggregation, repeated – Traag, Waltman and van Eck (2019).

References

Traag, V. A., Waltman, L. and van Eck, N. J. (2019). Scientific Reports 9:5233. doi:10.1038/s41598-019-41695-z .

See also

Examples

M <- matrix(0, 6, 6)
M[cbind(c(1, 1, 2, 3, 4, 4, 5), c(2, 3, 3, 4, 5, 6, 6))] <- 1
Leid(NULL, M + t(M))$labels
#> [1] 0 0 0 1 1 1