Answer:
Following are the step by step algorithms is explain below.
Explanation:
Following are the algorithm for searching shortest distances.
Do on the following for mostly contiguous vertex that is 'v' of 'u'
if (dist[v] > dist[u] + weight(u, v))
dist[v] = dist[u] + weight(u, v)