3 ms·
I make this comment on every one of these posts, but the one I am so glad some beardie committed way back in the dim mists of time is "tsort". Sure, only the l
by jfb 16y ago
I make this comment on every one of these posts, but the one I am so glad some beardie committed way back in the dim mists of time is "tsort". Sure, only the linker really needs a topological sort, but pulling it out into a separate executable has saved my bacon on more than one occasion.
It's little gems like that that make Unix bearable.
- Monkeyget 16y agoIn what kind of situations do you use topological sort? I can't think of any scenario where I would use it leading me to think that there are problems I could solve more easily by thinking of them as graph problems.
- jfb 16y agoI've used it to drive a bunch of independent makefiles, when I didn't need an overarching makefile. I've used it to sort dependencies in a simple work queue thing I wrote in the shell. It's not generally all that useful, but being able to grab it and do a quick tsort on paired strings is significantly less painful than writing a Python or Scheme script to do it, and it fits neatly into a pipeline.
- silentbicycle 16y agoI wrote a simple (http://github.com/silentbicycle/wn http://github.com/silentbicycle/wn) to-do graph analyzer for exactly that. I got sick of analyzing "I have to do X, but X needs Y and Z, and Z needs A, and ..." dependency charts. I'm comfortable with BSD make, but sometimes clients give hairy dependency graphs.
- deleted 16y ago[deleted]