Method code for $graph.topological_sort()

[Turn on line numbering]
arg list, comparator;
var i, j;

i = list.length();
while (i >= 1) {
    j = 2;
    while (j <= i) {
        if (list[j - 1].(comparator)(list[j]))
            list = list.swap(j - 1, j);
        refresh();
        j++;
    }
    i--;
}
return list;

["// Created 23-Nov-1996 as a part of ColdCore, see: @help Credit"]

the Cold Dark