Find diameter of a spanning tree

1 次查看(过去 30 天)
John Agkali
John Agkali 2014-11-17
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

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graph and Network Algorithms 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by