Skip to content

The very old note regarding edge head/tail assignments in undirected graphs does not appear to be accurate

Page URL

https://graphviz.org/doc/info/attrs.html#undir_note

Problem description

For as long as the gitlab history can remember (19+ years), the documentation has contained this note about the limitations of head* and tail* attributes on undirected graph edges:

Note: Some attributes, such as dir or arrowtail, are ambiguous when used in DOT with an undirected graph since the head and tail of an edge are meaningless. As a convention, the first time an undirected edge appears, the DOT parser will assign the left node as the tail node and the right node as the head. For example, the edge A -- B will have tail A and head B. It is the user's responsibility to handle such edges consistently. If the edge appears later, in the format

graph {
  B -- A [taillabel = "tail"]
}

the drawing will attach the tail label to node A. To avoid possible confusion when such attributes are required, the user is encouraged to use a directed graph. If it is important to make the graph appear undirected, this can be done using the dir, arrowtail or arrowhead attributes.

Except, that doesn't appear to be the case anymore. I tried to make it break, @steveroush tried to make it break, and we both failed.

It looks like it would be good to remove that note, plus all of the links to it from the various (un-)affected attributes' documentation.