Question: Write a program in C++/JAVA to complete the following tasks implementing the Dijkstra's shortest path algorithm a 00 0 01 00 10 00 4 d

 Write a program in C++/JAVA to complete the following tasks implementing

Write a program in C++/JAVA to complete the following tasks implementing the Dijkstra's shortest path algorithm a 00 0 01 00 10 00 4 d 10 f 0 1 3 0 0 0 70 10 0 0 00 0 0 20 0 Digraph Adjacency matrix Make an adjacency distance matrix and save the distance information in a two-dimensional a. array as shown above in the figure, for example b. Find the shortest path from the node 'a' to each node (b, c, d, e, f, g, h, I, j) c. Display the shortest distance from the node 'a' to each node d. Display the path for the shortest distance from the node 'a' to each node The way of implementation is open. If you have your idea of implementing the Dijkstra's shortest path algorithm, you may use that idea, but your code must follow the original algorithm below to get the shortest path DijkstraAlgorithm(weighted simple digraph, vertex first) for all vertices v currDist(v) c0; currDist(first) 0; toBeChecked all vertices; while toBeChecked is not empty v a vertex in toBeChecked with minimal currDist(v); remove v from toBeChecked; for all vertices u adjacent tov if currDist(u) > currDist(v) weight(edge(vu)) currDist(u) currDist(v)+ weight(edge(vu)); predecessor(u)v; Write a program in C++/JAVA to complete the following tasks implementing the Dijkstra's shortest path algorithm a 00 0 01 00 10 00 4 d 10 f 0 1 3 0 0 0 70 10 0 0 00 0 0 20 0 Digraph Adjacency matrix Make an adjacency distance matrix and save the distance information in a two-dimensional a. array as shown above in the figure, for example b. Find the shortest path from the node 'a' to each node (b, c, d, e, f, g, h, I, j) c. Display the shortest distance from the node 'a' to each node d. Display the path for the shortest distance from the node 'a' to each node The way of implementation is open. If you have your idea of implementing the Dijkstra's shortest path algorithm, you may use that idea, but your code must follow the original algorithm below to get the shortest path DijkstraAlgorithm(weighted simple digraph, vertex first) for all vertices v currDist(v) c0; currDist(first) 0; toBeChecked all vertices; while toBeChecked is not empty v a vertex in toBeChecked with minimal currDist(v); remove v from toBeChecked; for all vertices u adjacent tov if currDist(u) > currDist(v) weight(edge(vu)) currDist(u) currDist(v)+ weight(edge(vu)); predecessor(u)v

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!