You can use the attribute setting rank = same
I think your particular graph is arranged in two perfect lines anyway, but if it was more complex, you can see the effect.
Add two more connections.
// new complexity m1 -> m5 b3 -> b1
Now, to make the new resulting graph look better, try the following.
{ rankdir=LR ; rank=same ; m1; m2; m3; m4; m5 } { rankdir=LR ; rank=same ; b1; b2; b3 } subgraph master { m1 -> m2 -> m3 -> m4 -> m5 } subgraph branch { m2 -> b1 // branch from master b1 -> b2 -> b3 b3 -> m4 // merge into master } // new complexity m1 -> m5 b3 -> b1
user664632
source share