Skip to content
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

Create Dijkstra algorithm #740

Merged
merged 1 commit into from
Oct 9, 2021
Merged

Create Dijkstra algorithm #740

merged 1 commit into from
Oct 9, 2021

Conversation

raazanand
Copy link
Contributor

Problem

  • Shortest path in weighted graph using Dijkstra algorithm

Solution

  • Given a weighted graph and a starting (source) vertex in the graph, Dijkstra’s algorithm is used to find the shortest distance from the source node to all the other nodes in the graph.

  • As a result of the running Dijkstra’s algorithm on a graph, we obtain the shortest path tree (SPT) with the source vertex as root.

  • In Dijkstra’s algorithm, we maintain two sets or lists. One contains the vertices that are a part of the shortest-path tree (SPT) and the other contains vertices that are being evaluated to be included in SPT. Hence for every iteration, we find a vertex from the second list that has the shortest path.

Changes proposed in this Pull Request :

  • 1. Implemented algorithm using using Adjacency Matrix
  • 2. n/a
  • ..

Other changes

@raazanand raazanand closed this Oct 9, 2021
@raazanand raazanand reopened this Oct 9, 2021
@raazanand
Copy link
Contributor Author

@fineanmol kindly review my PR #740

@fineanmol fineanmol merged commit 037d043 into fineanmol:master Oct 9, 2021
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