AllPairsShortestPath
AllPairsShortestPath[g]
gives a matrix, where the entry is the length of a shortest path in g between vertices and .
AllPairsShortestPath[g,Parent]
returns a three-dimensional matrix with dimensions 2*V[g]*V[g], in which the entry is the length of a shortest path from to and the entry is the predecessor of in a shortest path from to .
Details and Options
- AllPairsShortestPath functionality is now available in the built-in Wolfram Language function GraphDistanceMatrix.
- To use AllPairsShortestPath, you first need to load the Combinatorica Package using Needs["Combinatorica`"].
Examples
Basic Examples (2)
AllPairsShortestPath has been superseded by GraphDistanceMatrix:
Text
Wolfram Research (2012), AllPairsShortestPath, Wolfram Language function, https://reference.wolfram.com/language/Combinatorica/ref/AllPairsShortestPath.html.
CMS
Wolfram Language. 2012. "AllPairsShortestPath." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/Combinatorica/ref/AllPairsShortestPath.html.
APA
Wolfram Language. (2012). AllPairsShortestPath. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/Combinatorica/ref/AllPairsShortestPath.html