How to control node placement in graphviz (i.e. avoid edge crossings)

jnns picture jnns · Mar 19, 2010 · Viewed 49.1k times · Source

I'm using graphviz (dot) to generate the graph you can see below. The node in the lower left corner (red ellipse) causes annoyance as its edges cross several edges of the adjacent node. Is there a way to restrain node placement to a certain area?

graph with edge crossing several other edges

Answer

smokris picture smokris · Aug 11, 2011

You could create an invisible constraint, to cause the red node to appear to the left of all other nodes.

redNode -> leftmostNode [style=invis];

Before:

before

After:

after