Page 1 of 1

Urgent pls: Data Structures and algorithms

Posted: Thu Jul 14, 2022 2:17 pm
by answerhappygod
Urgent pls: Data Structures and algorithms
Urgent Pls Data Structures And Algorithms 1
Urgent Pls Data Structures And Algorithms 1 (430.93 KiB) Viewed 37 times
(5 marks) Consider the following directed, edge-weighted graph G with an edge list E as follows: {(H,F),(G,H),(F,G),(C,G),(E,C),(C,F),(B,E),(B,C),(D,H),(D,F),(A,D),(A,C),(A,B)} Find the single-source shortest paths from vertex A to all other vertices by running the Bellman-Ford algorithm on G starting at vertex A, using the order of the edge list E as given above, until there is no change in the array D from one iteration to the next. In each iteration, write out the contents of the array D (initially D[A]=0 and D[V]=+∞ for all other vertices V=A ).