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

Online Help

All Products    Maple    MapleSim


GraphTheory

  

Traverse

  

traverse vertices of a graph

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

Traverse(G, t, opts)

Parameters

G

-

graph

t

-

(optional) one of breadthfirst or depthfirst; default is breadthfirst

opts

-

(optional) one or more options as specified below

Options

• 

connected=truefalse

  

Specifies whether the traversal should be of a connected component. If true, the vertices visited in the traversal are only those reachable from the starting vertex; vertices in other components are not traversed. If false, all vertices in the graph are visited. The default is false.

• 

output=one of iterator or list.

  

Specifies whether this command returns a list encoding a traversal or an Iterator which will perform the traversal when repeatedly invoked. The default is list.

• 

startvertex=a valid vertex in G

  

Specifies the starting vertex for a traversal. If not provided, a vertex is chosen by Traverse.

Description

• 

Traverse(G,t) returns a list or Iterator encoding a particular traversal of the vertices of G.

Examples

(1)

(2)

(3)

(4)

(5)

(6)

(7)

(8)

Compatibility

• 

The GraphTheory[Traverse] command was introduced in Maple 2022.

• 

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

See Also

AllPairsDistance

MinimalSpanningTree

ShortestPath

SpanningTree

 


Download Help Document