# Moving arrow to the bottom of the graph using graphviz [closed]

I was trying to use graphviz to crete the following graph:

digraph G {
rankdir=TB;
size="8,5"
node [shape = circle]; 0 1 2 3 4 5
node [shape = circle];
1 -> 2 [];
2 -> 3 [];
3 -> 4 [];
4 -> 5 [];
5 -> 1 [];
0 -> 1 [];
0 -> 2 [];
0 -> 3 [];
0 -> 4 [];
0 -> 5 [];
{rank=same 5; 2; 3; 4; 1; }
}


Output:

How can I move the edge 5->1 to the bottom? So it would be something like as following:

• I’m voting to close this question because GraphViz isn't TeX-related. Feb 15, 2021 at 20:24

## 2 Answers

I cannot tell you how to steer graphwiz but such things can be done easily without this tool.

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{positioning,chains}
\begin{document}
\begin{tikzpicture}[circ/.style={draw,thick,minimum size=1cm,circle,align=center},
cc/.style={on chain,join,circ},start chain=going right,
every join/.append style={-latex,thick},
node distance=8mm,font=\sffamily]
\foreach \X in {1,...,5}
{\node[cc] (\X){\X};}
\node[above=of 3,circ] (0){0};
\foreach \X in {1,...,5}
{\draw[-latex,thick] (0) -- (\X);}
\draw[-latex,thick] (5) to[out=-135,in=-45] (1);
\end{tikzpicture}
\end{document}


Set the direction of an edge by adding :n, :ne, :e, … as the compass direction of the edge. So, replace 5 -> 1 with 5:s -> 1 as follows:

digraph G {
rankdir = TB
node [shape = circle]
1 -> 2
2 -> 3
3 -> 4
4 -> 5
5:s -> 1
0 -> 1
0 -> 2
0 -> 3
0 -> 4
0 -> 5
{rank = same 1 2 3 4 5 }
}