Why does this link not show up in this graph?

Given the following 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]
  }
}

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.

cluster_yonder yonder cluster_pub Public Network cluster_priv Private Network M x there x HAB1 x x x x HAB1:c->M:n HAB1:k->M:e HAR1 x x x HAB1:e->HAR1:n HAR1:c->M:c MA x x x HAR1:e->MA:n SA x x HAR1:e->SA:n MA:m->M:c MPGM x x x here x x MA:e->MPGM:b MRDM x x x MA:e->MRDM:s SPGM x x x x x SA:e->SPGM:b SRDM x x x SA:e->SRDM:s MPGM:e->MPGM:e SPGM:e->SPGM:e

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.

1 Like

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!

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) 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)

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 if you want more info).

Thank you for the quick reply!

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!