Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Topological order of directed acyclic graph

`n = toposort(G)`

`n = toposort(G,'Order',algorithm)`

```
[n,H] =
toposort(___)
```

returns the topological order of the
nodes in `n`

= toposort(`G`

)`G`

such that `i < j`

for every edge
`(n(i),n(j))`

in `G`

. The directed graph
`G`

cannot have any cycles.

`digraph`

| `isdag`

| `reordernodes`