Question: Given the following graph: B 2 3 E 3 (a) Give the matrix representation of the graph. (b) Give the depth-first and breadth-first traversals
Given the following graph: B 2 3 E 3 (a) Give the matrix representation of the graph. (b) Give the depth-first and breadth-first traversals of the graph starting at A. Edges leaving a node are processed in alphabetical order. (c) Assume that a depth-first traversal is performed starting at A and that edges of a node are processed in alphabetical order. Indicate the discovery and finish times for each node and label each edge with T (tree edge), B (back edge), F (forward edge) or C (cross edge), according to its type. (d) Derive the minimum-cost paths from source vertex A to all other vertices using Dijkstra's algorithm. At each stage of the derivation, show the current cost and parent fields. Also show the state of the priority queue. Finally, for each vertex, show the cost and the path to get to this vertex.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
