Difficulty with multi-source, multi-sink DAG rendering

Hello, I have a graph with the following properties,

  • directed
  • acyclic
  • multiple sources
  • multiple sinks
  • disconnected
  • 800+ nodes
  • 2,700+ edges

I know for a fact that the graph does not have an upward planar drawing (or any planar drawing at all).

I’ve been trying to render the graph while making it as “human-friendly” as possible.
However, I haven’t had much luck.

My only hard requirement is that the drawing is “hierarchical” (sources top, sinks bottom).

Here is a link to the graph I am working with (a DOT file),
https://pastebin.com/53BwP81u (2.7k edges)
https://pastebin.com/uep88G7h (1.5k edges)

I tried a bunch of different self-made techniques, and some libraries I found online. I’ve also tried Graphviz and can’t seem to get output I’m happy with.

The Graphviz command I’m using is, dot -Kdot input_file

When outputting a png file, I get an image that is 32767x4213 in dimension!
The graph is also messy:
https://imgur.com/MOtk8ZK (2.7k edges)
https://imgur.com/v2QJ0FB (1.5k edges)

Does anyone here have any advice for me? Or is it just plain impossible?

  1. When running your experiments, if you produce an SVG output file, it is easier to zoom in and figure out what you are looking at.
  2. Adding these three lines to your graph will make it “better” (to my eyes) (but not great) :
    splines=polyline // better in some ways, worse in others,
    ranksep=2 // distance between one rank and the next (inches)
    nodesep=1 // distance between nodes in same rank (inches)
  3. The basic problem seems to be that some of the generated ranks (rows) are too “busy” (too many edges). Off-the-top, I don’t know any way to split up ranks with too many edges, hmmm
  4. neato and fdp kind-of finesse the “busy” problem, but they don’t maintain top-to-bottom hierarchy.