Post #982927
2026-04-07 19:08 UTC
Replies (3)
-
@Joshua@mathstodon.xyz 2026-04-07 19:36
@MartinEscardo I don't know about topological sort itself. But when you install graphviz, you also get some utilities, like `tred` for transitive reduction and `ccomp` for connected components. Depending on the actual problem, these might be useful?
-
@benjamingeer@piaille.fr 2026-04-07 19:38
@MartinEscardo My first thought is to parse the dot file in Python using pydot, then pass it to the topological_sort function in networkx.
-
@dimpase@mathstodon.xyz 2026-04-08 03:13
@MartinEscardo Python package networkx has a convertor from the dot format to its internal format, and from the latter various other formats. It's very easy to install (not sure how well-versed you are in Python, feel free to ask for more advice) See https://networkx.org/documentation/stable/reference/readwrite/dot.html#pygraphviz