Generate a branch and bound tree
Afficher commentaires plus anciens
Hey
I developed a script to solve the travelling salesman problem (TSP) using the branch and bound algorithm.
As a result the script visualizes a map (attached) with the shortest travelling way.
Is it also possible to generate a branch and bound tree? I think this would be also a nice way to presentate the result.
I stored the optimal way in an array. For example the optimal way for a 5 city problem is: 1 => 2 => 3 => 4 => 5
Now I would like the generate a tree. The number of possible branches decrease with every additional city, because every city can be visited just once. My expected outcome tree is also attached.
I hope someone can help me.
Best
Réponses (1)
Mary Fenelon
le 2 Mai 2018
0 votes
A tree is a graph so you could visualize it with MATLAB graph objects . There's also a treeplot function.
1 commentaire
Stefan Zeiter
le 2 Mai 2018
Modifié(e) : Stefan Zeiter
le 2 Mai 2018
Catégories
En savoir plus sur Nearest Neighbors dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!