How to develop a matlab code for ''A closed path with shortest distance value starting from node i and passing through every node exactly once.''

2 views (last 30 days)
Hi, please help me to devewlop the code of the following problem.
I am stating the problem in very simple way:
''I have 15 by 15 matrix. I need a closed path with shortest distance value starting from node i and passing through every node exactly once, where i= 1,2,...15.''
distanceMatrix = [
0 1214 1450 1130 1669 1964 1474 2286 827 176 1377 1735 1465 302 1471;
1214 0 2143 114 1802 1808 2169 1241 1158 1293 1074 690 2168 1029 2164;
1450 2143 0 2126 1317 1568 139 3318 989 1266 1679 2767 71.2 1360 30.8;
1130 114 2126 0 1852 1859 2196 1192 1185 1226 1125 641 2194 985 2190;
1669 1802 1317 1852 0 400 1451 3027 852 1591 754 2476 1383 1378 1317;
1964 1808 1568 1859 400 0 1700 3034 1159 1883 742 2483 1632 1670 1566;
1474 2169 139 2196 1451 1700 0 3349 1072 1289 1799 2798 69.4 1383 142;
2286 1241 3318 1192 3027 3034 3349 0 2341 2377 2300 560 3370 2135 3365;
827 1158 989 1185 852 1159 1072 2341 0 746 781 1792 1048 544 1016;
176 1293 1266 1226 1591 1883 1289 2377 746 0 1319 1825 1283 276 1290;
1377 1074 1679 1125 754 742 1799 2300 781 1319 0 1715 1695 1087 1656;
1735 690 2767 641 2476 2483 2798 560 1792 1825 1715 0 2819 1584 2815;
1465 2168 71.2 2194 1383 1632 69.4 3370 1048 1283 1695 2819 0 1389 87.4;
302 1029 1360 985 1378 1670 1383 2135 544 276 1087 1584 1389 0 1385;
1471 2164 30.8 2190 1317 1566 142 3365 1016 1290 1656 2815 87.4 1385 0
];

Answers (0)

Tags

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!