Skip to contents

Runs a file-backed local-moving level, externally contracts its edges, and keeps higher contracted levels file-backed until a level passes a conservative resident-memory check. At that point it reuses graph_cluster(). Metal and CUDA local moves run on the GPU at every level; graph contraction and final modularity audits run on the CPU. Original graph and final labels remain on disk. With checkpoint = TRUE, completed first-level and contraction files can be reused by resume = TRUE after validating input, control, and native-library identities. An interrupted individual scan or higher level is not yet resumable; its partial files remain for inspection. Mapped label pages may contribute to RSS beyond scan buffers.

Usage

massive_louvain(
  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 uint32 final cluster labels.

max_passes

Maximum local-moving sweeps per Louvain level.

resolution

Positive modularity resolution.

seed

Nonnegative random seed.

chunk_rows

Maximum consecutive graph rows per scan block. The default is 8,192 on CPU/CUDA and 65,536 on Metal; the edge budget may shorten a block.

memory_limit

RAM budget for scan buffers and resident levels.

backend

"cpu", "cuda", or "metal". GPU local moves use the selected device; graph contraction and modularity audits use CPU.

checkpoint

Save completed first-level and contraction stages.

resume

Reuse a matching checkpoint; requires checkpoint = TRUE.

initial

Optional massive_cluster_landmarks() result whose saved labels initialize local moves. Its row order must match graph.

n.cores

CPU workers for bounded row-candidate preparation. Local-move commits remain ordered. GPU routes require one coordinator.

Value

Lightweight file-backed Louvain result with modularity.