Search code examples
graphgraphvizsplines

Graphviz splines=false has no effect on undirected graph with bi-directional a -- b/b -- a edges


I am drawing an undirected graph with Graphviz that has redundant edges, (e.g. A -- B and B -- A). I would like to see only one line between the two vertices, regardless of whether there is a redundant reverse edge in the data. My question is, is there a way to do this with Graphviz, without having to use some other tool/code first to remove the redundant edges? I have tried graph [splines=false]; without any success. Below is a minimal example:

graph G {
    graph [splines=false];
    node [shape=point];
    a -- b;
    b -- a;
}

And the output:

enter image description here

What I want as output is:

enter image description here

despite the redundant edges that may exist in the specified graph.


Solution

  • Try "strict graph G { ... }"

    A strict graph or digraph disallows parallel edges.

    Stephen North [email protected]