EXPERIMENTAL multilevel Leiden on a file-backed fuzzy graph
Source:R/massive_leiden.R
massive_leiden.RdApplies disk-backed modularity local moves and the existing Leiden
refinement rule, then externally contracts each refined graph. Labels,
graph edges, and intermediate mappings remain file-backed. Each call
uses one CPU, CUDA, or Metal worker. Verified checkpoints resume
completed graph levels; interrupted levels retain partial files for
separate recovery. The memory budget excludes mapped pages and R.
One hierarchy runs per call;
max_passes controls local moves within each level. Metal final labels
receive a CPU connectivity and modularity audit; CUDA does too.
Usage
massive_leiden(
graph,
output,
max_passes = 10L,
resolution = 1,
seed = 1L,
chunk_rows = NULL,
memory_limit = "1GB",
backend = "cpu",
checkpoint = FALSE,
resume = FALSE,
initial = NULL,
n.cores = 1L
)Arguments
- graph
A symmetric result of
massive_umap_fuzzy_graph().- output
New path for one-based
uint32final labels.- max_passes
Maximum local-moving sweeps per level.
- resolution
Positive modularity resolution.
- seed
Nonnegative random seed.
- chunk_rows
Maximum CSR rows scanned per block.
- memory_limit
RAM budget for graph scan buffers.
- backend
"cpu","cuda", or"metal"; no fallback is used.- checkpoint
Save completed graph levels for later resumption.
- resume
Resume matching completed levels; requires
checkpoint.- initial
Optional
massive_cluster_landmarks()result whose saved labels initialize local moves. Its row order must matchgraph.- n.cores
CPU workers for bounded row-candidate preparation. Local-move and refinement commits remain ordered.