New answers tagged


Initially dist[i][j] = AdjacentMatrix[i][j] //all directly reachable nodes are the base case. How more can we improve on the base case? Two possible algorithms which can work. Find dist[i][j] = For all k { dist[i][k] + dist[k][j] } This doesn't work because dist[i][k] can still be INF and is not finalized. Fix one intermediate node k1 & find all ...

Top 50 recent answers are included