Saint Louis University |
Computer Science 314
|
Dept. of Math & Computer Science |
Topics: MST, Shortest Paths
Related Reading: Chapters 24, 25 of CLRS
Due:
10:00am, Monday, 17 November, 2014
Please make sure to strictly adhere to the stated course procedures regarding the format of your submitted homework. In particular, your name should not appear on anything other than the cover page, and your solution for each problem must be in a separate packet, labeled appropriately with your assigned codename.
You must also adhere to the policies on academic integrity, paying particular attention to the limits on collaboration.
Assume that we are interested in the single-source shortest path
of a weighted graph for a given source s, and that someone provides us
with what they claim are the shortest path costs,
Prim's algorithm for computing an MST runs in worst-case time
Note: You are NOT to change Prim's algorithm per se. You are only to design a new concrete implementation for the priority queue abstraction, which allows the existing algorithm to achieve the stated time bound.
Dijkstra's algorithm for computing single-source shortest paths
in a graph with nonnegative edge weights runs in worst-case time
Note: although this problem is clearly very similar to the previous problem, your solution will be evaluated by a different person, so please make sure your write-ups of the two are self-contained. Also, it is worth noting that although they are similar, the same solution is not likely to be correct for both problems. There is a key difference in how priorities are defined for vertices in the two different contexts.
For the minimum-spanning tree problem, we saw that if a graph has unique edge weights, then there is a unique minimum spanning tree. The same is not true for the shortest path problem.
Give an example of a graph with unique edge weights, but for which there are at least two possible shortest paths from some vertex s to vertex v.
Explain how you can modify Dijkstra's single-source shortest path algorithm in order to calculate P(s,v) = the number of distinct shortest paths from s to v.
Exercise 25.3-5 on page 705 of CLRS.
Revisiting the use of Dijkstra's algorithm on a graph with
integer edge weights in the range 1 to W, show that a custome
priority queue implementation can be used to achieve a running
time of