AllPairsShortestPath

AllPairsShortestPath[g]
gives a matrix, where the ^(th) entry is the length of a shortest path in g between vertices and .


returns a three-dimensional matrix with dimensions , in which the ^(th) entry is the length of a shortest path from to and the ^(th) entry is the predecessor of in a shortest path from to .

更多信息更多信息

New to Mathematica? Find your learning path »
Have a question? Ask support »