compute topological order
acyclic directed graph
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.
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.
DG ≔ Digraph⁡c,a,c,b,c,d,a,d,b,d,a,b:
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.
Download Help Document