This preview shows pages 1–5. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CS570 Analysis of Algorithms Fall 2004 Final Exam Name: _____________________ Student ID: _________________ 1) a. Which of the diagrams below best describes the relationship between P, NP, and NPComplete problems? (25 pts) b. Each diagram represents 3 relationships between P & NP, P & NPC, and NP & NPC. Prove each of the three relationships or state that a proof does not exist. If a proof does not exist state why this relationship should exist. P & NP: P & NPC: NP & NPC: P NP NP NPC P P NP P NPC A D C B NP NPC NPC 2) Let G = (V,E) be a directed graph with edge weights w(e) >0 for all edges. For all paths p, let m(p) = max{w(e), such that e is an edge on the path p}. Let the set of vertices, V = {1, ..., n}. For all pairs (i, j) V , let d(i, j) = min({m(p), such that p is a path from i to j} or d(i, j)= if no such path exists. Show that d(i, j) for all i, j with 1 i n and 1 j n can be computed in O(n 3 ) time (in other words present the algorithm and proof). (25 pts) Hint: First show that for all i, j, k, d(i, j) max{d(i, k), d(k, j)}. Additional space for problem 2. Additional space for problem 2....
View
Full
Document
This note was uploaded on 02/27/2008 for the course CSCI 570 taught by Professor Shamsian during the Fall '06 term at USC.
 Fall '06
 Shamsian
 Algorithms

Click to edit the document details