Effacer les filtres
Effacer les filtres

Find diameter of a spanning tree

1 vue (au cours des 30 derniers jours)
John Agkali
John Agkali le 17 Nov 2014
hello, I have a weighted undirected minimum spanning tree and I want to find the find the diameter of this. I know that diameter is the longest shortest path but I haven't understood what parameters do i have to fill in the function graphshortestpath() in order to find the shortest path. Let's assume that my spanning tree have 23 indices. So do I need to fill these parameters ...
[dist,path,pred]=graphshortestpath(ST1,1,23,'Directed',false)
ST1 is a sparse matrix that represents the minimum spanning tree.And after the calculations do I have to retrieve the maximum dist in order to find the longest shortest path?
thanks in advance

Réponses (0)

Catégories

En savoir plus sur Graph and Network Algorithms dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by