Skip to content

feat: add Dijkstra's shortest path algorithm#4

Merged
kelsonbrito50 merged 1 commit intomainfrom
feat/dijkstra-shortest-path
Feb 26, 2026
Merged

feat: add Dijkstra's shortest path algorithm#4
kelsonbrito50 merged 1 commit intomainfrom
feat/dijkstra-shortest-path

Conversation

@kelsonbrito50
Copy link
Owner

Adds Dijkstra's algorithm with min-heap optimization and path reconstruction.

  • dijkstra() — computes shortest distances from source to all vertices
  • shortest_path() — returns distance + path between two vertices
  • 8 test cases covering core functionality

- Implementation with min-heap for O((V+E) log V) complexity
- Path reconstruction via predecessor tracking
- 8 test cases covering distances, paths, unreachable vertices
@kelsonbrito50 kelsonbrito50 merged commit 7b69f4a into main Feb 26, 2026
2 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.

1 participant