Skip to content
This repository was archived by the owner on Jun 18, 2026. It is now read-only.

fix: remove 20 unused imports + deduplicate BFS in 2 analyzers - #76

Merged
sauravbhattacharya001 merged 1 commit into
masterfrom
gardener/cleanup-and-refactor-bfs
Mar 14, 2026
Merged

sauravbhattacharya001 merged 1 commit into
masterfrom
gardener/cleanup-and-refactor-bfs

Conversation

@sauravbhattacharya001

Copy link
Copy Markdown
Owner

Code cleanup: 20 unused imports removed (18 files)

File Removed Import
CycleAnalyzer UndirectedSparseGraph
EulerianPathAnalyzer UndirectedGraph
FeedbackVertexSetAnalyzer UndirectedSparseGraph
GraphAnnotationManager Collectors
GraphCompressor Collectors
GraphDistanceDistribution Collectors
GraphMinorAnalyzer Collectors
GraphResilienceAnalyzer UndirectedSparseGraph
GraphSymmetryAnalyzer Collectors
IndependentSetAnalyzer Collectors
SignedGraphAnalyzer UndirectedSparseGraph, Collectors
SmallWorldAnalyzer UndirectedSparseGraph
SteinerTreeAnalyzer UndirectedSparseGraph
SubgraphExtractor Collectors
TemporalGraph Collectors
TournamentAnalyzer DirectedSparseGraph, Collectors
TreeAnalyzer UndirectedSparseGraph
TreewidthAnalyzer UndirectedSparseGraph

Refactor: deduplicate BFS implementations

GraphNetworkProfiler — removed 19-line private bfs() method, replaced 3 call sites with GraphUtils.bfsDistances(graph, ...). The private method was functionally identical to the shared utility.

ForceDirectedLayout — removed 10-line private bfsDistances() method, replaced 1 call site with GraphUtils.bfsDistances(graph, ...). Same deduplication.

Both methods produced the same Map<String, Integer> (vertex → BFS distance) as GraphUtils.bfsDistances(). Consolidated to reduce code duplication and maintenance burden.

Two improvements:

1. Code cleanup — removed 20 unused imports across 18 files:
   - 8 files had unused UndirectedSparseGraph/DirectedSparseGraph/
     UndirectedGraph imports from edu.uci.ics.jung.graph
   - 10 files had unused java.util.stream.Collectors imports

2. Refactor — eliminated duplicate BFS implementations:
   - GraphNetworkProfiler: removed 19-line private bfs() method,
     replaced 3 call sites with GraphUtils.bfsDistances()
   - ForceDirectedLayout: removed 10-line private bfsDistances()
     method, replaced 1 call site with GraphUtils.bfsDistances()
   - GraphUtils.bfsDistances() already provides the same
     functionality; these were unnecessary copies
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@sauravbhattacharya001
sauravbhattacharya001 merged commit 260efaa into master Mar 14, 2026
3 of 7 checks passed
@sauravbhattacharya001
sauravbhattacharya001 deleted the gardener/cleanup-and-refactor-bfs branch March 14, 2026 17:12
@github-actions github-actions Bot added visualization Graph visualization and UI size/m labels Mar 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size/m visualization Graph visualization and UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant