Given the following adjacency lists (with edge weights in parentheses) for a directed graph:
A: B(5), C(3), D(1)
B: C(1), D(3)
C: B(3), D(7), E(1)
D: A(6), C(3)
E: F(5)
F: D(3), A(4)
Execute Dijkstra’s shortest-path algorithm by hand on this graph, showing how the data structures evolve, with A as the starting vertex. Clearly indicate which edges become part of the shortest path and in which order.
Answer:
Given that the following adjacency lists (with edge weights in parentheses) for a directed graph is:
A : B(5), C(3), D(1)
B : C(1), D(3)
C : B(3), D(7), E(1)
D : A(6), C(3)
E : F(5)
F : D(3), A(4)
By executing Dijkstra’s shortest-path algorithm by hand on this graph, we have
Get Answers For Free
Most questions answered within 1 hours.