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)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
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.
Ver también
Categorías
Más información sobre Dijkstra algorithm en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!