
Rust implementation of Leiden and Louvain clustering
rs_leiden_clustering.Rd
Modularity-based Leiden (or Louvain, with
refine = FALSE) on an
undirected weighted graph. Mirrors
igraph::cluster_leiden(objective_function = "modularity"). The result
depends on the seed only, not on the number of threads.
Arguments
- from
Integer vector. 1-based source node of each edge.
- to
Integer vector. 1-based target node of each edge. Same length as
from.- weights
Numeric vector. Edge weights, same length as
from.- n_nodes
Integer. Number of nodes in the graph.
- leiden_params
List. Named list with the optional fields (defaults in parentheses):
resolutionnumeric, modularity resolution (1.0)betanumeric, randomness of the refinement merges (0.01)n_iterationsinteger, full Leiden iterations (2)refinelogical,TRUEfor Leiden,FALSEfor Louvain (TRUE)seedinteger, random seed (42)