2 Algorithm Problems Research Paper
I have two problems I need assistance with. They are due in 5 hours, but they shouldnt take that long to complete. Document Preview: Chapter 9, problem 9.1, page 446 Let G = ( V , E ) be an undirected graph and let R be a relation on V defined by vRw if and only if there exists a path from v to w . (Recall there is a path of length zero from any vertex to itself.) Show that R is an equivalence relation. What are the equivalence classes of this relation? Show that the reachability matrix R for an undirected graph with n vertices can be constructed in 0 ( n 2 )time. Chapter 9, problem 9.3, page 447 Use Algorithm 9.2 to compute the transitive closure of the relation A given in Example 9.1. Show the matrix after each pass of the outermost for loop. Example 9.1 Transitive closure of one relation For the following A, the transitive closure is R. Algorithm 9.2. Warshalls Algorithm input: A and n, where A is an n X n adjacency matrix output: R, the n X n transitive closure matrix of A void transtivieClosure(boolean[][] A, int n, boolean [][] R) int i, j, k; Copy A into R; Set all main diagonal entries, r[i][i] to true; for (k=1; k
Is this the question you were looking for? If so, place your order here to get started!