Compute transitive closure via Floyd-Warshall
Analyze the compute transitive closure via floyd-warshall.
Examples
Input: "test_input_1"
Output: "output_1"
Input: "test_input_2"
Output: "output_2"
Hints
Recall that the transitive closure of a graph is a matrix where an entry (i, j) is true if there is a path from node i to node j in the original graph.
Consider how the Floyd-Warshall algorithm can be adapted to compute the transitive closure by treating the graph as a boolean adjacency matrix and updating it iteratively.
Think about optimizing the algorithm by using bitwise operations or boolean matrices to efficiently represent and update the closure matrix.
Compute transitive closure via Floyd-Warshall
Analyze the compute transitive closure via floyd-warshall.