Shortest Paths and Transitive Closure(Cont’d) Single Source All Destination Dijkstra’s Algorithm V V 1 50 V V 1 10 V 2 V 3 15 20 > if(distance[u] + cost[u][w] < distance[w ]){ distance[w ] = distance[u] + cost[u][w]; } int cost[][] = {{0, 50, 10, 1000, 45, 1000}, { 1000, 0, 15, 1000, 10, 1000}, { 20, 1000, 0, 15, 1000, 1000}, { 1000, 20, 1000, 0, 35, 1000}, { 1000, 1000, 30, 1000, 0, 1000}, { 1000, 1000, 1000, 3, 1000, 0} };