I'm trying to use thi powerfull library, to create a simple flow-chart.
I've seen this beautifull example
Code: Select all
http://www.texample.net/tikz/examples/flexible-flow-chart/
I would use the comfortable parameter
Code: Select all
join
Code: Select all
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,shadows}
%-----------------------------da qui
\usepackage{verbatim}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{5mm}%
%------fin qui---------------------
\tikzstyle{decision}=[draw,diamond]
\tikzstyle{line}=[draw,-latex']
\tikzstyle{elli}=[draw,ellipse]
\tikzstyle{block}=[draw,rectangle]
\begin{document}
\scriptsize\noindent
\begin{tikzpicture}[scale=0.6]
\node [elli, align=center] (dc) {Run DCOPF};
\node [decision, below of=dc, align=center, text width=4em,node distance=7em] (checkCong) {Is there any\\ congested\\ line?};
\node [block, join]] (t2) {ordinanza ingiunzione P2};
\node [block, below of=checkCong, align=center,node distance=6.5em] (Init) {$\nu=0$\\$\theta^0=\theta^{DCOPF}$};
\node [block, below of=Init, align=center,node distance=4em] (masterIni) {Run master problem\\ without considering benders cut\\ to initialize $\lambda,\,p_g,\,u$};
%--------------------------------
\node [block, right of=Init,node distance=9.5em] (pippo){io sono pippo};
%-----------------------------
\node [block, below of=masterIni, align=center,node distance=4em] (IncNu) {$\nu=\nu+1$};
\node [block, below of=IncNu,node distance=4em] (sub) {Solve subproblem};
\node [decision, below of=sub,node distance=5em, align=center] (phiCheck) {Is\\ $\phi>0$?};
\node [block, below of=phiCheck, align=center,node distance=7em] (benders) {Generate infeasibilty cuts\\ and forward it\\ to master problem};
\node [block, below of=benders,node distance=4em] (master) {Solve master problem};
\node [block, below of=master,node distance=3em] (update) {Update $\lambda^{\nu},\,p_g^{\nu},\,u^{\nu},\,\theta^{\nu}$};
\node [decision, below of=update, align=center,node distance=6em, minimum height=5mm] (convCheck) {Convergence \\ check};
\node [elli, below of=convCheck,node distance=7em] (end){end};
\node [decision, left of=end,xshift=-10em,yshift=20em,align=center] (maxIter) {Is\\ $\nu>\nu^{max}$?};
%arrows
\path [line] (dc)--(checkCong);
\path [line] (checkCong)--(Init);
\path [line] (Init)--(masterIni);
\path [line] (masterIni)--(IncNu);
\path [line] (IncNu)--(sub);
\path [line] (sub)--(phiCheck);
\path [line] (phiCheck) -- node [near start, xshift=1em] {Yes} (benders);
\path [line] (benders)--(master);
\path [line] (master)--(update);
\path [line] (update)--(convCheck);
\path [line] (convCheck)--node [near start, xshift=1em] {Yes} (end);
\path [line] (convCheck)-|node [near start, yshift=0.5em] {No}(maxIter);
\path [line] (maxIter)|-(IncNu);
\path [line] (phiCheck)--++ (3,0) node [near start, yshift=0.5em] {No} |- (convCheck);
\end{tikzpicture}
%
\begin{tikzpicture}
\usetikzlibrary{shapes,arrows,shadows}
\tikzstyle{decision}=[diamond,draw]
\tikzstyle{line}=[draw,-latex']
\tikzstyle{elli}=[draw,ellipse]
\tikzstyle{block}=[draw,rectangle]
\scriptsize
\node [block, align=center] (masterm) {Solve master problem} ;
\node [block, below of=masterm, align=center, node distance=3em] (subm) {Solve sub problem};
\node [decision, below of=subm, align=center, node distance=6em] (check) {Is there\\ infeasibility?};
\node [elli, below of=check, align=center, node distance=6em] (end) {End};
\node [block, left of=end, xshift=-8em, yshift=10em, align=center] (cut) {Generate infeasibility cut};
%arrows
\path [line] (masterm)--(subm);
\path [line] (subm)--(check);
\path [line] (check)-- node [near start, xshift=1em] {No} (end);
\path [line] (check) -| node [near start, yshift=0.5em] {Yes} (cut);
\path [line] (cut) |- (masterm);
\end{tikzpicture}
\end{document}
Do I forget some package? Or what else?

TIA
Renato