MATLAB Answers

How to find distance between two nodes? including the nodes.

12 views (last 30 days)
Aswin Sandirakumaran
Aswin Sandirakumaran on 1 Jul 2018
Answered: Walter Roberson on 2 Jul 2018
For example: In this graph i would like to find distance *between s1 and s3.
SO MY OUTPUT SHOULD LOOK LIKE : Distance = 7 (includes both edges and nodes)

Answers (2)

Anton Semechko
Anton Semechko on 1 Jul 2018
Download graph processing toolbox from FEX. Use Dijkstra's algorithm to get shortest path between pairs of nodes. Path length = distance between nodes = sum of edge weights along the path.


Sign in to comment.