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

1 visualización (últimos 30 días)
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.

Respuestas (1)

Walter Roberson
Walter Roberson el 18 de En. de 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.
  1 comentario
Robert
Robert el 18 de En. de 2013
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?

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by