Unformatted text preview: b. Write a set of recurrence relations that characterize the complexity of the problem. c. Show that the complexity of the problem is O (3 n ). Greedy Even though greed pays oF in Dijkstra’s algorithm, greedy strategies may not ±nd the shortest path for a graph. a. Give an example to show that the following “greedy” strategy doesn’t work in ±nding the shortest path: “at each step, visit the unvisited vertex closest to the one just visited ” (In Dijkstra’s algorithm, the greedy strategy is to visit the unvisited vertex which is closest to the set of vertices that have already been visited ). b. One important reason that Dijkstra’s algorithm works is that the costs of edges are all positive. If it is not true, i.e., there exit edges with negative costs, will Dijkstra’s algorithm work for this particular type of graphs?...
View
Full
Document
This note was uploaded on 08/06/2008 for the course CS 130B taught by Professor Suri during the Winter '08 term at UCSB.
 Winter '08
 SURI
 Algorithms, Data Structures

Click to edit the document details