4 ms·
Very nice. I just solved it with GraphViz: https://gist.github.com/mLuby/d184c08c507fa03292c72acb38a146ff https://gist.github.com/mLuby/d184c08c507fa03292c72acb
by mLuby 4y ago
Very nice. I just solved it with GraphViz: https://gist.github.com/mLuby/d184c08c507fa03292c72acb38a146ff https://gist.github.com/mLuby/d184c08c507fa03292c72acb38a146...
- Jtsummers 4y agoFYI, you can abbreviate some of that: Vixen -> Rudolph; Vixen -> Prancer; Vixen -> Dasher; Is equivalent to: Vixen -> {Rudolph Prancer Dasher} You can also do: {Comet Dancer} -> Vixen -> {Rudolph Prancer Dasher} Very nice when dealing with larger graphs.
- mLuby 4y agoOh cool, didn't know it could do that so easily. GraphViz is really something.
- Jtsummers 4y agoI spent a lot of time with it a few years back developing some documentation. I had actually forgotten the correct syntax and had to look it up. It was a lot of fun to use, though. I should probably brush up on it a bit and maybe use it for some crap we have at work that's incomprehensible ("What calls what again? Does anyone know? And it's a bespoke language so there is no tooling to help? Shit.")
- _xgw 4y agoThat's super interesting! I like how straightforward the solution is. The problem almost fades away! :)
- tkanarsky 4y agoThat's because fundamentally it's a topological sort problem, and it seems like graphviz sorts the nodes appropriately before drawing the digraph.