あるポイントから別のポイントへの最短パスを取得するには、Boostライブラリを使用する必要があります。サンプルコードを確認しましたが、わかりやすくなっています。ただし、この例は、全体的な距離を取得する方法のみを示しています。先行マップを反復処理して実際に最短経路を取得する方法を理解しようとしていますが、理解できないようです。私はこの主題に関するこれらの2つの質問を読みました:
ブーストグラフのVertexList=ListSを使用したダイクストラ最短経路
Boost :: Dijkstra Shortest Path、パスイテレータから頂点インデックスを取得する方法は?
しかし、提供されている両方の例では、IndexMaptypedefはVisualStudioコンパイラでは機能しないようであり、率直に言って、Boost typedefは私には少し混乱しており、これらすべてを理解するのに問題があります。ここにあるBoostのサンプルコードに基づいて、パスを取得する方法を教えてもらえますか?とてもありがたいです。
http://www.boost.org/doc/libs/1_46_1/libs/graph/example/dijkstra-example.cpp