I implemented Floyd-Warshall algorithm. According to their matrices, I can get the correct result, about the shortest path between two places and their distance. My question is how to print the shortest distance from i to j. I made some researches and I found an algorithm like that. Can anyone explain me how should it be, or how does it works, or say any other suggestion?
PrintShortestPath(P,i,j){
if(i==j) print i
else if (P[i][j]==NULL)
print "No path from i to j"
else{
PrintShortestPath(P,i,P[i][j])
print j
}
}