Calculating a Network's Diameter

45 views (last 30 days)
Hi everyone,
I have a graph, G on which I have a applied the distances function such that
d=distances(G);
to get the matrix of shortest path distances between every node pair.
I would like someone to verify that the network diameter can be calculated as
max(d);
and the mean path length of the network as
mean(mean(d));

Accepted Answer

Greg Heath
Greg Heath on 3 Dec 2018
mean(d(:))
Hope this helps
Thank you for formally accepting my answer
Greg

More Answers (0)

Categories

Find more on Sequence and Numeric Feature Data Workflows in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!