Combinatorica パッケージ >

ShortestPath

ShortestPath[g, start, end]
グラフ g の頂点 startend の間の最短経路を見付ける.
  • ShortestPathを使うためには,まずCombinatorica パッケージ をロードしなくてはならない.それにはNeeds["Combinatorica`"]を実行する必要がある.
  • AutomaticDijkstraBellmanFordのいずれかを取るオプションAlgorithmが提供される.これにより,Dijkstraのアルゴリズムを使うか,Bellman-Fordアルゴリズムを使うかを選択することができる
  • デフォルトはAlgorithm->Automaticである.この場合,辺が負の重みを持つかどうかにより,またグラフの密度に基づいて,アルゴリズムがBellmanFordDijkstraのどちらかを選ぶ.
© 2008 Wolfram Research, Inc. japanese.gif
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team