- 6 Suppose Dijkstra S Algorithm Is Run On The Following Graph Starting At Node A A Draw One Or Multiple Table Showin 1 (48.55 KiB) Viewed 28 times
6. Suppose Dijkstra's algorithm is run on the following graph, starting at node A, (a) Draw one or multiple table showin
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
6. Suppose Dijkstra's algorithm is run on the following graph, starting at node A, (a) Draw one or multiple table showin
6. Suppose Dijkstra's algorithm is run on the following graph, starting at node A, (a) Draw one or multiple table showing the intermediate distance values (dist(v)) of all the nodes at each iteration of the algorithm. (b) Show the final shortest-path tree. (15¹) 8 4 A F 2 2 C 1 2 2. D B E procedure dijkstra (G.l.s) Input: Output: for all we V: dist(u) = x prev(u) = nil dist(s) = 0 H=makequeue (V) (using dist-values as keys) while H is not empty: u= deletemin(H) for all edges (u.e) = E: if dist(e) > dist()+((,): dist(v)= dist(n)+1(u, v) prev(e) = decreasekey(H,e) 10 G 16 H 2 Graph G=(V.E), directed or undirected; positive edge lengths (E); vertex *EV For all vertices w reachable from s, dist (w) is set to the distance from s to ".