Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Graphviz: make edges not affecting the hierarchy of nodes

Tags:

graphviz

qt

I add edges (green) to graph, that makes hierarchy of nodes. How to add minor edges (red) that not affecting on the hierarchy?

enter image description here

Edit: It's Qt graphViz library.

like image 531
hoody Avatar asked Mar 31 '14 08:03

hoody


2 Answers

If you want an edge to not have an impact on ranking, you can simply set the constraint attribute to false:

If false, the edge is not used in ranking the nodes.

Example:

node1 -> node2 [constraint=false];
like image 75
marapet Avatar answered Nov 04 '22 09:11

marapet


You need {rank = same; <node names> }, e.g.

digraph G {
    a -> b
    a -> c
    c -> d
    c -> e
    a -> f
    c -> f
}

... gives:

enter image description here

... while

digraph G {
    a -> b
    a -> c
    c -> d
    c -> e
    a -> f
    c -> f
    { rank=same; c f }
}

... gives:

enter image description here

like image 42
Simon Avatar answered Nov 04 '22 09:11

Simon