Rank attribute is confusing to me

后端 未结 1 892
忘了有多久
忘了有多久 2021-02-02 07:57

Rank attribute on edge has five values \"same\", \"min\", \"source\", \"max\", \"sink\". Except \"same\", I have no idea when to use other values.

min
\\begin{do         


        
相关标签:
1条回答
  • 2021-02-02 08:26

    Leaving the rank empty or using rank=same are used far more often. These other four are usually only used in special circumstances.

    When used alone, min and source have the same function: putting all those nodes on the minimum rank (the top row of a TB graph). The difference between them is that min will allow other subgraphs in the minimum rank. Source will not. Source only allows other subgraphs of min or source to be on the minimum rank.

    Consider the following graph snippet:

    { rank=source; a -> b; }
    { rank=same;   c -> d; }
    

    You will end up with 2 rows. a -> b will be above c -> d.


    If you change source to min, you will only get one row. a -> b will be to left of c -> d, all in the min rank.

    { rank=min;    a -> b; }
    { rank=same;   c -> d; }
    

    Max and sink are the equivalents for the bottom of the graph.

    0 讨论(0)
提交回复
热议问题