First, we should compute the strongly connected component graph. Then we use the component graph to run the transitive closure algorithm.
July 1, 2007
Exercises 25.2-7
If , then we print the path i to m and m to j recursively. In this way, the algorithm is difficult slightly.
Exercises 25.2-6
Check the diagonal. Otherwise we can run more one iteration, if ≠
, then there is negative cycle.
Exercises 25.2-4
We know that , since node k can not be intermediate node on the path from i to k. Similarly,
.
Exercises 25.2-2
We can use the OR and AND operation to replace the multiply operation in the algorithm.