TopologicSort - Maple Help

Online Help

All Products    Maple    MapleSim


GraphTheory

  

TopologicSort

  

compute topological order

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

TopologicSort(G)

Parameters

G

-

acyclic directed graph

Options

• 

output = one of default or permutation

  

When output=permutation, returns a list of integers representing the permutation to Vertices(G) to obtain the topological order. When output=default, a list of the actual vertices is returned.

Description

• 

The TopologicSort command returns a linear ordering of vertices of an acyclic digraph that is consistent with the arcs of the digraph.  This means a vertex u precedes a vertex v if there is an arc from u to v. The output is a list.

Examples

withGraphTheory:

DGDigrapha,b,a,d,b,d,c,a,c,b,c,d:

IsAcyclicDG

true

(1)

TopologicSortDG

c,a,b,d

(2)

Compatibility

• 

The GraphTheory[TopologicSort] command was updated in Maple 2021.

• 

The output option was introduced in Maple 2021.

• 

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

See Also

Digraph

IsAcyclic

TopologicalSort