Skip to content

perf(graph): pre-compute degrees in Louvain community detection#89

Merged
jamestexas merged 3 commits intomainfrom
perf/louvain-community-detection
Mar 13, 2026
Merged

perf(graph): pre-compute degrees in Louvain community detection#89
jamestexas merged 3 commits intomainfrom
perf/louvain-community-detection

Conversation

@jamestexas
Copy link
Copy Markdown
Contributor

Summary

  • Pre-compute node degree array once before Louvain optimization loop (degrees are static — adjacency never changes)
  • Track community degree sums incrementally via commDegree map instead of O(n) scans per candidate
  • Reduces inner loop complexity from O(n³) to O(n × avg_degree)

Test plan

  • All 11 community detection tests pass (task test)
  • Build clean (task build)

🤖 Generated with Claude Code

jamestexas and others added 3 commits March 12, 2026 23:37
Eliminates O(n³) bottleneck by pre-computing node degrees once (static
during phase 1) and tracking community degree sums incrementally via
map updates instead of O(n) scans per candidate evaluation.
…ount

ResolveIncludes was called in leyline.go and virtuals.go but not in the
main mount path, meaning `include` references in schemas were silently
ignored. Also adds audit-schema example and indexer for the-firm's
.audit/ coordination files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Superseded by pre-computed degree maps in the Louvain perf commit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jamestexas jamestexas enabled auto-merge (squash) March 13, 2026 05:50
@jamestexas jamestexas merged commit 127b4d4 into main Mar 13, 2026
11 checks passed
@jamestexas jamestexas deleted the perf/louvain-community-detection branch March 13, 2026 05:51
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