# Arrowtail and arrowhead with same rank?

**URL:** https://forum.graphviz.org/t/arrowtail-and-arrowhead-with-same-rank/1574
**Category:** Help
**Created:** [April 17, 2023, 8:56am UTC](https://forum.graphviz.org/t/arrowtail-and-arrowhead-with-same-rank/1574 "2023-04-17T08:56:46Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![wil](https://avatars.discourse-cdn.com/v4/letter/w/59ef9b/32.png) [@wil](https://forum.graphviz.org/u/wil)
#### Post date: [April 17, 2023, 8:56am UTC](https://forum.graphviz.org/t/arrowtail-and-arrowhead-with-same-rank/1574/1 "2023-04-17T08:56:47Z")

</div>

Arrowhead and arrowtail work fine when I make a LR rank :

 ![image](https://global.discourse-cdn.com/graphviz/original/2X/b/b76791813ec48f968274c3b97899f7d15e69c2c7.png)

```
nodesep = 2; /* increase distance between nodes */
{ rank = lr; set1 set2 }
   set1:1 -> set2:1 [dir=both, arrowtail=tee, arrowhead=crow label="1:n" fontname = "Arial"];
}

```

How can I have arrowtail and arrowhead with same rank ? It doesnt work for me…

```
nodesep = 2; /* increase distance between nodes */
{ rank = same; set1 set2 }
   set1:1 -> set2:1 [dir=both, arrowtail=tee, arrowhead=crow label="1:n" fontname = "Arial"];
}

```

![image](https://global.discourse-cdn.com/graphviz/original/2X/e/e3d833807e6070b792d3fee3f26ce074ea9718ec.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: [April 17, 2023, 1:58pm UTC](https://forum.graphviz.org/t/arrowtail-and-arrowhead-with-same-rank/1574/2 "2023-04-17T13:58:46Z")

</div>

Please include a complete input file (reduced to a minimum that causes the problem, if possible). In particular, it is important to see how **set1** & **set2** are defined.  
Also, please include any error and warning messages from **dot**

---

<div class="post-metadata">

### Author: ![wil](https://avatars.discourse-cdn.com/v4/letter/w/59ef9b/32.png) [@wil](https://forum.graphviz.org/u/wil)
#### Post date: [April 18, 2023, 5:42am UTC](https://forum.graphviz.org/t/arrowtail-and-arrowhead-with-same-rank/1574/3 "2023-04-18T05:42:35Z")

</div>

Here is the full code. when I change `rank=same` to `rank=LR` eveything works fine…but it’s not what I want. (I want the tables side by side). There is no error.

```
digraph G  
{
 node[shape = none, fontname = "Arial" fontsize =14];

set1[ label=<
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
      <TR>
        <TD colspan="1" align="center">Entité 1</TD>
    </TR>
    <TR>
        <TD PORT="1">Attribut<BR/>Attribut<BR/>Attribut<BR/>...</TD>
    </TR>

</TABLE>>];

set2[ label=<
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
    <TR>
        <TD colspan="1" align="center">Entité 2</TD>
    </TR>
    <TR>
        <TD PORT="1">Attribut<BR/>Attribut<BR/>Attribut<BR/>...</TD>
    </TR>
   
 
 
</TABLE>>];    

# layout
nodesep = 2; /* increase distance between nodes */
{ rank = same; set1 set2 }
   set1:1 -> set2:1 [dir=both arrowtail=tee arrowhead=crow label="1:n" fontname = "Arial"];

```

}

---

<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: [April 18, 2023, 12:09pm UTC](https://forum.graphviz.org/t/arrowtail-and-arrowhead-with-same-rank/1574/4 "2023-04-18T12:09:59Z")

</div>

Unfortunately, you have encountered a known bug ([When using HTML table and port, arrows are sometimes misplaced (#1357) · Issues · graphviz / graphviz · GitLab](https://gitlab.com/graphviz/graphviz/-/issues/1357)).  
A fairly painless(?) work-around is to replace the single two-headed edge with two single-direction edges, like so:

```auto
digraph G  
{
 node[shape = none, fontname = "Arial" fontsize =14];

set1[ label=<
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
      <TR>
        <TD colspan="1" align="center">Entité 1</TD>
    </TR>
    <TR>
        <TD PORT="1">Attribut<BR/>Attribut<BR/>Attribut<BR/>...</TD>
    </TR>
</TABLE>>];

set2[ label=<
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
    <TR>
        <TD colspan="1" align="center">Entité 2</TD>
    </TR>
    <TR>
        <TD PORT="1">Attribut<BR/>Attribut<BR/>Attribut<BR/>...</TD>
    </TR>
</TABLE>>];    

# layout
nodesep = 2; /* increase distance between nodes */
{ rank = same; set1 set2 }
   //set1:1 -> set2:1 [Xdir=both arrowtail=tee arrowhead=crow xlabel="1:n" fontname = "Arial"];
 // replace two-headed edge with two simpler edges
 set1:1 -> set2:1 [arrowhead=crow xlabel="1:n" fontname = "Arial"];
 set2:1 -> set1:1 [arrowhead=tee]
}

```

Giving:  
 ![sideBySide1](https://global.discourse-cdn.com/graphviz/original/2X/5/54133480e4fe2aab0deebc76c081608ac6a63441.png)
