Floyd's Algorithm- Design and Analysis of Algorithm | SANA LECTURES

Опубликовано: 15 Октябрь 2024
на канале: SANA LECTURES
161
7

First, create a cost adjacency matrix for the given graph.
Copy the above matrix-to-matrix D, which will give the direct distance between nodes.
We have to perform N iteration after iteration k.the matrix D will give you the distance between nodes with only (1,2...,k)as intermediate nodes.
At the iteration k, we have to check for each pair of nodes (i,j) whether or not there exists a path from i to j passing through node k.