Qz2Fa11

Qz2Fa11 - the reverse graph and the second DFS spanning...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Analysis of Algorithms CSE 5211 Fall 2011 Quiz 2 Points 40 Intro to Analysis of Algorithms CSE 4081 Fall 2011 Quiz 2 Points 40 Time: 45 min Q1. The Floyd-Warshall algorithm for finding all pairs shortest path-length is as follows: For k=1 to n do For p = 1 to n do For q = 1 to n do If D k+1 pq > D k pk + D k kq then do D k+1 pq := D k pk + D k kq Q1a. What is n and what is the initialization step in the algorithm? [2] Q1b. What does the algorithm return, or where is the final result stored? [2] Q1c. Describe how would you modify the algorithm in order to obtain the actual shortest path, in addition to the shortest path-length? [6] Q2. The following is a directed graph G: V= {a, b, c, d, e, f, g, h, i} E= {(a, b), (a, d), (b, c), (c, a), (d, a), (e, d), (i, f), (f, g), (f, h), (g, h), (h, i)} Draw the graph first. Q2a . Find the strong connected components ( SCC ) in the graph by running the modified- DFS algorithm. You must show the first DFS-spanning tree with post order numbering,
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: the reverse graph, and the second DFS spanning tree as the SCC’s. [8] Q2b. If the same graph is undirected (merge any doubly directed edge), then what do you think are the SCC’s? [2] Q3. For the following game tree describe which nodes will be pruned by alpha-beta pruning, and explain briefly why they will be pruned? Q4. The following list of objects is provided to be manufactured in a factory, with (time, profit) pair for each object: (1, 40), (3, 18), (2, 4) and (2, 20) Q4a. The factory needs to choose a subset of objects such that the total preparation time is less than or equal to 5 and the total profit is maximum . Solve the problem (find max profit, and the subset) by dynamic programming. [8] Q4b. What is the solution when any object may be partially produced ( not DP algorithm )? [2]...
View Full Document

{[ snackBarMessage ]}

Page1 / 2

Qz2Fa11 - the reverse graph and the second DFS spanning...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online