IsReachable - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


GraphTheory

  

IsReachable

  

determine if there is a path between two vertices

 

Calling Sequence

Parameters

Description

Definition

Examples

Compatibility

Calling Sequence

IsReachable(G, u, v)

Parameters

G

-

graph

u, v

-

vertices of the graph

Description

• 

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.

Definition

• 

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.

Examples

withGraphTheory:

C6CycleGraph6

C6Graph 1: an undirected graph with 6 vertices and 6 edge(s)

(1)

IsReachableC6,1,5

true

(2)

ShortestPathC6,1,5

1,6,5

(3)

With the following example we see that the reachability relation is not symmetric for directed graphs.

DP4GraphA,B,C,D,A,B,B,C,C,D

DP4Graph 2: a directed graph with 4 vertices and 3 arc(s)

(4)

IsReachableDP4,A,D

true

(5)

ShortestPathDP4,A,D

A,B,C,D

(6)

IsReachableDP4,D,A

false

(7)

Compatibility

• 

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