# Arrow doesn't point to :n

**URL:** <https://forum.graphviz.org/t/arrow-doesnt-point-to-n/1188>\
**Category:** Help\
**Created:** [May 17, 2022, 6:36pm UTC](https://forum.graphviz.org/t/arrow-doesnt-point-to-n/1188 "2022-05-17T18:36:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jo-so](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@jo-so](https://forum.graphviz.org/u/jo-so)\
**Post date:** [May 17, 2022, 6:36pm UTC](https://forum.graphviz.org/t/arrow-doesnt-point-to-n/1188/1 "2022-05-17T18:36:46Z")

</div>

I’m using this code to draw a (part of a) decision diagram. But the arrow to the nodes 3 and 4 doesn’t point to the top. What am I doing wrong?

```auto
digraph {
    rankdir="TB"
    splines=ortho

    mehrst [label="2" shape=diamond]
    ohneZ [label="3" shape=diamond]
    mitZ [label="4" shape=diamond]

    mRFegal [label="b" shape=box]
    mRFwichtig [label="c" shape=box]
    oRFegal [label="d" shape=box]
    oRFwichtig [label="e" shape=box]

    {
        rank=same

        mitZ2 [label="" width=0 height=0]
        ohneZ2 [label="" width=0 height=0]

        ohneZ2 -> mehrst [headlabel="ohne Zurücklegen" arrowhead=none minlen=7]
        mehrst -> mitZ2 [taillabel="mit Zurücklegen" arrowhead=none minlen=7]
    }

    ohneZ2 -> ohneZ:n
    mitZ2 -> mitZ:n
    {
        rank=same
        oRFwichtig2 [label="" width=0 height=0]
        oRFegal2 [label="" width=0 height=0]
        mRFwichtig2 [label="" width=0 height=0]
        mRFegal2 [label="" width=0 height=0]

        oRFegal2 -> ohneZ [headlabel="Reihenfolge egal" arrowhead=none minlen=3]
        ohneZ -> oRFwichtig2 [taillabel="Rf. wichtig" arrowhead=none]

        oRFwichtig2 -> mRFegal2 [style=invis]

        mRFegal2 -> mitZ [headlabel="Rf. egal" arrowhead=none]
        mitZ -> mRFwichtig2 [taillabel="Reihenfolge wichtig" arrowhead=none minlen=3]
    }

    mRFwichtig2 -> mRFwichtig
    mRFegal2 -> mRFegal

    oRFwichtig2 -> oRFwichtig
    oRFegal2 -> oRFegal
}

```

I use `dot - graphviz version 2.43.0 (0)` and run `dot -Tsvg -o /tmp/baum.svg`.

---

<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:** [May 18, 2022, 1:20am UTC](https://forum.graphviz.org/t/arrow-doesnt-point-to-n/1188/2 "2022-05-18T01:20:35Z")

</div>

[This network graph should be trivial, but none of the Graphviz engines are really designed for flowcharts (or trees). This took some effort]  
What did you do wrong: nothing really

- **minlen** ([minlen | Graphviz](https://graphviz.org/docs/attrs/minlen/)) should not apply to nodes in the same rank, it should be a noop.
- **splines=ortho** should also be a noop, because all your edges are (supposed to be) straight line segments (more at the bottom)

“Improved” version:

- changed **splines** to _false_
- tweaked your pseudo-ortho nodes to points. Probably no real change
- added **nodesep** attribute ([nodesep | Graphviz](https://graphviz.org/docs/attrs/nodesep/)) to spread the nodes out. Optional
- used the **group** attribute ([group | Graphviz](https://graphviz.org/docs/attrs/group/)) to cause vertical edges
- rearranged the program to make it easier (for me) to read. (I barely read my native language)

(sorry, cut&paste messed up some characters)

```auto

digraph {
    rankdir="TB"
    //splines=ortho
    splines=false // not really using ortho, just straight line segments
    nodesep=.5 // optional
    // added group attributes to try to force vertical lines

    {
        rank=same
        mehrst [label="2" shape=diamond]
        node [shape=point width=.02 label=""]
        ohneZ2 [group=G1] 
        mitZ2 [group=G2] 
        // why does minlen have an impact here??????
	// minlen is supposed to set distance in units of delta rank
        ohneZ2 -> mehrst [headlabel="ohne Zur??cklegen" arrowhead=none]// minlen=7]
        mehrst -> mitZ2 [taillabel="mit Zur??cklegen" arrowhead=none]// minlen=7]
    }

    {
        rank=same
        ohneZ [label="3" shape=diamond group=G1]
        mitZ [label="4" shape=diamond group=G2]
	
        node [shape=point width=.02 label=""]
        oRFwichtig2 [group=G6]
        oRFegal2 [group=G5]
        mRFwichtig2 [group=G4]
        mRFegal2 [group=G3]

        oRFegal2 -> ohneZ [headlabel="Reihenfolge egal" arrowhead=none] // minlen=3]
        ohneZ -> oRFwichtig2 [taillabel="Rf. wichtig" arrowhead=none]

        oRFwichtig2 -> mRFegal2 [style=invis]
        mRFegal2 -> mitZ [headlabel="Rf. egal" arrowhead=none]
        mitZ -> mRFwichtig2 [taillabel="Reihenfolge wichtig" arrowhead=none] // minlen=3]
    }
 
    {rank=same
    mRFegal [label="b" shape=box group=G3]
    mRFwichtig [label="c" shape=box group=G4]
    oRFegal [label="d" shape=box group=G5]
    oRFwichtig [label="e" shape=box group=G6]
    }

    ohneZ2 -> ohneZ:n 
    mitZ2 -> mitZ:n   

    mRFwichtig2 -> mRFwichtig  
    mRFegal2 -> mRFegal       

    oRFwichtig2 -> oRFwichtig 
    oRFegal2 -> oRFegal       
}

```

Giving :  
 ![edgetoNorth2](https://global.discourse-cdn.com/graphviz/original/1X/1c82be7a0c3b7be7f5d66b38b6d29c59b8422500.png)

p.s. Here is a “true” ortho version & an ugly result:

```auto
digraph {
    rankdir="TB"
    splines=ortho

    mehrst [label="2" shape=diamond]
    {
        rank=same
        ohneZ [label="3" shape=diamond XXXgroup=G1]
        mitZ [label="4" shape=diamond XXXgroup=G2]

        ohneZ -> mitZ [style=invis]
    }
 
    {rank=same
    mRFegal [label="b" shape=box XXXgroup=G3]
    mRFwichtig [label="c" shape=box XXXgroup=G4]
    oRFegal [label="d" shape=box XXXgroup=G5]
    oRFwichtig [label="e" shape=box XXXgroup=G6]
    }

  mehrst:w-> ohneZ:n
  mehrst:e-> mitZ:n

  ohneZ:w-> oRFegal:n
  ohneZ:e-> oRFwichtig:n

  mitZ:w->mRFegal:n
  mitZ:e->mRFwichtig:n

}

```

Giving:  
 ![edgetoNorth3](https://global.discourse-cdn.com/graphviz/original/1X/729895976b0f36a5425016b5aa53a5a67e6f99ad.png)
