Skip to content

perf(leiden): flat sort-combine aggregation in CoarsenedGraphView + ParallelLeidenView - #77

Open
adsharma wants to merge 2 commits into
mainfrom
perf/leiden-flat-aggregation
Open

adsharma wants to merge 2 commits into
mainfrom
perf/leiden-flat-aggregation

Conversation

@adsharma

Copy link
Copy Markdown
Contributor

Replace per-visit std::unordered_map hashing with flat sort-combine techniques (see stacked PR for eager cache follow-up).

  • CoarsenedGraphView::computeNeighbors stages pairs into a thread-local buffer, sorts, combines runs.
  • ParallelLeidenView::parallelMove stages + sort-combines into pointers/cutVals, binary search lookup.
  • ParallelLeidenView::parallelRefine uses Aux::flat_map for cutWeights.

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

…arallelLeidenView

Replace per-visit std::unordered_map hashing with InducedSubgraphView-style
flat techniques:

- CoarsenedGraphView::computeNeighbors stages (supernode, weight) pairs
  into a thread-local buffer, sorts, and combines runs. Removes hash-table
  ops and per-call bucket allocations; output is deterministic.
- ParallelLeidenView::parallelMove stages (community, weight) pairs once
  per visit, sort-combines into parallel pointers/cutVals vectors, and
  uses binary search for the current-community cut. Reusable per-thread
  buffers cut malloc/free churn; single forNeighborsOf pass halves view
  re-aggregation in the move phase.
- ParallelLeidenView::parallelRefine uses Aux::flat_map for cutWeights
  (small refinement neighborhoods favor binary search over hashing).
Scope the CoarsenedGraphView aggregation buffer to the phase: reusable
thread-local scratch within a move/refine phase, released (shrink_to_fit)
via CoarsenedGraphView::releaseThreadScratch() at each phase boundary in
ParallelLeidenView::parallelMove/parallelRefine. A giant-supernode
high-water mark from one level can no longer leak into the next.
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