I want to separate the flowchart into phases by adding the red items. Any idea how to do it?
This is the code for my current flowchart.
\documentclass{article}
\usepackage{tikz,tkz-berge,tkz-graph}
\usetikzlibrary{graphs, graphs.standard, shapes.geometric, arrows, decorations.pathreplacing, positioning, quotes}
\begin{document}
\begin{figure}[htbp!]
\centering
\begin{tikzpicture}
\tikzstyle{rectlong} = [draw,rectangle,fill=white!20,text width=10em,text centered,minimum height=1.75em]
\tikzstyle{rectshort} = [draw,rectangle,fill=white!20,text width=5em,text centered,minimum height=1.75em]
\tikzstyle{rectultralong} = [draw,rectangle,fill=white!20,text width=19.5em,text centered,minimum height=1.75em]
\tikzstyle{rectmed} = [draw,rectangle,fill=white!20,text width=15em,text centered,minimum height=1.75em]
\node[rectlong,rounded corners](A){\small User input};
\node[rectlong,rounded corners,below left=0.75cm and 1.2cm of A](B){\small terrain map};
\node[rectlong,rounded corners,below=0.5cm of B](E){\small vertex-weighted grid graph $G$};
\node[rectshort,rounded corners,below=1.5cm of E](G){\small $c^2=\left[\ldots\right]$};
\node[rectshort,rounded corners,left=0.5cm of G](F){\small $c^1=\left[\ldots\right]$};
\node[rectshort,rounded corners,right=0.5cm of G](H){\small $c^3=\left[\ldots\right]$};
\node[rectshort,rounded corners,below=0.5cm of G](J){\small $\hat{c}^2=\left[\ldots\right]$};
\node[rectshort,rounded corners,left=0.5cm of J](I){\small $\hat{c}^1=\left[\ldots\right]$};
\node[rectshort,rounded corners,right=0.5cm of J](K){\small $\hat{c}^3=\left[\ldots\right]$};
\node[rectshort,rounded corners,right=0.5cm of K](C){\small $\mathbf{w}=(w_1,w_2,w_3)$};
\node[rectlong,rounded corners,below=1.2cm of K](L){\small grid graph with weighted sum cost $G'$};
\node[rectshort,rounded corners,right =2.5cm of L](D){\small $\Lambda=\langle v_s,\ldots,v_t\rangle$};
\node[rectmed,rounded corners,below =10cm of A](M){\small Complete graph $K_{n+2}$};
\node[rectmed,rounded corners,below =1cm of M](N){\small Best complete graph $\pi_{st}^*$};
\node[rectmed,rounded corners,below =1cm of N](O){\small Improved best $\pi_{st}^*$};
\node[rectmed,rounded corners,below =1cm of O](P){\small List of Pareto Optimal $\pi_{st}^*$ corresponds to different $\mathbf{w}$};
\node[draw, diamond,aspect=4.5,below=0.5cm of P,align=center](Q){\small User provide limit\\\small constraints?};
\node[rectshort,rounded corners,below left=0.5cm and 1.5cm of Q](R){\small $\varepsilon$-constraint method};
\node[rectshort,rounded corners,below right=0.5cm and 1.5cm of Q](S){\small Ideal point method};
\node[rectlong,rounded corners,below=1.5cm of Q](T){\small Final solution for user};
%simple arrow
\foreach \x/\y in {A/C, B/E, P/Q} \draw[->,thick](\x)--(\y);
%bended arrow
\foreach \from/\height/\to in {A.south/-4/B.north, A.south/-4/D.north, E.south/-12/F.north, E.south/-12/H.north, C.south/-4/L.north, I.south/-5.3/L.north, J.south/-5.3/L.north, D.south/-4/M.north, R.south/-2/T.north, S.south/-2/T.north}
\draw[->,thick](\from) |- ++(0,\height mm) -| (\to);
%bended labelled arrow
\draw[->,thick] (L.south) |- ++(0,-4.1mm) -| (M.north) node[right,pos=0.75,align=left] {\footnotesize perform Dijkstra's or A* \\\footnotesize algorithm $\forall v_i,v_j\in\Lambda$};
\draw[->,thick] (Q.west) |- ++(0,0mm) -| (R.north) node[above, pos=0.25] {\footnotesize yes};
\draw[->,thick] (Q.east) |- ++(0,0mm) -| (S.north) node[above, pos=0.25] {\footnotesize no};
%labelled arrow
\draw[->,thick](E)--(G)node[right,pos=0.35,align=left]{\footnotesize extracting data for\\\footnotesize each attributes};
\draw[->,thick](F)--(I)node[right,midway]{\footnotesize normalize};
\draw[->,thick](G)--(J)node[right,midway]{\footnotesize normalize};
\draw[->,thick](H)--(K)node[right,midway]{\footnotesize normalize};
\draw[->,thick](K)--(L)node[right,pos=0.75]{\footnotesize weighting method};
\draw[->,thick](M)--(N)node[right,midway]{\footnotesize perform RNNA $\forall v_i\in\Lambda$};
\draw[->,thick](N)--(O)node[right,midway]{\footnotesize perform 2-opt};
\draw[->,thick,dashed](O)--(P)node[right,midway]{\footnotesize repeat using different $\mathbf{w}$};
\end{tikzpicture}
\caption{Solution Scheme 1}
\end{figure}
\end{document}

\tikzstyle, use\tikzsetinstead, see: https://tex.stackexchange.com/questions/52372/should-tikzset-or-tikzstyle-be-used-to-define-tikz-styles – CarLaTeX Jun 01 '19 at 09:13\tikzstyleas well (for the sake of best practices). Thanks for pointing that out. I will edit my post. – erik Jun 01 '19 at 14:16