# The rank setting of Subgraph is affected by the cluster

**URL:** <https://forum.graphviz.org/t/the-rank-setting-of-subgraph-is-affected-by-the-cluster/1027>\
**Category:** Uncategorized\
**Created:** [February 11, 2022, 7:17am UTC](https://forum.graphviz.org/t/the-rank-setting-of-subgraph-is-affected-by-the-cluster/1027 "2022-02-11T07:17:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiangyongbing24](https://avatars.discourse-cdn.com/v4/letter/j/50afbb/32.png) [@jiangyongbing24](https://forum.graphviz.org/u/jiangyongbing24)\
**Post date:** [February 11, 2022, 7:17am UTC](https://forum.graphviz.org/t/the-rank-setting-of-subgraph-is-affected-by-the-cluster/1027/1 "2022-02-11T07:17:34Z")

</div>

Vertex j is affected by cluster and does not jump to the first level.

digraph G {  
a-\>b-\>c-\>d-\>e  
a-\>f-\>c  
a-\>g-\>h-\>i-\>j-\>e  
i-\>k-\>e  
a-\>l-\>m-\>n-\>o-\>p-\>e  
{  
rank=source  
j  
}  
subgraph cluster\_B {  
g  
}

}

---

<div class="post-metadata">

**Author:** ![steveroush](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@steveroush](https://forum.graphviz.org/u/steveroush)\
**Post date:** [February 11, 2022, 5:15pm UTC](https://forum.graphviz.org/t/the-rank-setting-of-subgraph-is-affected-by-the-cluster/1027/2 "2022-02-11T17:15:32Z")

</div>

Yes, it seems to be a bug - very different result if “cluster” is changed to “xcluster”. Please add an issue here: [Issues · graphviz / graphviz · GitLab](https://gitlab.com/graphviz/graphviz/-/issues).

---

<div class="post-metadata">

**Author:** ![scnorth](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/scnorth/32/89_2.png) [@scnorth](https://forum.graphviz.org/u/scnorth)\
**Post date:** [February 11, 2022, 11:03pm UTC](https://forum.graphviz.org/t/the-rank-setting-of-subgraph-is-affected-by-the-cluster/1027/3 "2022-02-11T23:03:53Z")

</div>

If I recall correctly, we do expect rank to refer to the rank within a cluster, but you can override with -Gclusterrank=global See [clusterrank | Graphviz](https://graphviz.org/docs/attrs/clusterrank/) although I have to admit it’s not exactly crystal clear.

---

<div class="post-metadata">

**Author:** ![Ooker](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/ooker/32/385_2.png) [@Ooker](https://forum.graphviz.org/u/Ooker)\
**Post date:** [February 18, 2022, 10:05am UTC](https://forum.graphviz.org/t/the-rank-setting-of-subgraph-is-affected-by-the-cluster/1027/4 "2022-02-18T10:05:22Z")

</div>

> [@scnorth](#):
>
> -Gclusterrank=global

does that go in the cli and not the source file?

---

<div class="post-metadata">

**Author:** ![scnorth](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/scnorth/32/89_2.png) [@scnorth](https://forum.graphviz.org/u/scnorth)\
**Post date:** [February 18, 2022, 1:11pm UTC](https://forum.graphviz.org/t/the-rank-setting-of-subgraph-is-affected-by-the-cluster/1027/5 "2022-02-18T13:11:57Z")

</div>

Either way - `-G` only on the command line, or just set the attribute in the graph body.
