1. add method for class AdjMatrixGraph
2. test suite
3. run result
4. 推广:如果将E中每条边的权值赋为1,然后运行Floyd-Warshall算法,可以得到有向图的传递闭包。
4.1 add method transitiveClosure
4.2 test suite
4.3 test result
本文介绍了一种使用邻接矩阵表示的图结构,并通过Floyd-Warshall算法计算所有顶点之间的最短路径,还展示了如何通过调整算法来获取图的传递闭包。
1. add method for class AdjMatrixGraph
2. test suite
3. run result
4. 推广:如果将E中每条边的权值赋为1,然后运行Floyd-Warshall算法,可以得到有向图的传递闭包。
4.1 add method transitiveClosure
4.2 test suite
4.3 test result

被折叠的 条评论
为什么被折叠?