How do I get edges information in graphshortestpath fuction?

2 ビュー (過去 30 日間)
Majbah
Majbah 2014 年 3 月 13 日
回答済み: Walter Roberson 2014 年 3 月 14 日
Hello,
I am using graphshortestpath function for finding shortest path in a graph. I want to know the edges information in the output with the distance and path information. Like, which edges are used to get to the destination using shortest path.
Is there any way to do that?
Thanks in advance.

採用された回答

Walter Roberson
Walter Roberson 2014 年 3 月 14 日
If you have created formal graph objects then see the bottom part of the example in http://www.mathworks.com/help/bioinfo/ref/graphshortestpath.html
If you have not created a formal graph object, then the edges are implied by the path. If there is a path step from node A to node B then the edge AB was traversed, and the cost for the step is G(A, B)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by