In gplot or any graphing program how would I be able to determine if a path exists between two points
1 view (last 30 days)
Show older comments
For example A is connected to B, B to C, C to D, and E is connected to F. I want to ask if A is connected to F. The answer should be no. If I say is A connected to D? the answer should be yes.
0 Comments
Answers (1)
Walter Roberson
on 18 Jan 2013
You would not do it in a graphing program; you would use the data that was used to construct the graph.
If you want to know what the path is, you would use something like Dijkstra's Shortest Path algorithm.
If you just want to know whether there is a path, then there is a set partitioning algorithm that can be more efficient.
But those are graph theory questions, not MATLAB questions.
See Also
Categories
Find more on Dijkstra algorithm in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!