How to avoid overlapping nodes in graphviz?

Masroor picture Masroor · Nov 19, 2012 · Viewed 9.7k times · Source

I am trying to draw a graph with many nodes and edges.

However, the graph is becoming too clumsy, with nodes and edges overlapping. I tried (unsuccessfully), the following, all or combinations of these.

size = "12.0, 20.0!";
margin  = 0.0;
len = 1.0;

I am using neato to generate a png file.

The size specification did not even seem to work.

Any tips will be appreciated.

Answer

Vlad picture Vlad · Nov 19, 2012

Try using sfdp or fdp from the same graphviz package. This tools have two parameters K and repulsiveforce which control how far the nodes will be from each other.

Look here for further details