I'm quite new to TikZ and I created the following graph:
\begin{tikzpicture}
\node[draw,circle] (n4) at (2, -3) {4};
\node[draw,circle] (n5) at (2, -4) {5};
\node[draw,circle] (n6) at (1, -5) {6};
\node[draw,circle] (n7) at (3, -5) {7};
\node[draw,circle] (n8) at (1, -6) {8};
\node[draw,circle] (n9) at (3, -6) {9};
\node[draw,circle] (n10) at (2, -7) {10};
\draw[->] (n4)--(n5) node[midway, right] {lengthy edge label 1};
\draw[->] (n5)--(n6) node[midway, left] {lengthy edge label 2};
\draw[->] (n5)--(n7) node[midway, right] {lengthy edge label 3};
\draw[->] (n6)--(n8) node[midway, left] {edge label 4};
\draw[->] (n7)--(n9) node[midway, right] {edge label 5};
\draw[->] (n9)--(n10) node[midway, right] {label 6};
\draw[->] (n8)--(n10) node[midway, left] {label 7};
\draw[->] (n10) -| +(4,0) -- +(4,0) node[midway, right] {edge label 8} |- (n4);
\end{tikzpicture}
An image of the output can be found here:
It took me quite a while for this graph to build. However, I couldn't come up with a solution for the following questions:
- Is it possible to set the path of the edge from node 10 to node 4 in such a way that it automatically bypasses the rightmost "inner" label? In the example above I have to adjust the value in
\draw
to something like+(5,0)
so that it doesn't interfere with "lengthy edge label 3", but this seems quite cumbersome if the graph changes frequently - How can I place "edge label 8" in the middle of the vertical path segment?
- Is it possible to increase the distances between the nodes without having to assign new coordinate points to each node?
Any hint is appreciated.
:)