Skip to content

perf(leiden): adaptive eager neighbor cache in CoarsenedGraphView - #78

Merged
adsharma merged 1 commit into
perf/leiden-flat-aggregationfrom
perf/leiden-eager-neighbor-cache
Oct 12, 2026
Merged

adsharma merged 1 commit into
perf/leiden-flat-aggregationfrom
perf/leiden-eager-neighbor-cache

Conversation

@adsharma

Copy link
Copy Markdown
Contributor

Stacks on #77 (flat sort-combine + phase shrink). Adds an adaptive eager neighbor cache: hot supernodes materialized once per level via ensureEagerCache(), cold ones stay lazy with promotion on first hot visit. View immutability means no invalidation logic. Threshold via NETWORKIT_LEIDEN_EAGER_THRESHOLD (default 2048, 0 = all, none = off).

Tests: networkit_tests eiden:oarsen:nducedSubgraph 46/46 passed.

Eager-vs-lazy tradeoff in the InducedSubgraphView spirit: the view is
immutable, so cached aggregations never invalidate within a level.

- ensureEagerCache() materializes supernodes whose estimated work (member
  degree sum) exceeds eagerNeighborThreshold, in parallel, once per level;
  wired into ParallelLeidenView after each new view is created.
- computeNeighbors() lazily promotes any other hot supernode on first visit.
- Per-entry mutexes keep it thread-safe; threshold tunable via
  NETWORKIT_LEIDEN_EAGER_THRESHOLD (0 = cache all, none = lazy only).
@adsharma
adsharma added this pull request to stack #79 September 14, 2026 21:56
@adsharma
adsharma merged commit 21d7dc1 into main Oct 12, 2026
@adsharma
adsharma deleted the perf/leiden-eager-neighbor-cache branch October 12, 2026 00:58
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