This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CSIS 0250B Design and Analysis of Algorithms Assignment 2 Due: 11:59 PM, Feb 26, 2009 Warmup (no need to turn in) 1. Given a directed graph G in adjacency list format, show how to construct the reverse graph in linear time. 2. Give a lineartime algorithm to determine when a given DAG (directed acyclic graph) G contains a directed path that touches every vertex exactly once. 3. Dijkstra’s algorithm can be implemented in O (( m + n )log n )) time, where n and m are respec tively the number of vertices and edges in the graph. Suppose you have been told that the input graph is a dense graph and m is close to n 2 . Could you find another way to implement Dijkstra’s algorithm in O ( n 2 ) time? 4. The following algorithm attempts to find the shortest path from node s to node t in a directed graph with some negative edges: Add a large enough number to each edge weight so that all the weights become positive, then run Dijkstra’s algorithm....
View
Full Document
 Spring '10
 Chan
 Algorithms, Graph Theory, Dijkstra, positive edge weights

Click to edit the document details