Skip to content

Commit 4b56e2b

Browse files
authored
Update README.md
1 parent c785717 commit 4b56e2b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Given a graph and a source vertex in the graph, find the shortest paths from sou
66

77
Dijkstra’s algorithm is very similar to Prim’s algorithm for minimum spanning tree. Like Prim’s MST, we generate an SPT (shortest path tree) with a given source as root. We maintain two sets, one set contains vertices included in the shortest-path tree, another set includes vertices not yet included in the shortest-path tree. At every step of the algorithm, we find a vertex that is in the other set (set of not yet included) and has a minimum distance from the source.
88

9+
![image](https://user-images.githubusercontent.com/22562694/120260452-8d455d80-c2b3-11eb-9d84-6b8b46dffc2c.png)
10+
911
Below are the detailed steps used in Dijkstra’s algorithm to find the shortest path from a single source vertex to all other vertices in the given graph.
1012

1113
Algorithm

0 commit comments

Comments
 (0)