% -*- mode: latex; auto-revert-interval: 0.5 -*- \begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto, node distance=2.5em, very thin,font={\scriptsize\bf}] \pgfdeclarelayer{background} \pgfdeclarelayer{foreground} \pgfsetlayers{background,main,foreground} \tikzstyle{basic-block} = [draw=black!50, fill=white, rectangle, minimum width=6em, minimum height=1.3em] \ifthenelse{\boolean{preview}} {\tikzstyle{block} = [basic-block]} {\tikzstyle{block} = [basic-block, drop shadow]} \tikzstyle{enter} = [block, ellipse, fill=red!20] \tikzstyle{guard} = [block, fill=yellow!20] \tikzstyle{newguard} = [block, fill=green!20] \tikzstyle{lbl} = [font={\scriptsize\it}, minimum width=0em] \clip (-1.9, 1.05) rectangle (6.7,-6.9); % main loop \node[enter, name=loop0] {loop 1} ; \node[guard, name=loop1, below of=loop0] {...} ; \node[guard, name=loop2, below of=loop1] {...} ; \path (loop0.south) edge (loop1.north) ; \path (loop1.south) edge (loop2.north) ; \path (loop2.south) edge[distance=9em, out=230, in=130] (loop0.north) ; % exit bridge 1 \node[newguard, name=exit0, right=1.5em of loop2, fill=black!10] {exit bridge}; % other loop \node[enter, name=other0, below left=3em and -2em of exit0] {loop 2} ; \node[guard, name=other1, below of=other0] {...} ; \node[guard, name=other2, below of=other1] {...} ; \path (other0.south) edge (other1.north) ; \path (other1.south) edge (other2.north) ; \path (other2.south) edge[distance=9em, out=230, in=130] (other0.north) ; \path (loop1.south east) edge (exit0.north) ; \path (exit0.south) edge[out=270, in=90] (other0.north) ; % exit bridge 2 \node[newguard, name=exit1, right=1.5em of other2, fill=black!10] {exit bridge}; \path (other1.south east) edge (exit1.north) ; \path (exit1.south) edge[out distance=15em, in distance=12em, out=320, in=50] (loop0.north) ; \end{tikzpicture}