|
SOLUTIONS
|
COMBINATORICA PACKAGE SYMBOL
AllPairsShortestPath
AllPairsShortestPath[g]
gives a matrix, where the ![]()
entry is the length of a shortest path in g between vertices
and
.
![]()
returns a three-dimensional matrix with dimensions
, 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
.
DetailsDetails
- To use
, you first need to load the Combinatorica Package using Needs["Combinatorica`"].
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
