How can I make an arrow first go right then up and then to the left, if two nodes above/below each other in a vertical line. (The direct vertical line down is already used, which is why I want the arrow to go right, up and then left).
Like this:
My code:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows}
\tikzstyle{startstop} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=blue!30]
\tikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=3cm, minimum height=1cm, text centered, draw=black]
\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=black]
\tikzstyle{decision} = [diamond, minimum width=3cm, minimum height=1cm, text centered, draw=black]
\tikzstyle{arrow} = [thick,->,>=stealth]
%
\begin{document}
\centering
\begin{tikzpicture}[node distance=5cm]
\node (start) [startstop] {Filling a cup with water};
\node (p1) [process, below of=start] {Walk to the kitchen.};
\draw [arrow] (start) -- (p1);
\node (d1) [decision, below of=p1, yshift=1cm] {In front of correct cupboard?};
\node (p2) [process, right of=d1] {Walk to correct one.};
\node (p3) [process, below of=d1] {Grab a glas.};
\draw[arrow](p1) -- (d1);
\draw [arrow] (d1) -- node [anchor=south] {no} (p2);
\draw [arrow] (d1) -- node [anchor=west] {yes} (p3);
\node (d2) [decision, below of=p2] {In front of correct one?};
\draw [arrow] (d2) -- node [anchor=south]{yes}(p3);
\draw [arrow] (d2) node [anchor=west] {no} (p2);
\draw[arrow] (p2) -- (d2);
\end{tikzpicture}
\end{document}




