macOS / binaries /

tsort

/usr/bin/tsort
Topological sort of a directed graph

tsort takes a list of pairs of node names representing directed arcs in a graph and prints the nodes in topological order on standard output.

source: man