Then the two edge path is Step 1 From a 1 a 2 a k a n goto a 1 a 2 b k a k 1 a

# Then the two edge path is step 1 from a 1 a 2 a k a n

This preview shows page 6 - 12 out of 12 pages.

Then the two edge path is: Step 1: From a 1 a 2 a k a n goto ´ a 1 ´ a 2 ´ …b k ´ a k + 1 ´ a n = ´ b 1 ´ b 2 ´ …b k ´ b k + 1 ´ b n . Step 2: From ´ b 1 ´ b 2 ´ …b k ´ b k + 1 ´ b n to b 1 b 2 b k b k +1 b k +2 b n . 6 6(a) (10 points) Conduct a DFS for the following graph. Please label each vertex u with the discovery time and the finish time d ( u )/ f ( u ). You should start the traversal from vertex a , and follow the alphabetic order whenever you need to make a decision among multiple choices. Solution: (b) (5 points) List all edges that belong to each of the following sets: The set of back edges: ( e , b ), ( g , a ), ( h , f ), The set of forward edges: ( a , e ), ( a , f ), ( e , j ), ( d , j ) The set of cross edges: ( g , h ) 7 (c) (5 points) Identify the strongly connected components and draw the component graph. 8 7 (15 points) Use Dijkstra’s algorithm to find the shortest path tree for the following graph. Please take the vertex s as the source. You must show detailed steps, one figure for each step. (Initialization is given in the following graph.) Solution: Step 1 Step 2 9 Step 3 Step 4 10 Step 5 Step 6 Step 7 11 Step 8 The shortest path tree is: 12 #### You've reached the end of your free preview.

Want to read all 12 pages?

• Fall '18
• Eric Swartz
• • •  