# Curved edges in flow diagram

I used TikZ package to create the flow chart as in the figure on the left (the code I used is below). I would like to add to the curved edges flow diagram and loops so that it was as in the right figure.

My codes.

\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{calc,trees,positioning,arrows,chains,shapes.geometric,
decorations.pathreplacing,decorations.pathmorphing,shapes,
matrix,shapes.symbols}
\usepackage{array}
\usepackage{amsmath}
\usepackage{amsxtra}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}
\begin{center}
\tikzstyle{decision} = [diamond, draw, fill=blue!20,text width=6.5em, text badly centered, node distance=5cm, inner sep=0pt]
\tikzstyle{block}    = [rectangle,fill=blue!20, text width=8em, text centered, rounded corners, minimum height=4em]
\tikzstyle{line}     = [draw, -latex']
\tikzstyle{arco}     = [draw,->]
\tikzstyle{cloud}    = [draw, circle,fill=red!20, node distance=4cm,minimum height=4em]
\tikzstyle{pil}      = [->,thick,shorten <=2pt, shorten >=2pt]
\begin{tikzpicture}[node distance = 2cm, auto]
% Place nodes
\node [block]
(12)
{1nialize model};
\node [block, left of=12, node distance=6cm]
(11) {\\ Probability spaces \\ $(\mathbb{R},\mathcal{B}(\mathbb{R}),\mathbb{P})$\\ };
\node [cloud, right of=12]
(13)
{coments};
\node [block, below of=12]
(22)
{verify candidate models};
\node [block, below of=22]
(32) {rum candidate models};
\node [block, left of=32, node distance=6cm]
(31) {update model};
\node [decision, below of=32]
(decide) {is best candidate better?};
\node [block, below of=decide, node distance=6cm]
(stop) {stop};
% Draw edges
\path [line]          (12)     -- (22);
\path [line]          (13)   -- (22);
\path [line]          (22) -- (32);
\path [line]          (32) -- (decide);
\path [line]          (decide)   -| node [near start] {yes} (31);
\path [line]          (31)   |- (22);
\path [line]          (decide)   -- node {no}(stop);
\path [line]          (11)   -- (12);
\path [arco]          (13)   -- (12);
\path [arco]          (13)   |- (32);
\path [arco]          (13)   -- (stop);
\end{tikzpicture}
\end{center}
\end{document}

• Look up the to paths: options out and in as well as loop right. – Qrrbrbirlbel May 29 '16 at 1:21
• Just bend left or bend right to paths would be enough for some of that. – cfr May 29 '16 at 2:05

\draw [very thick,->] (13) to [out=-90,in=0] (32);
\draw [very thick,->] (13) to [out=-90,in=45] (decide.east);
\draw [very thick,->] (13) to [out=-90,in=60] (stop.east);
\draw [very thick,->] (13) edge[loop right] (13);


\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{calc,trees,positioning,arrows,chains,shapes.geometric,
decorations.pathreplacing,decorations.pathmorphing,shapes,
matrix,shapes.symbols}
\usepackage{array}
\usepackage{amsmath}
\usepackage{amsxtra}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}
\begin{center}
\tikzstyle{decision} = [diamond, draw, fill=blue!20,text width=6.5em, text badly centered, node distance=5cm, inner sep=0pt]
\tikzstyle{block}    = [rectangle,fill=blue!20, text width=8em, text centered, rounded corners, minimum height=4em]
\tikzstyle{line}     = [draw, -latex']
\tikzstyle{arco}     = [draw,->]
\tikzstyle{cloud}    = [draw, circle,fill=red!20, node distance=4cm,minimum height=4em]
\tikzstyle{pil}      = [->,thick,shorten <=2pt, shorten >=2pt]
\begin{tikzpicture}[node distance = 2cm, auto]
% Place nodes
\node [block] (12) {1nialize model};
\node [block, left of=12, node distance=6cm] (11) {\\ Probability spaces \\ $(\mathbb{R},\mathcal{B}(\mathbb{R}),\mathbb{P})$\\ };
\node [cloud, right of=12] (13) {coments};
\node [block, below of=12] (22) {verify candidate models};
\node [block, below of=22] (32) {rum candidate models};
\node [block, left of=32, node distance=6cm] (31) {update model};
\node [decision, below of=32] (decide) {is best candidate better?};
\node [block, below of=decide, node distance=6cm] (stop) {stop};
% Draw edges
\path [line]          (12)     -- (22);
\path [line]          (13)   -- (22);
\path [line]          (22) -- (32);
\path [line]          (32) -- (decide);
\path [line]          (decide)   -| node [near start] {yes} (31);
\path [line]          (31)   |- (22);
\path [line]          (decide)   -- node {no}(stop);
\path [line]          (11)   -- (12);
\path [arco]          (13)   -- (12);
\path [arco]          (13)   |- (32);
%\draw [red] (13) .. controls (13 |- 32) .. (32);
\draw [very thick,->] (13) to [out=-90,in=0] (32);
\draw [very thick,->] (13) to [out=-90,in=45] (decide.east);
\draw [very thick,->] (13) to [out=-90,in=60] (stop.east);
\draw [very thick,->] (13) edge[loop right] (13);
\path [arco]          (13)   -- (stop);
\end{tikzpicture}
\end{center}
\end{document}