How to find out TSP of a graph.
2 ビュー (過去 30 日間)
古いコメントを表示
I have 5 points in a graph and need to find TSP
s = [1 1 1 1 2 2 2 3 3 4 ]
t= [ 2 3 4 5 3 4 5 4 5 5]
G = graph(s,t);
G.Edges.Weight = [ 10 21 3 8 9 10 12 5 7 2 ];
0 件のコメント
回答 (2 件)
Sam Chak
2022 年 7 月 28 日
You want to plot the graph like this?
s = [1 1 1 1 2 2 2 3 3 4];
t = [2 3 4 5 3 4 5 4 5 5];
weights = [10 21 3 8 9 10 12 5 7 2];
G = graph(s, t, weights);
plot(G, 'EdgeLabel', G.Edges.Weight)
Bruno Luong
2022 年 7 月 28 日
Have you tried this https://www.mathworks.com/help/optim/ug/travelling-salesman-problem.html
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Traveling Salesman (TSP) についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!