Introduction
We already know how we can find the shortest paths in a graph starting from a given vertex. Practically we modified breadth-first search in order to calculate the distances from s to all other nodes reachable from s. We know that this works because BFS walks through the graph level by level.
Some sources give a very simple explanation of how BFS finds the shortest paths in a graph. We must just think of the graph as a set of balls connected through strings.
Read full article from Algorithm of the Week: Dijkstra Shortest Path in a Graph | Javalobby
No comments:
Post a Comment