Problem:
We learn about the Dijkstra’s shortest path algorithm in class. Try to apply it to the following graph.
What is the shortest path between s and b?
Follow-Up:
Using Dijkstra and starting from s, the shortest path found is s-a-b. Yet we can easily see that the shortest path should be s-a-c-b. Thus, we can see that greedy method does not always work. Here, Dijkstra is defeated by the existence of links with negative costs.
However, as some of you discovered during the tutorial, the correct shortest path can be found by starting the Dijkstra work from the destination, i.e., b. Please try this yourself.
Indeed, in real-life usage (e.g., in software systems such as MapQuest), a bi-directional approach is used, i.e., the Dijkstra work is done concurrently from both the starting point and the destination. Conflicts are resolved on the way to construct the final shortest path.
Further Inquiry:
Consider that the link costs are multiplied together (e.g., when the links are associated with probabilities) in a path, would Dijkstra still work?
In order to make informed decisions in this information age, everyone needs to have an efficient way to sift through and evaluate the myriads of information that is available through the internet. The ultimate objective of this course (HKU CCST9003) is to help students develop a “computational” state of mind for everyday events. We will also discuss intensively the societal impacts of computing technologies on our daily life.
Sunday, July 17, 2011
Dijkstra's shortest path problem
Labels:
bi-directional,
communication,
Dijkstra,
graph,
greedy method,
shortest path,
tutorial
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment