GraphTheory - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Discrete Mathematics : Graph Theory : GraphTheory Package : GraphTheory/IsReachable

GraphTheory

  

IsReachable

  

determine if there is a path between two vertices

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

IsReachable(G, u, v)

Parameters

G

-

graph

u, v

-

vertices of the graph

Description

• 

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.

Examples

withGraphTheory:

C6CycleGraph6

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

(1)

IsReachableC6,1,5

true

(2)

ShortestPathC6,1,5

1,6,5

(3)

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