Search code examples
pythondirected-acyclic-graphsgraph-tool

Can graph_tool sort nodes?


I have a DAG network and want to visualize it in python. I chose graph_tool but any other library is fine.

I could not find a way to influence a node's position else then to create connections. Is there a way to sort nodes so that I do not need to pull out the nodes out of the mess by hand?

Or are there alternative libraries which have this feature?

I use python 2.7 on a Linux machine if that matters. More importantly: I use the latest version (2.18) of graph_tool


Solution

  • Could you specify what you tried and the problem you found with the result? Your problem is not really clear to me.

    graph-tool incorporates several tools to visualize graphs: have you looked at graph_draw and at the various layout that can be used? (detailed above on the same page) If you already have an idea about where you want your nodes to be, you can also specify your own user-defined positions for them.