Assignment 7 - Key(1).pdf - Assignment 7 Key 1 Find a topological ordering for the graph in Figure 9.81 The following ordering is arrived at by using a

# Assignment 7 - Key(1).pdf - Assignment 7 Key 1 Find a...

• Homework Help
• 9
• 100% (7) 7 out of 7 people found this document helpful

This preview shows page 1 - 4 out of 9 pages.

Assignment 7 - Key 1.Find a topological ordering for the graph in Figure 9.81 The following ordering is arrived at by using a queue and assumes that vertices appear on an adjacency list alphabetically. The topological order that results is then s, G, D, H, A, B, E, I, F, C, t 2.Consider the directed graph shown in the figure below. Apply Dijkstra’s algorithm with vertex S as source and find the shortest path to all other vertices. Show all steps. [10 points]
Initially make every distance ∞ other than S. Step 1 Vertex Known Distance Path S F 0 Null A F Null B F Null C F Null D F Null E F Null F F Null G F Null T F Null Step 2 Vertex Known Distance Path S T 0 Null A F 4 S B F 3 S C F Null D F 7 S E F Null F F Null G F Null T F Null Step 3 Vertex Known Distance Path S T 0 Null A F 4 S B T 3 S C F Null D F 7 S E F Null F F Null G F Null T F Null
Step 4 Vertex Known Distance Path S T 0 Null A T 4 S B T 3 S C F 5 A D F 7 S E F Null F F Null G F Null T F Null Step 5 Vertex Known Distance Path S T 0 Null A T 4 S B T 3 S C T 5 A D F 7 S E F 6 C F F Null G F Null T F Null Step 6 Vertex Known Distance Path S T 0 Null A T 4 S B T 3 S C T 5 A D F 7 S E T 6 C F F Null G F 8 E T F 10 E Step 7 Vertex Known Distance Path S T 0 Null A T 4 S
• • • 