GraphTheory
IsReachable
determine if there is a path between two vertices
Calling Sequence
Parameters
Description
Examples
Compatibility
IsReachable(G, u, v)
G
-
graph
u, v
vertices of the graph
IsReachable returns true or false indicating whether there exists a path from u to v in the graph G.
To list all vertices reachable from u, use Reachable.
To produce an actual path from u to v, use BellmanFordAlgorithm, DijkstrasAlgorithm, or ShortestPath.
with⁡GraphTheory:
C6≔CycleGraph⁡6
C6≔Graph 1: an undirected unweighted graph with 6 vertices and 6 edge(s)
IsReachable⁡C6,1,5
true
ShortestPath⁡C6,1,5
1,6,5
The GraphTheory[IsReachable] command was introduced in Maple 2018.
For more information on Maple 2018 changes, see Updates in Maple 2018.
See Also
BellmanFordAlgorithm
DijkstrasAlgorithm
Reachable
ShortestPath
Download Help Document
What kind of issue would you like to report? (Optional)