How can I find all possible paths between 2 arbitrary nodes in both acyclic and cyclic directed graph?

4 views (last 30 days)
How can I find all possible paths between 2 arbitrary nodes in both acyclic and cyclic directed graph?

Answers (1)

Walter Roberson
Walter Roberson on 17 Jun 2013
There are potentially (and usually) an infinite number of paths between two arbitrary nodes on cyclic graphs.
  15 Comments
NG
NG on 5 Jan 2017
I am guessing that Hoda's question was about simple paths (without repeating vertices). Although there may be many such paths (but finitely many) it is still surprising that there are no such Matlab routines out there.
Walter Roberson
Walter Roberson on 5 Jan 2017
No, Hoda indicated,
"Exactly,I mean distance between 3 and 2 depends on where I came from before node 3?"
which is not a simple path problem.
There are routines to find all the acyclic paths between two nodes when the distance matrix does not change in time or according to where you came from.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!