GraphTheory
Reachable
determine vertices reachable from a given vertex
Calling Sequence
Parameters
Options
Description
Definition
Examples
Compatibility
Reachable(G, v)
Reachable(G, v, opts)
G
-
graph
v
vertex of the graph
opts
(optional) one or more options as specified below
distance=integer or infinity
Specifies that the output should be limited to vertices reachable from v in the specified number of steps. Default is infinity.
output=one of graph, list, or set
Specifies whether the result should be a list or set of vertices reachable from v, or the subgraph induced by the vertices reachable from v. The default is list.
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.
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.
withGraphTheory:
C6≔CycleGraph6
C6≔Graph 1: an undirected graph with 6 vertices and 6 edges
ReachableC6,1
1,2,3,4,5,6
G≔Graph5,1,2,2,3,1,4,4,5
G≔Graph 2: a directed graph with 5 vertices and 6 arcs
ReachableG,2
2,3
ReachableG,2,output=graph
Graph 3: a directed graph with 2 vertices and 1 arc
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.
The GraphTheory[Reachable] command was updated in Maple 2025.
The distance option was introduced in Maple 2025.
For more information on Maple 2025 changes, see Updates in Maple 2025.
See Also
Ancestors
IsReachable
MinimalSpanningTree
SpanningTree
Download Help Document