I am referring to the algorithm described in Wikipedia. Will the same following condition
work for undirected graphs if I initialize the distance matrix using the ruleCode:if dist[i][j] > dist[i][k] + dist[k][j] dist[i][j] = dist[i][k] + dist[k][j].Code:dist[i][j] = dist[j][i]
My opinion is that it should work since an undirected graph can also be represented as a directed graph using 2 opposite directed edges for every edge in the undirected graph.