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.
perf: pre-build adjacency sets once in GraphAnomalyDetector
Build adjSets map in computeRawMetrics() and reuse across
computeClusteringCoeff(), computeNeighborDeviation(), and degree
computation. Eliminates:
- O(V) redundant graph.getNeighbors() JUNG collection allocations
(one per vertex in the clustering loop's inner neighbor scan)
- Per-vertex ArrayList + HashSet construction in clustering coefficient
(now uses the shared pre-built Set directly)
- Extra graph.getNeighbors() call in computeNeighborDeviation()
- graph.degree() calls replaced by pre-computed set sizes
On dense graphs the triangle-counting inner loop was the hot path,
calling graph.getNeighbors(ni) for every neighbor of every vertex.
Each JUNG call allocates a fresh Collection wrapper. The pre-built
adjSets serve as O(1) membership oracles with zero per-call allocation.
0 commit comments