3 ms·
I just discovered graphlib.TopologicalSorter the other day. Nice! When you need it, you need it. It's nice not to have to implement it oneself.
by dairiki 2y ago
I just discovered graphlib.TopologicalSorter the other day.
Nice! When you need it, you need it. It's nice not to have to implement it oneself.
- crabbone 2y agoOnce I found myself needing to sort something topologically... and the interface to this sorter is so bad that you cannot really retrofit any kind of graph data to make it work with the sorter. So, it's kinda worthless, unless you specifically design your graph to be sorted with this sorter. Also, topological sort is like five lines of code... so, it doesn't matter if the function is there.
- halfcat 2y agoIs this because graphlib.TopologicalSorter is “backwards” in the sense that it takes a dependency graph instead of an adjacency list? Or what didn’t you like about it?