You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 18, 2026. It is now read-only.
refactor: unify DiffResult to include edit distance and degree changes
GraphDiffAnalyzer had three independently-computed views of the same
diff: computeDiff() for node/edge sets, computeEditDistance() for
edit distance (which internally called computeDiff() again), and
findDegreeChanges() for degree deltas (which independently computed
common nodes and iterated degrees). A user needing all three had to
pay for three separate passes over the same graph data.
DiffResult now computes edit distance and degree changes in the
single computeDiff() pass. The edit distance is the sum of
added/removed nodes and edges. Degree changes are tracked for common
nodes only (nodes in both graphs whose degree differs).
Both computeEditDistance() and findDegreeChanges() are preserved as
convenience methods that delegate to computeDiff(), maintaining full
backward compatibility. Javadoc updated to recommend using
computeDiff().getEditDistance() / getDegreeChanges() directly when
multiple metrics are needed.
DiffResult.getSummary() now includes edit distance and degree change
count. All collections remain unmodifiable (DiffResult is immutable).
Also adds 46 comprehensive tests covering:
- Constructor validation (null guards)
- Empty, identical, and disjoint graphs
- Partial overlap (added/removed/rewired edges)
- Jaccard similarity edge cases
- Edit distance computation
- Degree change detection
- EdgeDiff normalization and equality
- DiffResult summary content
- Larger scenarios (star growth, path-to-triangle)
- DiffResult immutability (unmodifiable collections)
0 commit comments