# There are too many problems in tailport|headport attribute

**URL:** <https://forum.graphviz.org/t/there-are-too-many-problems-in-tailport-headport-attribute/1322>\
**Category:** Uncategorized\
**Created:** [September 25, 2022, 3:32pm UTC](https://forum.graphviz.org/t/there-are-too-many-problems-in-tailport-headport-attribute/1322 "2022-09-25T15:32:11Z")\
**Posts on this page:** 3\
**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:** [September 25, 2022, 3:32pm UTC](https://forum.graphviz.org/t/there-are-too-many-problems-in-tailport-headport-attribute/1322/1 "2022-09-25T15:32:12Z")

</div>

Since I knew there were `tailport` and `headport` attributes, I felt that this attribute would be difficult to deal with when faced with many extreme scenarios, so I immediately wrote down some extreme scenarios I could think of, and surprisingly, I used This property can easily create many buggy draws, like this:

```nohighlight
digraph {
    ranksep=0
    // Puzzling line segment draw.
    a:nw->b:se
    a:nw->b:se
    
    // Edge does not start from n.
    c:n->d
    
    {
        rank=same
        // Edge cross node?
        // But in the following line segments of the same type, the port is e to avoid crossing the node.
        e:se->f:ne    
    }
    
    {
        rank=max
        // The port is e to avoid crossing the node, but as above c:n->d, edges does not end from e.
        h:se->i:e
    }
    
    // Self line g:w->g:e not use port attribute, but if the order of g:w->g:e and g->g is reversed, this will work fine.
    g:w->g:e
    g->g
}

```

 ![image](https://global.discourse-cdn.com/graphviz/original/1X/f38df4174f1d7dc05f5c8db2ca8cdab6c7845601.png)

I think this must be caused by some not very good drawing strategies. Developers are tired of dealing with various scenarios. The strategies that may be used in each scenario do not have some common features, which can easily cause problems.

Supplementary scene, parallel edges missing

```nohighlight
digraph G {
    // Parallel edge missing
    a:s->b:n
    a:s->b:n
    a:se->b:ne
    a:se->b:ne
    a:sw->b:nw
    a:sw->b:nw
    a:w->b:w
    a:w->b:w
    
    c:se->d:nw
    c:se->d:nw
    // If this edge is deleted, the parallel edge is restored
    c:se->d:nw[label="hhhh"]
}

```

 ![image](https://global.discourse-cdn.com/graphviz/original/1X/339065dcbe0446b342f2d38750854f9d4cdd62fb.png)

---

<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:** [September 25, 2022, 7:22pm UTC](https://forum.graphviz.org/t/there-are-too-many-problems-in-tailport-headport-attribute/1322/2 "2022-09-25T19:22:51Z")

</div>

You might add your examples to this issue: [Improve the routing of loops and, for dot, flat edges. Complete or replace the handling of flat edges between adjacent nodes. (#2029) · Issues · graphviz / graphviz · GitLab](https://gitlab.com/graphviz/graphviz/-/issues/2029)

---

<div class="post-metadata">

**Author:** ![smattr](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/smattr/32/85_2.png) [@smattr](https://forum.graphviz.org/u/smattr)\
**Post date:** [September 25, 2022, 7:26pm UTC](https://forum.graphviz.org/t/there-are-too-many-problems-in-tailport-headport-attribute/1322/3 "2022-09-25T19:26:10Z")

</div>

I am not exactly sure what the request/question is here, but yes, [there are numerous `headport`/`tailport` bugs](https://gitlab.com/graphviz/graphviz/-/issues/?search=headport%20or%20tailport&sort=updated_desc&state=opened&first_page_size=20).
