Rank not being respected (Windows 2.38)

I have used rank many times and never had a problem getting the correct result but the following graph ignores it (hopefully an obvious mistake but I can't spot it). What am I doing wrong? I only see two 'columns' rather than four.

graph rank_example{

C5784 -- C5790;
C5784 -- C5787;
C5783 -- C5786;
C5783 -- C5787;
C5784 -- C5786;
C5783 -- C5790;
C5788 -- C5786;
C5789 -- C5787;
C5791 -- C5787;

{rank=same; C5790}
{rank=same; C5788 C5791 C5789}
{rank=same; C5783 C5784}
{rank=same; C5787 C5786}

rank_example.png27.03 KB

The output is correct. The

The output is correct. The rank=same attribute only says that the nodes in each group all have the same rank in the output, which they do. It doesn't say they should have distinct ranks from any other nodes. To get that, you need to add additional constraints, like minlen, or add invisible edges to force the nodes into separate ranks.

Recent comments