Combinatorica Package >

AllPairsShortestPath

AllPairsShortestPath[g]
gives a matrix, where the ^(th) entry is the length of a shortest path in 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 .
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF