neel
neel

Reputation: 9061

How to set rank from left to right dotfile

Say I have four nodes a, b, c & d. And I have edges

a -> d  
b -> c  

Now if i generate graph, I get the vertices in the order a, d, b, c if I rank them same. But I want them in the order a, b, c, d. How should I set the rank ? Thanks in advance.

Upvotes: 0

Views: 335

Answers (1)

marapet
marapet

Reputation: 56466

You could use invisible edges:

a -> b[style=invis];
b -> c;
c -> d[style=invis];
a -> d[constraint=false];

Upvotes: 1

Related Questions