In gplot or any graphing program how would I be able to determine if a path exists between two points

2 次查看(过去 30 天)
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.

回答(1 个)

Walter Roberson
Walter Roberson 2013-1-18
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.
  1 个评论
Robert
Robert 2013-1-18
Thank you for your response. I would prefer not to use Dijkstra's Shortest Path algorithm since I just want to check whether or not there is a path. How would I use the set partitioning algorithm?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Dijkstra algorithm 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by