Filter löschen
Filter löschen

Find diameter of a spanning tree

1 Ansicht (letzte 30 Tage)
John Agkali
John Agkali am 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

Antworten (0)

Kategorien

Mehr zu Graph and Network Algorithms finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by