Skip to contents

Applies 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. Currently CPU-only and single-worker. With checkpoints, completed graph levels can resume after identity validation; interrupted levels retain partial files and require separate recovery. The memory budget does not cover mapped pages or the R process itself. One hierarchy is run per call; max_passes controls local moves within each level.

Usage

massive_leiden(
  graph,
  output,
  max_passes = 10L,
  resolution = 1,
  seed = 1L,
  chunk_rows = 8192L,
  memory_limit = "1GB",
  backend = "cpu",
  checkpoint = FALSE,
  resume = FALSE,
  initial = NULL
)

Arguments

graph

A symmetric result of massive_umap_fuzzy_graph().

output

New path for one-based uint32 final 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

Only "cpu" is implemented; 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 match graph.

Value

Lightweight file-backed Leiden result with modularity.