0
3.9kviews
Write single source shortest path algorithm and apply the same for following.
1 Answer
| written 8.8 years ago by |

Ans:
Algorithm:
Algorithm
1) Create a set sptSet (shortest path tree set) that keeps track of vertices included in shortest path tree, i.e., whose minimum distance from source is calculated and finalized. Initially, this set is empty.
2) Assign a distance value to all vertices in the input graph. Initialize …