Closed dominikbraun closed 1 year ago
You put this together rather quickly, didn't you? 😄
You put this together rather quickly, didn't you? 😄
Absolutely! 😀
Quite frankly, I'm not aware of all the use cases and end-user requirements of the topological sort.
In my case, I do not care about the stable sort
part 🤣 . Unstability is OK.
But I do care about which nodes belong to which layer (#125).
Something like:
layers := TopologicalSortWithLayer()
// layers[0]
// []int{1, 2, 3, 4, 5, 6}
// layers[1]
// []int{10, 20, 30, 40, 50, 60}
Quite frankly, I'm not aware of all the use cases and end-user requirements of the topological sort.
In my case, I do not care about the
stable sort
part 🤣 . Unstability is OK. But I do care about which nodes belong to which layer (#125).Something like:
layers := TopologicalSortWithLayer() // layers[0] // []int{1, 2, 3, 4, 5, 6} // layers[1] // []int{10, 20, 30, 40, 50, 60}
@williamfzc Ok. "Layer stability" is guaranteed by design, so that's alright.
Thanks again @dominikbraun ; really nicely done. I will pull it into projects as soon as 0.22.0 is cut (I saw you did the prep commit)
Closes #61.
CC @deitch, @williamfzc, @geoah