MATLAB Answers

How to find the nodes involved in a shortest path between every pair of nodes in a weighted network?

1 view (last 30 days)
Suchetana Gupta
Suchetana Gupta on 31 May 2015
The code that I was trying is: data=xlsread('file.xls'); s = unique([data(:,1) data(:,2)]); DG = sparse(data(:,1),data(:,2),data(:,3),size(s,1),size(s,1)); UG = tril(DG+DG'); biographobject = biograph(UG,[],'ShowArrows','off','ShowWeights','on'); result=allshortestpaths(biographobject,'Directed','false');
It is giving me the path length. I want an output wherein I will know the exact path traced to traverse a shortest path between every pair of nodes. (I have some ~198 nodes)

Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by