Search code examples
graphvizdot

How to draw a graph with no overlapping edges (planar graphs) or nodes in DOT language


I am using the playground at

https://visjs.github.io/vis-network/examples/network/data/dotLanguage/dotPlayground.html

and I am trying to create a simple graph

digraph SimpleGraph {
3->6;
6->1;
1->5;
1->7;
7->2;
5->4;
6->3;
1->3;
5->1;
7->6;
2->5;
4->5;
3->7;
5->3;
4->1;
6->7;
7->5;
3->4;
overlap=false
fontsize=12;
}

The graph I get has lot of nodes very close to each other and it is becoming difficult to see the arcs properly

Simple Graph Network

I want the arcs to be straight and clearly visible without any significant overlap


Solution

  • This is not possible. I cannot find the online source now, but I remember long ago wanting to create a planar graph (one in which the edges don't overlap)... and found an old ticket in the GraphViz project where they were discussing the feature. It was clear that this was an aging request that had been on hold for a long, long time.

    Now, you can affect the distance between nodes, as I demonstrate in this answer. You might thy some of the ideas there to see if it can help your presentation.