I am trying to make a flowchart in Latex, I want to put some of steps in a coloured box with a label, e.g. Deterministic Annealing, I added scope part but it doesn't compile with the new change.
\documentclass[useAMS,usenatbib,usegraphicx]{mn2e}
\usepackage{verbatim}
\usepackage{bm}
\usepackage{subfigure}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric,backgrounds,fit,arrows}
\tikzstyle{decision} = [diamond, draw,
text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt, minimum height=5em]
\tikzstyle{block} = [rectangle, draw,
text width=5em, text centered, rounded corners, minimum height=5em]
\tikzstyle{line} = [draw, -latex']
\tikzstyle{cloud} = [draw, ellipse, node distance=2cm,
minimum height=2em]
\begin{document}
\begin{figure}
\flushleft
\begin{tikzpicture}[node distance = 1.45cm, auto]
\tiny
% Place nodes
\node [cloud] (start) {Start};
\node [block, below of=start, node distance=1.5cm] (kde) {\tiny Apply KDE};
\node [block, below of=kde, node distance=1.5cm] (init) {\tiny Initialize $\beta = \beta_0$\\$\hat{M}= \hat{M_0}$};
\node [block, below of=init] (Centroid) {\tiny Update $\mu_c$, $\mu_{c'}$\\ $\sigma_c$,$\sigma_{c'}$\\ $\theta$};
\node [block, below of=Centroid,text width=2.8cm] (Softassign) {\tiny Update $Q_{ij}$\\$M^{0}_{ij}\leftarrow \exp(\beta Q_{ij})$};
\node [block, below of=Softassign] (slack) {\tiny Update \\$\hat{M^{1}_{ij}}$ \\ $\hat{M^{0}_{ij}}$};
\node [decision, below of=slack,text width=1.25cm] (Sinkhorn) {\tiny Convergence\\ of $\hat M$ \\ or $I > I_1$};
\node [decision, left of=Sinkhorn, node distance=2.8cm,text width=1.25cm] (Convergence of match matrix) {\tiny Convergence\\ of $M$ \\ or $I > I_0$};
\node [block, below of =Sinkhorn,text width=1.0cm,yshift=-0.5cm] (End of Deterministic Annealing) {\tiny $\beta\leftarrow \beta_r\beta$};
\node [decision, right of=End of Deterministic Annealing, node distance=2.2cm] (Deterministic Annealing) {\tiny $\beta \geq \beta_f $};
\begin{scope}
\node[rectangle,draw,minimum width=1cm][fit = (Centroid)(Softassign)(slack)(Sinkhorn)(Convergence of match matrix)(End of Deterministic Annealing)(Deterministic Annealing),fill=red!20] (DA) {};
\node [above right] at (DA.north west) { Deterministic Annealing};
\end{scope}
\begin{scope}
\node[rectangle,draw,minimum width=1cm][fit = (Softassign)(slack)(Sinkhorn)(Convergence of match matrix),fill=green!20] (SA) {};
\node [above left] at (SA.north east) { Softassign};
\end{scope}
\node [block, right of=slack, node distance=3.2cm] (SVD) {\tiny Update\\ translations\\ via SVD};
\node [decision, right of=init, node distance=3.2cm,text width=1.8cm] (Zero Points) {\tiny $\Delta C_{\gamma}\ll 1$ \\ and \\ $\Delta C_{\zeta}\ll 1$};
\node [cloud, right of=Zero Points, node distance=2.0cm] (stop) {Stop};
% Draw edges
\path [line] (start) -- (kde);
\path [line] (kde) -- (init);
\path [line] (init) -- (Centroid);
\path [line] (Centroid) -- (Softassign);
\path [line] (Softassign) -- (slack);
\path [line] (slack) -- (Sinkhorn);
\path [line] (Sinkhorn) --+(1.5,0) -- +(1.5,3) -- node {No}(slack);
\path [line] (Sinkhorn) -- node[above] {Yes} (Convergence of match matrix);
\path [line] (Convergence of match matrix) |- node[above][left] {Yes}(End of Deterministic Annealing);
\path [line] (Convergence of match matrix) |- node[above] {No}(Centroid);
\path [line] (End of Deterministic Annealing) -- (Deterministic Annealing);
\path [line] (Deterministic Annealing) |- node[above] {No}(Centroid);
\path [line] (Deterministic Annealing) -| node[above][right] {Yes}(SVD);
\path [line] (SVD) -- (Zero Points);
\path [line] (Zero Points) -- node [above]{No}(init);
% \path [line,dashed] (expert) -- (init);
\path [line] (Zero Points) -- node[above]{Yes}(stop);
\end{tikzpicture}
\caption{The heuristic colour calibration procedure flowchart. The parameters in flowchart are explained in Table \ref{tab:initial} with details.}
\label{fig:flowchart}
\end{figure}
\end{document}
What I basically want to have in my flow-chart:
1. The written labels and coloured-boxes should not overlap with each other and with lines or boxes.
2. Figure out how to make the boxes appear which are missing again.
Update:
Could somebody point out what would be my mistake?


\documentclass{...}and the required\usepackage{...}lines, and ends with\end{document}. If your code sample is immediately compilable, it is much easier for us to provide help. – eiterorm Sep 11 '14 at 13:06\usepackages are involved to makeflowchart. – Dalek Sep 11 '14 at 13:12cloud,block,lineanddecisionare undefined. Therefore the custom style definitions should be included. – eiterorm Sep 11 '14 at 13:58