determine if there is a path between two vertices
IsReachable(G, u, v)
vertices of the graph
IsReachable(G, u, v) returns a true when the vertex v is reachable from u in the graph G.
To produce an actual path (or directed path when G is directed) from u to v, use BellmanFordAlgorithm, DijkstrasAlgorithm, or ShortestPath.
To find all vertices reachable from u, use Reachable.
If G is an undirected graph, a vertex w is said to be reachable from a vertex v if there exists a path in G between v and w. This is true if and only if they are in the same connected component.
If G is a directed graph, a vertex w is said to be reachable from a vertex v if there exists a directed path in G from v to w.
C6 ≔ CycleGraph⁡6
C6≔Graph 1: an undirected graph with 6 vertices and 6 edge(s)
With the following example we see that the reachability relation is not symmetric for directed graphs.
DP4 ≔ Graph⁡A,B,C,D,A,B,B,C,C,D
DP4≔Graph 2: a directed graph with 4 vertices and 3 arc(s)
The GraphTheory[IsReachable] command was introduced in Maple 2018.
For more information on Maple 2018 changes, see Updates in Maple 2018.
Download Help Document
What kind of issue would you like to report? (Optional)