Rank: 52225 based on 0 downloads (last 30 days) and 0 files submitted
photo

m

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by m
Updated File Comments Rating
18 Jan 2010 MatlabBGL MatlabBGL provides robust and efficient graph algorithms for Matlab using native data structures. Author: David Gleich

"How can I get the shortest path between nodes s and t? What I'm looking for is list of nodes, not just the distance..."

Use the predecessors returned by the shortest_paths function.
For example:

load graphs/clr-25-2.mat
startnode = 1;
endnode = 5;
[d pred] = shortest_paths(A,startnode);

cur = endnode;
path = [];
while(true)
    path = [cur path];
    if cur == startnode
        break;
    end
    cur = pred(cur);
end

In this example, path = [1 3 5], which represents the shortest path from node 1 to node 5.

Top Tags Applied by m
addpath
Files Tagged by m
Updated   File Tags Downloads
(last 30 days)
Comments Rating
22 Jun 2007 Add folders to path excluding .svn Changes to genpath to exclude the .svn to the path Author: H. Brian Hui addpath, genpath, svn 4 0

Contact us at files@mathworks.com