Search code examples
graphvizdot

Is there a way to calculate how long a dot graph will take in graphviz?


Is there any way to calculate how long a dot graph will likely take to render?

I am currently running with 25,000 nodes and 42,000 edges. It's taking some hours and I'd like to know if to give up or get an estimated time when it completes.


Solution

  • Short answer: nope.
    Longer answer: There are things you can do to better understand what dot is doing and make it run faster.

    • Adding -v4 (https://www.graphviz.org/doc/info/command.html#-v) to the command line will (help) show progress (not well documented) (4 is arbitrary)
    • There are 5 or more attributes that you can use to improve performance (mclimit, nslimit, nslimit1, remincross and searchsize) (again, not well documented) As a guess, try setting nslimit and nslimit1 both to 2.

    Here are some links to more performance info:

    25,000 nodes is a fair number of nodes, but 42,000 edges is not that many edges/node
    With that many nodes, you might also try some of the other Graphviz engines (neato, fdp, circo, twopi) Often, one or more will run much faster.