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

Online Help

All Products    Maple    MapleSim


GraphTheory

  

Reachable

  

determine vertices reachable from a given vertex

 

Calling Sequence

Parameters

Options

Description

Definition

Examples

Compatibility

Calling Sequence

Reachable(G, v)

Reachable(G, v, opts)

Parameters

G

-

graph

v

-

vertex of the graph

opts

-

(optional) one or more options as specified below

Options

• 

output=one of graph or list

  

Specifies whether the result should be a list of vertices reachable from v or the subgraph induced by the vertices reachable from v. The default is list.

Description

• 

Reachable returns a list of all vertices reachable from the vertex v in the graph G.

• 

To produce an actual spanning tree of vertices reachable from v, see SpanningTree or MinimalSpanningTree.

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.

• 

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)

ReachableC6,1

1,2,3,4,5,6

(2)

GGraph5,1,2,2,3,1,4,4,5

GGraph 2: a directed graph with 5 vertices and 6 arc(s)

(3)

ReachableG,2

2,3

(4)

ReachableG,2,output=graph

Graph 3: a directed graph with 2 vertices and 1 arc(s)

(5)

Compatibility

• 

The GraphTheory[Reachable] command was introduced in Maple 2018.

• 

For more information on Maple 2018 changes, see Updates in Maple 2018.

• 

The GraphTheory[Reachable] command was updated in Maple 2022.

• 

The output option was introduced in Maple 2022.

• 

For more information on Maple 2022 changes, see Updates in Maple 2022.

See Also

IsReachable

MinimalSpanningTree

SpanningTree