+\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);
+ },
+ 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}}
+ }}},
+}
+ \begin{center}\begin{tikzpicture}[scale=1.8]