How to find Dijkstra shortest path for multiple source single destination problem?

5 ビュー (過去 30 日間)
indu
indu 2017 年 10 月 3 日
回答済み: Walter Roberson 2017 年 10 月 3 日
I want to find Dijkstra shortest path form three different source nodes to single destination point and my input is netcost matrix.Please help me out to figure out this problem.

回答 (2 件)

KSSV
KSSV 2017 年 10 月 3 日

Walter Roberson
Walter Roberson 2017 年 10 月 3 日
%create a graph for illustration
data = randi(15, 20, 2);
G = graph(data(:,1),data(:,2));
sources = [3, 8, 11];
dest = 14;
shortest_paths = shortestpathtree(G, sources, dest, 'outputform', 'cell');
shortest_paths will now be a cell array of paths.

カテゴリ

Help Center および File ExchangeDijkstra algorithm についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by