๐Ÿ”ธWarshall's Algorithm

Warshall's Algorithm

To visualize this algorithm use this following site, you can check each steps of warshell algorithm from here,

here's a test case, just use this input and click on analyze data.

Open source project, source code is available on GitHub.


Warshall's Algorithm is used to find the transitive closure of a graph. The transitive closure of a graph is a matrix that shows whether there is a path from vertex i to vertex j. The algorithm is based on the idea that if there is a path from vertex i to vertex j, and there is a path from vertex j to vertex k, then there is a path from vertex i to vertex k.

Here's a simple test case for this code,

Above code can also work to find the path matrix. Follow the comments of the code.


Last updated

Was this helpful?