I am trying to recreate (the less than pretty) figurebelow
Using the code at the bottom of the post I was able to come up with the following solution
I have some gripes with this solution, which I hope is possible to solve
- Can the three diagonal arrows (The path from A ->- C, B ->- E and D ->- F be parallel?
- I used code from the following question: TikZ: How to draw an arrow in the middle of the line? to create the arrows in the middle. However, this seems like a huge overcomplication, is there an easier solution?
- Similarly defining each node seemed unnecessary can this be done using a loop of some sort?
- Any other solutions on how to recreate the image is more than welcome.
Code
\documentclass[tikz]{standalone}
\usetikzlibrary{decorations.pathreplacing,
decorations.markings,
positioning}
\tikzset{
% style to apply some styles to each segment of a path
on each segment/.style={
decorate,
decoration={
show path construction,
moveto code={},
lineto code={
\path [#1]
(\tikzinputsegmentfirst) -- (\tikzinputsegmentlast);
},
curveto code={
\path [#1] (\tikzinputsegmentfirst)
.. controls
(\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb)
..
(\tikzinputsegmentlast);
},
closepath code={
\path [#1]
(\tikzinputsegmentfirst) -- (\tikzinputsegmentlast);
},
},
},
% style to add an arrow in the middle of a path
mid arrow/.style={postaction={decorate,decoration={
markings,
mark=at position .5 with {\arrow[#1]{stealth}}
}}},
}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{tikzpicture}[
every node/.style={draw,circle}]
\node (A) at (0,0) {$A$};
\node[label=above:{$\$\,1$},above right= of A] (B) {$B$};
\node[label=below:{$\$\,2$},below right= of A] (C) {$C$};
\node[label=above:{$\$\,2$},right= of B] (D) {$D$};
\node[label=below:{$\$\,1$},right= of C] (E) {$E$};
\node[above right= of E] (F) {$F$};
\path [draw,postaction={on each segment={mid arrow}}]
(A) -- (B)%
(A) -- (C)%
(B) -- (D)%
(B) -- (E)%
(C) -- (E)%
(D) -- (F)%
(E) -- (F)%
;
\end{tikzpicture}
\end{document}



