Following are the pre and post timestamps of the vertices for the
DFS TRAVERSAL starting from B.
Note: the graph being disconnected ,vertices D,G and H can never be reached . Hence their post and pre timestamps are 0.
Vertex | Pre | Post |
---|---|---|
A | 10 | 11 |
B | 1 | 12 |
C | 6 | 7 |
D | 0 | 0 |
E | 2 | 9 |
F | 3 | 8 |
G | 0 | 0 |
H | 0 | 0 |
I | 4 | 5 |
Perform DFS on the following graphs starting in vertex B. Whenever there is a choice of...
Question 7 10 pts Recall that 1. Tree Edge: It is a edge which is present in tree obtained after applying DFS on the graph. 2. Forward Edge: It is an edge (u, v) such that vis descendant but not part of the DFS tree. 3. Back edge: It is an edge (u, v) such that vis ancestor of edge u but not part of DFS tree. Perform DFS on the following graphs starting in vertex D. Whenever there is...
3.3. Run the DFS-based topological ordering algorithm on the following graph. Whenever you have a choice of vertices to explore, always pick the one that is alphabetically first. (a) Indicate the pre and post numbers of the nodes. (b) What are the sources and sinks of the graph? (c) What topological ordering is found by the algorithm? (d) How many topological orderings does this graph have? 3.3. Run the DFS-based topological ordering algorithm on the following graph. Whenever you have...
Execute DFS on the graph below, starting in node a. Whenever you have a choice which vertex to visit next, choose the next vertex in the adjacency list of the vertex (e.g., when you have reached node e, you must first try to visit node f, then g, and then . Indicate the outcome of the algorithm by labeling the edges of the graph either as T (tree edge) F (forward edge), B (back edge), or C (cross edge). Label...
Draw the DFS search tree with starting vertex E and break ties alphabetically. Assuming unit edge length (i.e., ignore edge weight), draw the BFS search tree with starting vertex E and break ties alphabetically. Suppose the Dijkstras algorithm is run on the graph with starting vertex E: (i) draw a table showing the intermediate distance values of all vertices at each iteration of the algorithm; (ii) show the final shortest-path tree.
please I need it urgent thanks algorithms second picture is the graph 2.3 Graphs and BFS-DFS 5 points each I. Draw the adjacency matrix for the graph A on the last page. 2. Show the order in which a breadth first traversal will print out the vertices? Assume that if the algorithm has a choice of which vertex to visit, it visits the vertex with the lower number. 3. Find a topological ordering for the graph B on the last...
Help with Q3 please! 3 (9 pts) For the graph G (VE) in question 2 (above), construct the adjacency lists for G (using alphabetical ordering) and the corresponding reverse graph GR Adjacency list for G (alphabetical ordering): Adjacency list for G. V = {A, B, C, D, G, H, S) V - {A, B, C, D, G, H, S) E A = { EB = EC) - E[D] = {C,G) E[G] - [ ECH - E[S { EA = {...
3. Consider the the following graphs for each of the two subproblems. Each subproblem can be answered (or blank) independently of the other ( subject to the 4 total blank for partial credit rule). s MST algorithm on the graph below and left, starting with vertex all work done so far: al (40 points) You are runing Prim' a. You are about to take vertex g out of the min-ehave not done so yet. Show the order that vertices wer...