Positioning nodes with `{rank = same ...}` Side effects

I have a graph defined as such:

digraph G { rankdir=LR node[shape=circle] q_[shape=none label=""] q3[shape=doublecircle] q4[shape=doublecircle] q_->q0 q0->q1[label="λ"] q0->q2->q4[label=a] q1->q4->q2[label=b] q1->q3[label=a] q3->q4[label="λ"] {rank=same; q4 q3} {rank=same; q1 q2} } 

The graph displays the following image:

enter image description here

You can play with the schedule here: http://graph.gafol.net/derive/effpjWfSD

My question is:

Why does q4 point to q3 on the rendered chart, and not the way I pointed it out in the markup? This is because {rank=same; q4 q3} {rank=same; q4 q3} has more meaning than just positioning nodes? If so, how can I position the nodes so that the result is not as disgusting as the output without using {rank=same; ...} {rank=same; ...} ?

+6
graphviz
source share
1 answer

In rank=same , there is no hidden meaning, this is just a mistake .

An edge is drawn correctly if, for example, there is no edge label or rankdir=LR .

You can fix this particular graph by adding the dir attribute to the incorrectly crossed out edge:

 q3->q4[label="λ", dir=back] 

This, of course, will not help with dynamic charting.

This error may be due to one of the other known errors caused by rankdir=LR , listed at http://www.graphviz.org:8080/bugs/openbugs.html

+5
source share

All Articles