I have to write a flow chart given by figure below
I have used the packages,
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
But I couldn't get what I want. I hope some LaTeX experts here can help me with this.
Other option is using algorithm2e
package, Is that possible to have both codes?
When I use the half commands it goes to other page? How to I write complete flow chart in one page ?
\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{matrix,shapes,arrows,positioning,chains}
\begin{document}
% Define block styles
\tikzset{
decision/.style={
diamond,
draw,
text width=4em,
text badly centered,
inner sep=0pt
},
block/.style={
rectangle,
draw,
text width=10em,
text centered,
rounded corners
},
cloud/.style={
draw,
ellipse,
minimum height=2em
},
descr/.style={
fill=white,
inner sep=2.5pt
},
connector/.style={
-latex,
font=\scriptsize
},
rectangle connector/.style={
connector,
to path={(\tikztostart) -- ++(#1,0pt) \tikztonodes |- (\tikztotarget) },
pos=0.5
},
rectangle connector/.default=-2cm,
straight connector/.style={
connector,
to path=--(\tikztotarget) \tikztonodes
}
}
\begin{tikzpicture}
\matrix (m)[matrix of nodes, column sep=2cm,row sep=8mm, align=center, nodes={rectangle,draw, anchor=center} ]{
|[block]| {Start}; & \\
|[block]| {Assume that $a=c$ the optimilalty cretierin given by } & \\
|[decision]| {Locally optimal} & \\
|[block]| {Assume that $a=d$ the optimilalty cretierin given by} & \\
|[decision]| {Locally optimal} & \\
|[block]| {Assume that $a=e$ the optimilalty cretierin given by} & \\
|[decision]| {Locally optimal} & \\
|[block]| {Assume that $a=f$ the optimilalty cretierin given by} & \\
|[decision]| {Locally optimal} & \\
|[block]| {Assume that $a=k$ the optimilalty cretierin given by} & \\
|[decision]| {Locally optimal} & \\
|[block]| {Stop}; & \\
};
\path [>=latex,->] (m-1-1) edge (m-2-1);
\path [>=latex,->] (m-2-1) edge (m-3-1);
\path [>=latex,->] (m-3-1) edge (m-4-1);
\path [>=latex,->] (m-4-1) edge (m-5-1);
\path [>=latex,->] (m-5-1) edge (m-6-1);
\path [>=latex,->] (m-6-1) edge (m-7-1);
\path [>=latex,->] (m-7-1) edge (m-8-1);
\path [>=latex,->] (m-8-1) edge (m-9-1);
\path [>=latex,->] (m-9-1) edge (m-10-1);
\path [>=latex,->] (m-10-1) edge (m-11-1);
\path [>=latex,->] (m-11-1) edge (m-12-1);
\end{tikzpicture}
\end{document}
Best Answer
For example: