I need to modify Dijkstra\'s algorithm so that if there are several shortest paths I need to find the one with minimum number of edges on the path.
I\'ve been stuck
Maintain minPathLen field for each vertex for dijktra.
And in loop where you compare
if(distance(s,u)+edge(u,v)
Add another statement:-
if((distance(s,u)+egde(u,v)==distance(s,v))&&(minPathLen(u)+1