topsort function

(Shortest import: from brian2.utils.topsort import topsort)

brian2.utils.topsort.topsort(graph)[source]

Topologically sort a graph

The graph should be of the form {node: [list of nodes], ...}.

Uses graphlib.TopologicalSorter.