abcxyz / abc

Apache License 2.0
12 stars 3 forks source link

Add topological sort #575

Closed drevell closed 5 months ago

drevell commented 5 months ago

We'll use this in an upcoming PR for sorting the dependency graph of template installations, which matters when a template outputs another template.

Ideally we wouldn't write this ourselves, but the main graph library seems to be gonum and it just defines interfaces that we have to implement ourselves, at the cost of lots of boilerplate (example). We can do the algorithm ourselves easily.