As you know, Floyd-Warshall algorithm is another way to solve Shortest Path problem on weighted edges.
So lets analyze that algorithm for finding out Why they override the matrix.
The inputs of Floyd-Warshall is:
- adjacency matrix ( represents weighted )
- directed graph (V, E)
So it works like the following, the weight of a path between two vertices's is the sum of the weights on the edges along that path. So, the weight of the vertices will be OVERRIDE, since that's how you calculate the Warshall. So when you visit the first vertex, the weights will not change, but when you visit the next vertex, the weights will change with respect to the first path to the first vertex, it will simply add it to the matrix.
So I guess you understand why the Adjacency Matrix will be overriden if we are using Floyd-Warshalls. Remember, it uses the weights of the previous visited vertex's :)
Hope it got this clarified.
Take care
2006-10-08 05:55:35
·
answer #1
·
answered by ? 6
·
0⤊
0⤋