# Why does this link not show up in this graph?

**URL:** <https://forum.graphviz.org/t/why-does-this-link-not-show-up-in-this-graph/258>\
**Category:** Help\
**Created:** [July 16, 2020, 8:34pm UTC](https://forum.graphviz.org/t/why-does-this-link-not-show-up-in-this-graph/258 "2020-07-16T20:34:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![supermathie](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/supermathie/32/200_2.png) [@supermathie](https://forum.graphviz.org/u/supermathie)\
**Post date:** [July 16, 2020, 8:34pm UTC](https://forum.graphviz.org/t/why-does-this-link-not-show-up-in-this-graph/258/1 "2020-07-16T20:34:10Z")

</div>

Given the following graph:

> **definition**
>
> ```auto
> digraph {
> node [color=grey, shape=box, fontname="Helvetica", fontsize=13]
> edge [arrowsize=0.5]
> fontname="Courier"
> nodesep=0.5
> concentrate=true
> subgraph cluster_yonder {
> label="yonder"
> labeljust=l
> labelloc=t
> fontname= "Times-Bold"
> style="filled";
> fillcolor=seashell
> color=none
> margin=20
> 
> M [label="<r>x | { <c> there | <k> x }", shape=record]
> }
> subgraph cluster_pub {
> label="Public Network"
> labeljust=l
> labelloc=t
> fontname= "Times-Bold"
> style="filled";
> fillcolor=seashell
> color=none
> margin=20
> 
> HAB1 [label="<r>x | { <s>x | <c>x | <k>x }", shape=record]
>  
> }
> subgraph cluster_priv {
> label="Private Network"
> labeljust=l
> labelloc=t
> fontname= "Times-Bold"
> style="filled"
> fillcolor=seashell;
> color=none
> margin=20
> 
> HAR1 [label="<r>x | { <s>x | <c>x }", shape=record]
> 
> MA [label="<r>x | { <d>x | <m>x}", shape=record]
> SA [label="<r>x | { <d>x }", shape=record]
>     
> MPGM [label="<r>x | { <s>x | <b>x | <m>here | <l>x | <e>x }", shape=record]
> SPGM [label="<r>x | { <s>x | <b>x | <l>x | <e>x }", shape=record]
>     
> MRDM [label="<r>x | { <s>x | <e>x }", shape=record]
> SRDM [label="<r>x | { <s>x | <e>x }", shape=record]
> }
> subgraph hab {
> HAB1:s:e -> HAR1:s:n
> HAR1:s:e -> MA:d:n
> HAR1:s:e -> SA:d:n
> }
> subgraph m {
> edge [color=blue, style=dashed, penwidth=0.3, weight=0]
> HAB1:c -> M:c:n
> HAR1:c -> M:c
> MA:m -> M:c
> MPGM:m:e -> M:c
> 
> subgraph {
> edge [color=red, style=dashed, penwidth=0.3]
> HAB1:k -> M:k:e
> }
> }
> subgraph a {
> MA:d:e -> MPGM:b
> MA:d:e -> MRDM:s
> SA:d:e -> SPGM:b
> SA:d:e -> SRDM:s
> }
> subgraph d {
> MPGM:b:e -> MPGM:s:e [color=brown]
> SPGM:b:e -> SPGM:s:e [color=brown]
> }
> }
> 
> ```

why does the link from `here` to `there` not show up at all? The link in question is: ` MPGM:m:e -> M:c` in the graph definition.

digraph { node [color=grey, shape=box, fontname="Helvetica", fontsize=13] edge [arrowsize=0.5] fontname="Courier" nodesep=0.5 concentrate=true subgraph cluster\_yonder { label="yonder" labeljust=l labelloc=t fontname= "Times-Bold" style="filled"; fillcolor=seashell color=none margin=20 M [label="\<r\>x | { \<c\> there | \<k\> x }", shape=record] } subgraph cluster\_pub { label="Public Network" labeljust=l labelloc=t fontname= "Times-Bold" style="filled"; fillcolor=seashell color=none margin=20 HAB1 [label="\<r\>x | { \<s\>x | \<c\>x | \<k\>x }", shape=record] } subgraph cluster\_priv { label="Private Network" labeljust=l labelloc=t fontname= "Times-Bold" style="filled" fillcolor=seashell; color=none margin=20 HAR1 [label="\<r\>x | { \<s\>x | \<c\>x }", shape=record] MA [label="\<r\>x | { \<d\>x | \<m\>x}", shape=record] SA [label="\<r\>x | { \<d\>x }", shape=record] MPGM [label="\<r\>x | { \<s\>x | \<b\>x | \<m\>here | \<l\>x | \<e\>x }", shape=record] SPGM [label="\<r\>x | { \<s\>x | \<b\>x | \<l\>x | \<e\>x }", shape=record] MRDM [label="\<r\>x | { \<s\>x | \<e\>x }", shape=record] SRDM [label="\<r\>x | { \<s\>x | \<e\>x }", shape=record] } subgraph hab { HAB1:s:e -\> HAR1:s:n HAR1:s:e -\> MA:d:n HAR1:s:e -\> SA:d:n } subgraph m { edge [color=blue, style=dashed, penwidth=0.3, weight=0] HAB1:c -\> M:c:n HAR1:c -\> M:c MA:m -\> M:c MPGM:m:e -\> M:c subgraph { edge [color=red, style=dashed, penwidth=0.3] HAB1:k -\> M:k:e } } subgraph a { MA:d:e -\> MPGM:b MA:d:e -\> MRDM:s SA:d:e -\> SPGM:b SA:d:e -\> SRDM:s } subgraph d { MPGM:b:e -\> MPGM:s:e [color=brown] SPGM:b:e -\> SPGM:s:e [color=brown] } }

---

<div class="post-metadata">

**Author:** ![erg](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/erg/32/34_2.png) [@erg](https://forum.graphviz.org/u/erg)\
**Post date:** [July 18, 2020, 6:12pm UTC](https://forum.graphviz.org/t/why-does-this-link-not-show-up-in-this-graph/258/2 "2020-07-18T18:12:49Z")

</div>

When you run dot, you should be getting the error message:

> Warning: flat edge between adjacent nodes one of which has a record shape - replace records with HTML-like labels  
> Edge MPGM → M

There was probably some complication with trying to handle this edge using records (I can’t recall what), so it was left unimplemented with the option of using HTML-like labels.

---

<div class="post-metadata">

**Author:** ![nicemicro](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/nicemicro/32/603_2.png) [@nicemicro](https://forum.graphviz.org/u/nicemicro)\
**Post date:** [February 2, 2022, 12:53pm UTC](https://forum.graphviz.org/t/why-does-this-link-not-show-up-in-this-graph/258/3 "2022-02-02T12:53:21Z")

</div>

Hi!

Sorry for necrobumping this thread, but I felt it to be appropriate, as I encountered the exact same warning mentioned here, along with the lost edge. I could not find documentation on this error anywhere, and this is the only graphviz related website that came up searching for the error message.

So, in my case, I have started making graphs using the “record” layout to document control flow of programs. I like the record layout because of its simplicity and nice boxes.  
This error came up recently, as the graphs are getting more complex as the project I’m documenting gets more complex, too. The interesting thing is, that the edge was first there (I was building the graph up slowly but surely), and the edge that caused the error, was not the one that I was adding at the end, but one in the middle somewhere, so I guess that it must be related to how graphviz rearranges the nodes and the boxes that contain said nodes.

I’m not that of an advanced user of graphviz, I’ve just started a few moths ago and only used it for this one specific purpose, but I fail to see how changing the style from “records” to “HTML-like labels” would solve the problem as it seems to be caused by the placement of the nodes. Also, I haven’t used “HTML-like labels” before, but they seem much less elegant compared to the “record” style.

Would it be possible to avoid this error by forcing the “rank” of the nodes instead?

Thank you for the answer!

---

<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 2, 2022, 5:18pm UTC](https://forum.graphviz.org/t/why-does-this-link-not-show-up-in-this-graph/258/4 "2022-02-02T17:18:31Z")

</div>

> [@nicemicro](#):
>
> Would it be possible to avoid this error by forcing the “rank” of the nodes instead?

If you mean making sure that no record-related edges are flat (no _from_ and _to_ nodes on the same rank). Yep, that should solve the problem.  
Invisible nodes/edges and/or using the **minlen** attribute ([minlen | Graphviz](https://graphviz.org/docs/attrs/minlen/)) should help you.  
You might also look at the graph-level **TBbalance** attribute (undocumented, but see [Align rank from bottom in dot graph (#1339) · Issues · graphviz / graphviz · GitLab](https://gitlab.com/graphviz/graphviz/-/issues/1339))

It is probably not a question of the sequence of the input, but where (what rank) nodes are placed after the ranking step (see [https://www.graphviz.org/pdf/dotguide.pdf](https://www.graphviz.org/pdf/dotguide.pdf) if you want more info).

---

<div class="post-metadata">

**Author:** ![nicemicro](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/nicemicro/32/603_2.png) [@nicemicro](https://forum.graphviz.org/u/nicemicro)\
**Post date:** [February 3, 2022, 7:41am UTC](https://forum.graphviz.org/t/why-does-this-link-not-show-up-in-this-graph/258/5 "2022-02-03T07:41:41Z")

</div>

Thank you for the quick reply!

> [@steveroush](#):
>
> If you mean making sure that no record-related edges are flat (no _from_ and _to_ nodes on the same rank). Yep, that should solve the problem.

So, am I getting it right, that the “flat edge” in this context means that the edge is between two nodes that are deemed to be of the same rank? Thank you, this is helpful.

On an other note, my graphs are `rankdir="LR"`, I don’t know if that affects anything, but FWIW I tried to test all possible solutions with both LR direction and removing that line to see default behavior.

If I try to use additional nodes and edges to serve as kind of the rank “template” for my nodes, and add something like `{rank=same; f; server_game_loadMap}` to the end of my graph after the edge definitions, the nodes mentioned there become removed from the clusters and are placed on the graph by themselves, which is suboptimal.  
**GTBbalance** seemed to not have any effect on my graph.

However, using **minlen=2** actually helped, but I had to change the minlen of an other edge, not the one that was disappeared, but now that I understand what the “flat edge” means and how minlen forces the graph edges more apart, I could find out which edge I need to manipulate to achieve a state of all the edges being present.

I also took a shot to convert the nodes that don’t work to the HTML-type node as suggested by the error message, and that seemed to actually resolve the problem without forcing any of the ranks in any way. And luckily, the `TD PORT="something"` works exactly the same way as the ports work for the “record” type nodes, so I might in the end just go for the HTML-type solution, as it seems to work no matter how weird the edges are in the node structure.

Thank you again for pointing me in the right direction!
