Skip to main content

Module community

Module community 

Source
Expand description

Louvain community detection with deterministic seeding.

Implements the Louvain algorithm from scratch, matching the graphology implementation’s traversal order and PRNG for bit-exact deterministic output. Output is pure in-memory — no disk persistence.

Functions§

aggregate_bridges
Aggregate inter-cluster edges into undirected CommunityBridge entries.
clusters_in_mem
Cluster ids from louvain that have at least one member living in mem.
detect_communities
Detect communities using the Louvain algorithm. Uses a seeded PRNG for deterministic results.
generate_auto_summary
Generate a default cluster summary by joining member entity titles. Called at render time (never stored) — see render::render_overview_markdown and render::render_community_context_section.
mulberry32
Mulberry32 PRNG matching the JS implementation. Uses i32 signed arithmetic for | 0 coercion (overflow wrapping), but >>> (unsigned right shift) must use u32 casts — JS >>> n first converts to unsigned 32-bit, then shifts with zero-fill.