Skip to content

Instantly share code, notes, and snippets.

@hilverd
hilverd / tsort.g
Created August 13, 2012 20:50
Topological sort in Graphviz's gvpr
BEGIN {
int visited[node_t];
int visit(node_t n, edge_t e) {
if (visited[n] == 0) {
visited[n] = 1;
for (e = fstin(n); e; e = nxtin(e)) {
visit(e.tail, NULL);
}