Advice for graph with many inter-connects

I'm attempting to use graphviz to show dependencies between use cases that we have developed. We have around 200 use cases and most of them reference 2-5 others. There is a lot of cross-referencing. Using default settings, most of the engines give me an unreadable mess (see snippet in example, using sfdp).

I'm not sure how to make the output more usable. Some ideas are:

1. Create a separate graph for each use case just showing its dependencies
2. Find a tool that will let me dynamically show subgraphs (e.g. double click a node and only see its dependencies?)
3. Just view it as a text mode expanding tree.

Any suggestions?


graph.png188.78 KB

Try "neato -Gmodel=subset" if

Try "neato -Gmodel=subset" if the graph is not too large.

Graphviz isn't very strong on interactive tools, so I'd look at programs that came along
afterward. I would look particularly at Tim Dwyer's work on WebCola, especialyl this
demo which interactively exapnds and collapses nodes

This example in D3.js supports force directed layout with interaction to expand and collapse nodes,
but the layouts aren't as sophisticated.

You might also look at Gephi, Cytoscape, and sigma.js  as they have good interactive features.

Some graphs are just intrinsically hard to lay out because they have many edges and are
of relatively low diameter.  Work has been done on clustering nodes to relax certain edges
with the goal of getting the nodes to spread out so layouts are more readable.  Look for
"linlog" and "ForceAtlas2" layout.

Stephen North

Follow up questions

Thanks for the advice. Neato with model-subset makes it look a lot nicer, but it's still not useful for the purpose of looking at one node and seeing all of the dependencies (links).

The other (more modern) tools are all very interesting, but they introduce a bunch of tools that I don't have time to learn. I didn't see any option to pull in an existing DOT file. Are you aware of any?

Are "linlog" and "ForceAtlas2" layout engines for Graphviz? I don't see them in my list -- how do I get access?

Finally, do you (or does anyone) know of a way to tell Graphviz to render a subset of a graph? For example, a selected node along with all nth-order links?



I'm pretty sure gephi reads

I'm pretty sure gephi reads dot files. 

The main tools just layout graphs. We rely on other tools to pick subgraphs, alter attributes, etc., which can then be piped into a layout program. The most general purpose one is gvpr, which also comes with a small library of scripts. In the case for finding all nodes within n of a given node, you can run:

    gvpr -fknbhd -a'n  node-name' inputgraph.gv

Can't find knbhd

That suggestion looks great. I found the gvpr program, but where would I find the "knbhd" program it references? I don't see it anywhere in the program sub-folders.


A basic collection of gvpr

A basic collection of gvpr scripts, including knhbd, is installed in $ROOT/share/graphviz/gvpr. This path is built into gvpr, so you should just be able to run gvpr -fknbhd. If this doesn't work, you can set the environment variable GVPRPATH to a colon-separated list of directories to search. See the man page of gvpr for more details.

cytoscape has a graphviz reader, too

But gvpr -fknbhd?  really?  that's good.



Recent comments