Skip to content

Optimize Dijkstra and Prim's Algorithms Using Internal Node IDs #687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 23, 2025

Conversation

prex03
Copy link
Contributor

@prex03 prex03 commented Jul 17, 2025

This PR introduces performance optimizations to the Dijkstra and Prim's algorithms by leveraging internal integer-based node IDs instead of string-based node names for graph traversal and indexing.

Changes Made

  • Introduced internal name_to_id and id_to_name maps to translate between node names and integer IDs.
  • Refactored Dijkstra and Prim implementations to use integer IDs for priority queues, adjacency lookups, and visited tracking.
  • Preserved public interface and output format, user-facing interactions still use string-based node names and original edge weight types.

@czgdp1807 czgdp1807 merged commit 4ad15bc into codezonediitj:main Jul 23, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants