Skip to content

Reduce Leiden view memory during coarsening#31

Merged
adsharma merged 2 commits into
mainfrom
reuse_existing_view
May 6, 2026
Merged

Reduce Leiden view memory during coarsening#31
adsharma merged 2 commits into
mainfrom
reuse_existing_view

Conversation

@adsharma
Copy link
Copy Markdown
Contributor

@adsharma adsharma commented May 4, 2026

Avoid keeping a separate composed original-to-coarse mapping in ParallelLeidenView. CoarsenedGraphView can now build a new view from an existing coarsened view by composing the original-node mapping directly, so flattening can use the view's nodeMapping instead of a duplicated vector.

Also replace dense per-thread cut-weight vectors with sparse unordered maps in move/refine phases. This avoids allocating storage sized to the full community upper bound for every worker when each node only touches a small subset of neighbor communities.

Together these changes reduce peak memory use during iterative Leiden coarsening and refinement without changing the partitioning result.

adsharma added 2 commits May 4, 2026 12:35
Avoid keeping a separate composed original-to-coarse mapping in ParallelLeidenView. CoarsenedGraphView can now build a new view from an existing coarsened view by composing the original-node mapping directly, so flattening can use the view's nodeMapping instead of a duplicated vector.

Also replace dense per-thread cut-weight vectors with sparse unordered maps in move/refine phases. This avoids allocating storage sized to the full community upper bound for every worker when each node only touches a small subset of neighbor communities.

Together these changes reduce peak memory use during iterative Leiden coarsening and refinement without changing the partitioning result.
@adsharma adsharma merged commit fe69eab into main May 6, 2026
5 checks passed
@adsharma adsharma deleted the reuse_existing_view branch May 6, 2026 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant