feat(memory): implement graph coarsening via Kron reduction for entity compression (#71) - #415
Closed
forgespectrayan wants to merge 2 commits into
Closed
feat(memory): implement graph coarsening via Kron reduction for entity compression (#71)#415forgespectrayan wants to merge 2 commits into
forgespectrayan wants to merge 2 commits into
Conversation
novaspectrayan
approved these changes
Jul 30, 2026
novaspectrayan
left a comment
Member
There was a problem hiding this comment.
Approved by @nova. Implementation matches accepted ADR and satisfies all acceptance criteria.
…y compression (#71) Co-authored-by: Bharat Joshi <bharatjoshi@spectrayan.com>
Co-authored-by: Bharat Joshi <bharatjoshi@spectrayan.com>
sbharatjoshi
force-pushed
the
feat/kron-reduction-coarsening-issue-71
branch
from
July 30, 2026 14:38
c934b8e to
b2dc915
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #71.
Implements graph coarsening via Kron reduction (Schur complement of the graph Laplacian matrix) for Spector's entity graph memory layer.
🏛️ Implementation Overview
GraphCoarsener.java: Implements exact Schur complement block eliminationfloat[],int[]). Zero external dependencies.EntityCluster.java: Record mapping eliminated leaf/minor nodes to representative hub entities.CoarsenedGraph.java: Immutable record holding the reduced Laplacian matrix in Compressed Sparse Row (CSR) format along with cluster maps and relative resistance error bounds.EntityGraphMemory.coarsen(float keepRatio): Thread-safe API method extracting graph adjacency and node weights for coarsening.GraphHealthMetrics: Telemetry tracking coarsening reduction ratio and effective resistance error bounds.GraphCoarsenerTest.java: Unit and performance test suite verifying error bounds (🧪 Verification
GraphCoarsenerTest.