|
SOLUTIONS
|
MATHEMATICA 内置符号
GraphDistance
GraphDistance[g, s, t]
给出在图 g 中从源顶点 s 到目标顶点 t 的距离.
GraphDistance[g, s]
给出从 s 到图 g 中所有顶点的距离.
更多信息更多信息
- GraphDistance[g, s, t] 给出 s 和 t 之间的最短路径的长度.
- 当 s 和 t 之间不存在路径时,距离为 Infinity.
- 对于加权图,距离是 s 和 t 之间的任意路径上权值和的最小值.
版本 8 的新功能
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »

