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

refactor: replace double[] PQ hack in GraphUtils.dijkstra with typed DijkstraEntry - #126

Merged
sauravbhattacharya001 merged 1 commit into
masterfrom
refactor/graphutils-dijkstra-typed-pq
Mar 28, 2026
Merged

sauravbhattacharya001 merged 1 commit into
masterfrom
refactor/graphutils-dijkstra-typed-pq

Conversation

@sauravbhattacharya001

Copy link
Copy Markdown
Owner

Replaces double[] PQ entries with a typed DijkstraEntry class, eliminating the vertexIndex/vertexToIdx indirection. Consistent with ShortestPathFinder's approach. No behavioral change.

…DijkstraEntry

The previous implementation used double[] arrays as PQ entries with a
parallel vertexIndex list and vertexToIdx map for int-to-vertex lookups.
This required fragile double-to-int casting on every PQ poll and O(V)
index bookkeeping.

Replaced with a typed DijkstraEntry class (distance + vertex String),
matching the pattern already used in ShortestPathFinder. This eliminates
the vertexIndex list, vertexToIdx map, and the casting, making the code
clearer and less error-prone.
@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.

@github-actions github-actions Bot added visualization Graph visualization and UI size/m labels Mar 27, 2026
@sauravbhattacharya001
sauravbhattacharya001 merged commit 73a38c9 into master Mar 28, 2026
4 of 8 checks passed
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