フィルターのクリア

Hello, I need help in path planning from a Hamiltonian matrix with a condition that I visit each point only once with starting point known.

2 ビュー (過去 30 日間)
mat=[0,10,8,7,7;10,0,10,5,6;8,10,0,8,9;7,5,8,0,6;7,6,9,6,0] % C is a hamiltonian matrix containing relative distances
In this case the points are A,B,C,D,E and let A be the starting point. Now, from A, I can move to either D or E. So two different paths are possible. How do I write algorithm for this such that I compare the travelling distance for each path and choose with minimum travelling distance? I have code for the matrix with unique elements, but need help when there are more than 1 path is possible.
Note: the number of visiting points is a variable and I chose only 5 i.e A,B,C,D,E just to explain.
  10 件のコメント
Torsten
Torsten 2018 年 5 月 2 日
Try this code:
https://de.mathworks.com/matlabcentral/fileexchange/13680-traveling-salesman-problem-genetic-algorithm
Best wishes
Torsten.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeTraveling Salesman (TSP) についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by