# draw the connect line using tikz [duplicate]

I wish to draw the picture as following:

I write the code to draw the picture, however, I don't know how to draw the line that connects the diamond to the circle.

\documentclass[tikz]{standalone}
\usepackage{tikz}
\tikzset{
my box/.style = {draw, minimum width = 2em, minimum height=1em},
}
\begin{document}
\begin{tikzpicture}[node distance=4mm]
\node[my box,align=center](s1){$S_1$};
\node[draw,circle,left = of s1](start){};
\draw[->] (start)--(s1);
\node[draw,diamond,right = of s1](end){};
\draw[->] (s1)--(end);
\end{tikzpicture
\end{document}


## marked as duplicate by zeroth, Tobi, Qrrbrbirlbel, Mensch, Claudio FiandrinoApr 7 '13 at 14:58

• This is similar to How to draw a return arrow from node-3 to node-1 Do you still need help with that? (By the way, could you complete your MWE so that it has proper libraries loaded and an existing document environment?) – Qrrbrbirlbel Apr 7 '13 at 14:11
• @sweetyBaby I’d use \draw[->] (end) -- ++(0,.5cm) -| (start) node[pos=.25,above] {$k$}; and the k sits right in the middle of the top line. See also Node on a jointed TikZ path for node placement on |-/-| paths. – Qrrbrbirlbel Apr 7 '13 at 14:53